本文整理汇总了Java中master.flame.danmaku.danmaku.model.android.DrawingCache类的典型用法代码示例。如果您正苦于以下问题:Java DrawingCache类的具体用法?Java DrawingCache怎么用?Java DrawingCache使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DrawingCache类属于master.flame.danmaku.danmaku.model.android包,在下文中一共展示了DrawingCache类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createCache
import master.flame.danmaku.danmaku.model.android.DrawingCache; //导入依赖的package包/类
public boolean createCache(BaseDanmaku item) {
if (!item.isMeasured()) {
item.measure(CacheManagingDrawTask.this.mDisp, true);
}
DrawingCache cache = null;
try {
cache = DanmakuUtils.buildDanmakuDrawingCache(item, CacheManagingDrawTask.this.mDisp, (DrawingCache) CacheManager.this.mCachePool.acquire());
item.cache = cache;
return true;
} catch (OutOfMemoryError e) {
if (cache != null) {
CacheManager.this.mCachePool.release(cache);
}
item.cache = null;
return false;
} catch (Exception e2) {
if (cache != null) {
CacheManager.this.mCachePool.release(cache);
}
item.cache = null;
return false;
}
}
开发者ID:JackChan1999,项目名称:letv,代码行数:24,代码来源:CacheManagingDrawTask.java
示例2: releaseDanmakuCache
import master.flame.danmaku.danmaku.model.android.DrawingCache; //导入依赖的package包/类
private void releaseDanmakuCache(BaseDanmaku item, DrawingCache cache) {
if (cache == null) {
cache = item.cache;
}
item.cache = null;
if (cache != null) {
cache.destroy();
CacheManager.this.mCachePool.release(cache);
}
}
开发者ID:JackChan1999,项目名称:letv,代码行数:11,代码来源:CacheManagingDrawTask.java
示例3: clearCachePool
import master.flame.danmaku.danmaku.model.android.DrawingCache; //导入依赖的package包/类
private void clearCachePool() {
while (true) {
DrawingCache item = (DrawingCache) this.mCachePool.acquire();
if (item != null) {
item.destroy();
} else {
return;
}
}
}
开发者ID:JackChan1999,项目名称:letv,代码行数:11,代码来源:CacheManagingDrawTask.java
示例4: entryRemoved
import master.flame.danmaku.danmaku.model.android.DrawingCache; //导入依赖的package包/类
protected void entryRemoved(boolean evicted, BaseDanmaku oldValue, BaseDanmaku newValue) {
IDrawingCache<?> cache = oldValue.getDrawingCache();
if (cache != null) {
long releasedSize = clearCache(oldValue);
if (oldValue.isTimeOut()) {
mContext.getDisplayer().getCacheStuffer().releaseResource(oldValue);
}
if (releasedSize <= 0) return;
mRealSize -= releasedSize;
mCachePool.release((DrawingCache) cache);
}
}
开发者ID:amikey,项目名称:DanmakuFlameMaster,代码行数:13,代码来源:CacheManagingDrawTask.java
示例5: entryRemoved
import master.flame.danmaku.danmaku.model.android.DrawingCache; //导入依赖的package包/类
protected void entryRemoved(boolean evicted, BaseDanmaku oldValue, BaseDanmaku newValue) {
if (oldValue.cache != null) {
if (oldValue.cache.hasReferences()) {
oldValue.cache.decreaseReference();
oldValue.cache = null;
return;
}
mRealSize -= sizeOf(oldValue);
oldValue.cache.destroy();
mCachePool.release((DrawingCache) oldValue.cache);
oldValue.cache = null;
}
}
开发者ID:liucloo,项目名称:ijkPlayer-Danmaku,代码行数:14,代码来源:CacheManagingDrawTask.java
示例6: entryRemoved
import master.flame.danmaku.danmaku.model.android.DrawingCache; //导入依赖的package包/类
protected void entryRemoved(boolean evicted, BaseDanmaku oldValue, BaseDanmaku newValue) {
if (oldValue.cache != null) {
if (oldValue.cache.hasReferences()) {
oldValue.cache.decreaseReference();
oldValue.cache = null;
return;
}
mRealSize -= sizeOf(oldValue);
oldValue.cache.destroy();
mCachePool.release((DrawingCache) oldValue.cache);
oldValue.cache = null;
}
}
开发者ID:jiangerji,项目名称:danmaku-project,代码行数:14,代码来源:CacheManagingDrawTask.java
示例7: clearCachePool
import master.flame.danmaku.danmaku.model.android.DrawingCache; //导入依赖的package包/类
private void clearCachePool() {
DrawingCache item;
while ((item = mCachePool.acquire()) != null) {
item.destroy();
}
}
开发者ID:lisnstatic,项目名称:live_master,代码行数:7,代码来源:CacheManagingDrawTask.java
示例8: handleMessage
import master.flame.danmaku.danmaku.model.android.DrawingCache; //导入依赖的package包/类
@Override
public void handleMessage(Message msg) {
int what = msg.what;
switch (what) {
case PREPARE:
evictAllNotInScreen();
for (int i = 0; i < 300; i++) {
mCachePool.release(new DrawingCache());
}
case DISPATCH_ACTIONS:
//Log.e(TAG,"dispatch_actions:"+mCacheTimer.currMillisecond+":"+mTimer.currMillisecond);
long delayed = dispatchAction();
if (delayed <= 0) {
delayed = mContext.mDanmakuFactory.MAX_DANMAKU_DURATION / 2;
}
sendEmptyMessageDelayed(DISPATCH_ACTIONS, delayed);
break;
case BUILD_CACHES:
removeMessages(BUILD_CACHES);
boolean repositioned = ((mTaskListener != null && mReadyState == false) || mSeekedFlag);
prepareCaches(repositioned);
if (repositioned)
mSeekedFlag = false;
if (mTaskListener != null && mReadyState == false) {
mTaskListener.ready();
mReadyState = true;
}
// Log.i(TAG,"BUILD_CACHES:"+mCacheTimer.currMillisecond+":"+mTimer.currMillisecond);
break;
case ADD_DANMAKKU:
BaseDanmaku item = (BaseDanmaku) msg.obj;
addDanmakuAndBuildCache(item);
break;
case CLEAR_TIMEOUT_CACHES:
clearTimeOutCaches();
break;
case SEEK:
Long seekMills = (Long) msg.obj;
if (seekMills != null) {
mCacheTimer.update(seekMills.longValue());
mSeekedFlag = true;
evictAllNotInScreen();
resume();
}
break;
case QUIT:
removeCallbacksAndMessages(null);
mPause = true;
evictAll();
clearCachePool();
this.getLooper().quit();
break;
case CLEAR_ALL_CACHES:
evictAll();
mCacheTimer.update(mTimer.currMillisecond - mContext.mDanmakuFactory.MAX_DANMAKU_DURATION);
mSeekedFlag = true;
break;
case CLEAR_OUTSIDE_CACHES:
evictAllNotInScreen(true);
mCacheTimer.update(mTimer.currMillisecond);
break;
case CLEAR_OUTSIDE_CACHES_AND_RESET:
evictAllNotInScreen(true);
mCacheTimer.update(mTimer.currMillisecond);
requestClear();
break;
}
}
开发者ID:liucloo,项目名称:ijkPlayer-Danmaku,代码行数:69,代码来源:CacheManagingDrawTask.java
示例9: handleMessage
import master.flame.danmaku.danmaku.model.android.DrawingCache; //导入依赖的package包/类
@Override
public void handleMessage(Message msg) {
int what = msg.what;
switch (what) {
case PREPARE:
evictAllNotInScreen();
for (int i = 0; i < 200; i++) {
mCachePool.release(new DrawingCache());
}
case DISPATCH_ACTIONS:
//Log.e(TAG,"dispatch_actions:"+mCacheTimer.currMillisecond+":"+mTimer.currMillisecond);
long delayed = dispatchAction();
if (delayed <= 0) {
delayed = DanmakuFactory.MAX_DANMAKU_DURATION;
}
sendEmptyMessageDelayed(DISPATCH_ACTIONS, delayed);
break;
case BUILD_CACHES:
boolean repositioned = (mTaskListener != null || mSeekedFlag);
prepareCaches(repositioned);
if (repositioned)
mSeekedFlag = false;
if (mTaskListener != null) {
mTaskListener.ready();
mTaskListener = null;
}
// Log.i(TAG,"BUILD_CACHES:"+mCacheTimer.currMillisecond+":"+mTimer.currMillisecond);
break;
case ADD_DANMAKKU:
synchronized (danmakuList) {
BaseDanmaku item = (BaseDanmaku) msg.obj;
buildCache(item);
CacheManagingDrawTask.super.addDanmaku(item);
if (item.isLive) {
removeUnusedLiveDanmakusIn(5);
mCacheTimer.update(mTimer.currMillisecond
+ DanmakuFactory.MAX_DANMAKU_DURATION * mScreenSize);
}
}
break;
case CLEAR_TIMEOUT_CACHES:
clearTimeOutCaches();
break;
case SEEK:
Long seekMills = (Long)msg.obj;
if(seekMills!=null){
mCacheTimer.update(seekMills.longValue());
mSeekedFlag = true;
evictAllNotInScreen();
resume();
}
break;
case QUIT:
removeCallbacksAndMessages(null);
mPause = true;
evictAll();
clearCachePool();
this.getLooper().quit();
break;
case CLEAR_ALL_CACHES:
evictAll();
reset();
// GlobalFlagValues.updateVisibleFlag();
mCacheTimer.update(mTimer.currMillisecond);
mSeekedFlag = true;
clearFlag = 5;
break;
case CLEAR_OUTSIDE_CACHES:
evictAllNotInScreen(true);
mCacheTimer.update(mTimer.currMillisecond);
break;
case CLEAR_OUTSIDE_CACHES_AND_RESET:
evictAllNotInScreen(true);
reset();
mCacheTimer.update(mTimer.currMillisecond);
requestClear();
break;
}
}
开发者ID:jiangerji,项目名称:danmaku-project,代码行数:80,代码来源:CacheManagingDrawTask.java
注:本文中的master.flame.danmaku.danmaku.model.android.DrawingCache类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论