• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java DrawingCache类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Listener类代码示例发布时间:2022-05-22
下一篇:
Java ITask类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap