本文整理汇总了Java中master.flame.danmaku.danmaku.model.IDrawingCache.destroy方法的典型用法代码示例。如果您正苦于以下问题:Java IDrawingCache.destroy方法的具体用法?Java IDrawingCache.destroy怎么用?Java IDrawingCache.destroy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类master.flame.danmaku.danmaku.model.IDrawingCache
的用法示例。
在下文中一共展示了IDrawingCache.destroy方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: evictAllNotInScreen
import master.flame.danmaku.danmaku.model.IDrawingCache; //导入方法依赖的package包/类
private void evictAllNotInScreen(boolean removeAllReferences) {
if (mCaches != null) {
IDanmakuIterator it = mCaches.iterator();
while (it.hasNext()) {
BaseDanmaku danmaku = it.next();
IDrawingCache<?> cache = danmaku.cache;
boolean hasReferences = cache != null && cache.hasReferences();
if (removeAllReferences && hasReferences) {
if (cache.get() != null) {
mRealSize -= cache.size();
cache.destroy();
}
entryRemoved(true, danmaku, null);
it.remove();
continue;
}
if (danmaku.hasDrawingCache() == false || danmaku.isOutside()) {
entryRemoved(true, danmaku, null);
it.remove();
}
}
// mCaches.clear();
}
mRealSize = 0;
}
示例2: onDanmakuRemoved
import master.flame.danmaku.danmaku.model.IDrawingCache; //导入方法依赖的package包/类
@Override
protected void onDanmakuRemoved(BaseDanmaku danmaku) {
super.onDanmakuRemoved(danmaku);
if (mCacheManager != null) {
if (++mRemaininCacheCount > 5) { // control frequency (it does not require very precise
mCacheManager.requestClearTimeout();
mRemaininCacheCount = 0;
}
} else {
IDrawingCache<?> cache = danmaku.getDrawingCache();
if (cache != null) {
if (cache.hasReferences()) {
cache.decreaseReference();
} else {
cache.destroy();
}
danmaku.cache = null;
}
}
}
示例3: evictAllNotInScreen
import master.flame.danmaku.danmaku.model.IDrawingCache; //导入方法依赖的package包/类
private void evictAllNotInScreen(boolean removeAllReferences) {
if (mCaches != null) {
IDanmakuIterator it = mCaches.iterator();
while (it.hasNext()) {
BaseDanmaku danmaku = it.next();
IDrawingCache<?> cache = danmaku.cache;
boolean hasReferences = cache != null && cache.hasReferences();
if (removeAllReferences && hasReferences) {
if (cache.get() != null) {
mRealSize -= cache.size();
cache.destroy();
}
entryRemoved(true, danmaku, null);
it.remove();
continue;
}
if (danmaku.isOutside()) {
entryRemoved(true, danmaku, null);
it.remove();
}
}
// mCaches.clear();
}
mRealSize = 0;
}
示例4: evictAllNotInScreen
import master.flame.danmaku.danmaku.model.IDrawingCache; //导入方法依赖的package包/类
private synchronized void evictAllNotInScreen(boolean removeAllReferences) {
if (mCaches != null) {
IDanmakuIterator it = mCaches.iterator();
while (it.hasNext()) {
BaseDanmaku danmaku = it.next();
IDrawingCache<?> cache = danmaku.cache;
boolean hasReferences = cache != null && cache.hasReferences();
if (removeAllReferences && hasReferences) {
if (cache.get() != null) {
mRealSize -= cache.size();
cache.destroy();
}
entryRemoved(true, danmaku, null);
it.remove();
continue;
}
if (danmaku.hasDrawingCache() == false || danmaku.isOutside()) {
entryRemoved(true, danmaku, null);
it.remove();
}
}
// mCaches.clear();
}
mRealSize = 0;
}
示例5: evictAllNotInScreen
import master.flame.danmaku.danmaku.model.IDrawingCache; //导入方法依赖的package包/类
private void evictAllNotInScreen(boolean removeAllReferences) {
if (this.mCaches != null) {
IDanmakuIterator it = this.mCaches.iterator();
while (it.hasNext()) {
BaseDanmaku danmaku = it.next();
IDrawingCache<?> cache = danmaku.cache;
boolean hasReferences;
if (cache == null || !cache.hasReferences()) {
hasReferences = false;
} else {
hasReferences = true;
}
if (removeAllReferences && hasReferences) {
if (cache.get() != null) {
this.mRealSize -= cache.size();
cache.destroy();
}
entryRemoved(true, danmaku, null);
it.remove();
} else if (!danmaku.hasDrawingCache() || danmaku.isOutside()) {
entryRemoved(true, danmaku, null);
it.remove();
}
}
}
this.mRealSize = 0;
}
示例6: clearCache
import master.flame.danmaku.danmaku.model.IDrawingCache; //导入方法依赖的package包/类
private long clearCache(BaseDanmaku oldValue) {
IDrawingCache<?> cache = oldValue.cache;
if (cache == null) {
return 0;
}
if (cache.hasReferences()) {
cache.decreaseReference();
oldValue.cache = null;
return 0;
}
long size = sizeOf(oldValue);
cache.destroy();
oldValue.cache = null;
return size;
}