Skip to content

Commit 62c9f0c

Browse files
FusionXudomchen
authored andcommitted
Apply code format changes
1 parent 9329b3d commit 62c9f0c

File tree

3 files changed

+16
-14
lines changed

3 files changed

+16
-14
lines changed

Diff for: src/platform/android/JVideoDecoder.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020
#include "platform/android/GPUDecoder.h"
2121

2222
extern "C" {
23-
JNIEXPORT void Java_org_libpag_VideoDecoder_RegisterSoftwareDecoderFactory(JNIEnv*, jclass,
23+
JNIEXPORT void Java_org_libpag_VideoDecoder_RegisterSoftwareDecoderFactory(JNIEnv *, jclass,
2424
jlong factory) {
2525
pag::PAGVideoDecoder::RegisterSoftwareDecoderFactory(
26-
reinterpret_cast<pag::SoftwareDecoderFactory*>(factory));
26+
reinterpret_cast<pag::SoftwareDecoderFactory *>(factory));
2727
}
2828

29-
JNIEXPORT void Java_org_libpag_VideoDecoder_SetMaxHardwareDecoderCount(JNIEnv*, jclass,
29+
JNIEXPORT void Java_org_libpag_VideoDecoder_SetMaxHardwareDecoderCount(JNIEnv *, jclass,
3030
jint maxCount) {
3131
pag::PAGVideoDecoder::SetMaxHardwareDecoderCount(maxCount);
3232
}

Diff for: src/rendering/caches/RenderCache.cpp

+8-6
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222
#include "base/utils/TimeUtil.h"
2323
#include "base/utils/USE.h"
2424
#include "base/utils/UniqueID.h"
25-
#include "video/VideoDecoder.h"
2625
#include "rendering/caches/ImageContentCache.h"
2726
#include "rendering/caches/LayerCache.h"
2827
#include "rendering/renderers/FilterRenderer.h"
28+
#include "video/VideoDecoder.h"
2929

3030
namespace pag {
3131
// 300M设置的大一些用于兜底,通常在大于20M时就开始随时清理。
@@ -167,9 +167,10 @@ void RenderCache::prepareFrame() {
167167
for (auto& item : layerDistances) {
168168
for (auto pagLayer : item.second) {
169169
if (pagLayer->layerType() == LayerType::PreCompose) {
170-
auto policy = VideoDecoder::SoftwareToHardwareEnabled()
171-
&& item.first < MIN_HARDWARE_PREPARE_TIME
172-
? DecodingPolicy::SoftwareToHardware : DecodingPolicy::Hardware;
170+
auto policy =
171+
VideoDecoder::SoftwareToHardwareEnabled() && item.first < MIN_HARDWARE_PREPARE_TIME
172+
? DecodingPolicy::SoftwareToHardware
173+
: DecodingPolicy::Hardware;
173174
preparePreComposeLayer(static_cast<PreComposeLayer*>(pagLayer->layer), policy);
174175
} else if (pagLayer->layerType() == LayerType::Image) {
175176
prepareImageLayer(static_cast<PAGImageLayer*>(pagLayer));
@@ -422,8 +423,9 @@ std::shared_ptr<SequenceReader> RenderCache::getSequenceReader(Sequence* sequenc
422423
if (reader == nullptr) {
423424
auto file = stage->getSequenceFile(sequence);
424425
reader = MakeSequenceReader(file, sequence,
425-
VideoDecoder::SoftwareToHardwareEnabled() ?
426-
DecodingPolicy::SoftwareToHardware : DecodingPolicy::Hardware);
426+
VideoDecoder::SoftwareToHardwareEnabled()
427+
? DecodingPolicy::SoftwareToHardware
428+
: DecodingPolicy::Hardware);
427429
if (reader && !staticComposition) {
428430
// 完全静态的序列帧不用缓存。
429431
sequenceCaches[compositionID] = reader;

Diff for: src/rendering/renderers/CompositionRenderer.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818

1919
#include "CompositionRenderer.h"
2020
#include "LayerRenderer.h"
21-
#include "video/VideoDecoder.h"
2221
#include "rendering/caches/LayerCache.h"
2322
#include "rendering/caches/RenderCache.h"
2423
#include "rendering/graphics/Picture.h"
2524
#include "rendering/graphics/Recorder.h"
2625
#include "rendering/readers/BitmapSequenceReader.h"
26+
#include "video/VideoDecoder.h"
2727

2828
namespace pag {
2929
class SequenceProxy : public TextureProxy {
@@ -37,10 +37,10 @@ class SequenceProxy : public TextureProxy {
3737
}
3838

3939
void prepare(RenderCache* cache) const override {
40-
static_cast<RenderCache*>(cache)->
41-
prepareSequenceReader(sequence, frame,
42-
VideoDecoder::SoftwareToHardwareEnabled() ?
43-
DecodingPolicy::SoftwareToHardware : DecodingPolicy::Hardware);
40+
static_cast<RenderCache*>(cache)->prepareSequenceReader(
41+
sequence, frame,
42+
VideoDecoder::SoftwareToHardwareEnabled() ? DecodingPolicy::SoftwareToHardware
43+
: DecodingPolicy::Hardware);
4444
}
4545

4646
std::shared_ptr<Texture> getTexture(RenderCache* cache) const override {

0 commit comments

Comments
 (0)