当前位置: 首页>>代码示例>>Java>>正文


Java IDrawingCache.hasReferences方法代码示例

本文整理汇总了Java中master.flame.danmaku.danmaku.model.IDrawingCache.hasReferences方法的典型用法代码示例。如果您正苦于以下问题:Java IDrawingCache.hasReferences方法的具体用法?Java IDrawingCache.hasReferences怎么用?Java IDrawingCache.hasReferences使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在master.flame.danmaku.danmaku.model.IDrawingCache的用法示例。


在下文中一共展示了IDrawingCache.hasReferences方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
 
开发者ID:lisnstatic,项目名称:live_master,代码行数:26,代码来源:CacheManagingDrawTask.java

示例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;
        }
    }
}
 
开发者ID:amikey,项目名称:DanmakuFlameMaster,代码行数:21,代码来源:CacheManagingDrawTask.java

示例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;
}
 
开发者ID:amikey,项目名称:DanmakuFlameMaster,代码行数:26,代码来源:CacheManagingDrawTask.java

示例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;
}
 
开发者ID:jiangerji,项目名称:danmaku-project,代码行数:26,代码来源:CacheManagingDrawTask.java

示例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;
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:28,代码来源:CacheManagingDrawTask.java

示例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;
}
 
开发者ID:amikey,项目名称:DanmakuFlameMaster,代码行数:16,代码来源:CacheManagingDrawTask.java

示例7: findReuseableCache

import master.flame.danmaku.danmaku.model.IDrawingCache; //导入方法依赖的package包/类
private BaseDanmaku findReuseableCache(BaseDanmaku refDanmaku,
                                       boolean strictMode,
                                       int maximumTimes) {
    IDanmakuIterator it = mCaches.iterator();
    int slopPixel = 0;
    if (!strictMode) {
        slopPixel = mDisp.getSlopPixel() * 2;
    }
    int count = 0;
    while (it.hasNext() && count++ < maximumTimes) {  // limit maximum times
        BaseDanmaku danmaku = it.next();
        IDrawingCache<?> cache = danmaku.getDrawingCache();
        if (cache == null || cache.get() == null) {
            continue;
        }
        if (danmaku.paintWidth == refDanmaku.paintWidth
                && danmaku.paintHeight == refDanmaku.paintHeight
                && danmaku.underlineColor == refDanmaku.underlineColor
                && danmaku.borderColor == refDanmaku.borderColor
                && danmaku.textColor == refDanmaku.textColor
                && danmaku.text.equals(refDanmaku.text)) {
            return danmaku;
        }
        if (strictMode) {
            continue;
        }
        if (!danmaku.isTimeOut()) {
            break;
        }
        if (cache.hasReferences()) {
            continue;
        }
        float widthGap = cache.width() - refDanmaku.paintWidth;
        float heightGap = cache.height() - refDanmaku.paintHeight;
        if (widthGap >= 0 && widthGap <= slopPixel &&
                heightGap >= 0 && heightGap <= slopPixel) {
            return danmaku;
        }
    }
    return null;
}
 
开发者ID:amikey,项目名称:DanmakuFlameMaster,代码行数:42,代码来源:CacheManagingDrawTask.java


注:本文中的master.flame.danmaku.danmaku.model.IDrawingCache.hasReferences方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。