Skip to content

Commit

Permalink
Rename function.
Browse files Browse the repository at this point in the history
  • Loading branch information
kevingpqi123 committed Jun 19, 2023
1 parent 8ec1873 commit 4e9cccf
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 35 deletions.
6 changes: 3 additions & 3 deletions android/libpag/src/main/java/org/libpag/PAGPlayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ public void setSurface(PAGSurface surface) {
* when first rendering BitmapComposition and VideoComposition,
* which will reduces memory consumption, and increases stability.
*/
public native boolean diskCacheEnabled();
public native boolean useDiskCache();

/**
* Set the value of diskCacheEnabled property.
* Set the value of useDiskCache property.
*/
public native void setDiskCacheEnabled(boolean value);
public native void setUseDiskCache(boolean value);

/**
* This value defines the scale factor for internal graphics caches, ranges from 0.0 to 1.0. The
Expand Down
5 changes: 2 additions & 3 deletions android/libpag/src/main/java/org/libpag/PAGView.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import android.opengl.EGLContext;
import android.os.Build;
import android.util.AttributeSet;
import android.util.Log;
import android.view.TextureView;
import android.view.View;

Expand Down Expand Up @@ -287,14 +286,14 @@ public void setCacheEnabled(boolean value) {
* which will reduces memory consumption, and increases stability.
*/
public boolean diskCacheEnabled() {
return pagPlayer.diskCacheEnabled();
return pagPlayer.useDiskCache();
}

/**
* Set the value of diskCacheEnabled property.
*/
public void setDiskCacheEnabled(boolean value) {
pagPlayer.setDiskCacheEnabled(value);
pagPlayer.setUseDiskCache(value);
}

/**
Expand Down
6 changes: 3 additions & 3 deletions include/pag/pag.h
Original file line number Diff line number Diff line change
Expand Up @@ -1333,12 +1333,12 @@ class PAG_API PAGPlayer {
* when first rendering BitmapComposition and VideoComposition,
* which will reduces memory consumption, and increases stability.
*/
bool diskCacheEnabled();
bool useDiskCache();

/**
* Set the value of diskCacheEnabled property.
* Set the value of useDiskCache property.
*/
void setDiskCacheEnabled(bool value);
void setUseDiskCache(bool value);

/**
* This value defines the scale factor for internal graphics caches, ranges from 0.0 to 1.0. The
Expand Down
9 changes: 4 additions & 5 deletions src/platform/android/JPAGPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,20 +316,19 @@ PAG_API jboolean Java_org_libpag_PAGPlayer_hitTestPoint(JNIEnv* env, jobject thi
return (jboolean)player->hitTestPoint(pagLayer, x, y, pixelHitTest);
}

PAG_API void Java_org_libpag_PAGPlayer_setDiskCacheEnabled(JNIEnv* env, jobject thiz,
jboolean value) {
PAG_API void Java_org_libpag_PAGPlayer_setUseDiskCache(JNIEnv* env, jobject thiz, jboolean value) {
auto player = getPAGPlayer(env, thiz);
if (player == nullptr) {
return;
}
player->setDiskCacheEnabled(value);
player->setUseDiskCache(value);
}

PAG_API jboolean Java_org_libpag_PAGPlayer_diskCacheEnabled(JNIEnv* env, jobject thiz) {
PAG_API jboolean Java_org_libpag_PAGPlayer_useDiskCache(JNIEnv* env, jobject thiz) {
auto player = getPAGPlayer(env, thiz);
if (player == nullptr) {
return JNI_FALSE;
}
return player->diskCacheEnabled();
return player->useDiskCache();
}
}
6 changes: 3 additions & 3 deletions src/platform/cocoa/PAGPlayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@ PAG_API @interface PAGPlayer : NSObject
* when first rendering BitmapComposition and VideoComposition,
* which will reduces memory consumption, and increases stability.
*/
- (BOOL)diskCacheEnabled;
- (BOOL)useDiskCache;

/**
* Set the value of diskCacheEnabled property.
* Set the value of useDiskCache property.
*/
- (void)setDiskCacheEnabled:(BOOL)value;
- (void)setUseDiskCache:(BOOL)value;

/**
* This value defines the scale factor for internal graphics caches, ranges from 0.0 to 1.0. The
Expand Down
8 changes: 4 additions & 4 deletions src/platform/cocoa/PAGPlayer.m
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@ - (void)setCacheEnabled:(BOOL)value {
[pagPlayer setCacheEnabled:value];
}

- (BOOL)diskCacheEnabled {
return [pagPlayer diskCacheEnabled];
- (BOOL)useDiskCache {
return [pagPlayer useDiskCache];
}

- (void)setDiskCacheEnabled:(BOOL)value {
[pagPlayer setDiskCacheEnabled:value];
- (void)setUseDiskCache:(BOOL)value {
[pagPlayer setUseDiskCache:value];
}

- (float)cacheScale {
Expand Down
4 changes: 2 additions & 2 deletions src/platform/cocoa/private/PAGPlayerImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@

- (void)setCacheEnabled:(BOOL)value;

- (BOOL)diskCacheEnabled;
- (BOOL)useDiskCache;

- (void)setDiskCacheEnabled:(BOOL)value;
- (void)setUseDiskCache:(BOOL)value;

- (float)cacheScale;

Expand Down
8 changes: 4 additions & 4 deletions src/platform/cocoa/private/PAGPlayerImpl.mm
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@ - (void)setCacheEnabled:(BOOL)value {
pagPlayer->setCacheEnabled(value);
}

- (BOOL)diskCacheEnabled {
return pagPlayer->diskCacheEnabled();
- (BOOL)useDiskCache {
return pagPlayer->useDiskCache();
}

- (void)setDiskCacheEnabled:(BOOL)value {
pagPlayer->setDiskCacheEnabled(value);
- (void)setUseDiskCache:(BOOL)value {
pagPlayer->setUseDiskCache(value);
}

- (float)cacheScale {
Expand Down
4 changes: 2 additions & 2 deletions src/platform/ios/PAGView.m
Original file line number Diff line number Diff line change
Expand Up @@ -238,11 +238,11 @@ - (void)setCacheEnabled:(BOOL)value {
}

- (BOOL)diskCacheEnabled {
return [pagPlayer diskCacheEnabled];
return [pagPlayer useDiskCache];
}

- (void)setDiskCacheEnabled:(BOOL)value {
[pagPlayer setDiskCacheEnabled:value];
[pagPlayer setUseDiskCache:value];
}

- (float)cacheScale {
Expand Down
8 changes: 4 additions & 4 deletions src/rendering/PAGPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,14 @@ void PAGPlayer::setCacheEnabled(bool value) {
renderCache->setSnapshotEnabled(value);
}

bool PAGPlayer::diskCacheEnabled() {
bool PAGPlayer::useDiskCache() {
LockGuard autoLock(rootLocker);
return renderCache->diskCacheEnabled();
return renderCache->useDiskCache();
}

void PAGPlayer::setDiskCacheEnabled(bool value) {
void PAGPlayer::setUseDiskCache(bool value) {
LockGuard autoLock(rootLocker);
renderCache->setDiskCacheEnabled(value);
renderCache->setUseDiskCache(value);
}

float PAGPlayer::cacheScale() {
Expand Down
4 changes: 2 additions & 2 deletions src/rendering/caches/RenderCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,14 @@ class RenderCache : public Performance {
* when first rendering BitmapComposition and VideoComposition,
* which will reduces memory consumption, and increases stability.
*/
bool diskCacheEnabled() const {
bool useDiskCache() const {
return _diskCacheEnabled;
}

/**
* Set the value of diskCacheEnabled property.
*/
void setDiskCacheEnabled(bool value) {
void setUseDiskCache(bool value) {
_diskCacheEnabled = value;
}

Expand Down

0 comments on commit 4e9cccf

Please sign in to comment.