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


Java IRenderer.NOTHING_RENDERING属性代码示例

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


在下文中一共展示了IRenderer.NOTHING_RENDERING属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: draw

@Override
public int draw(BaseDanmaku danmaku) {
    float top = danmaku.getTop();
    float left = danmaku.getLeft();
    if (canvas != null) {

        Paint alphaPaint = null;
        boolean needRestore = false;
        if (danmaku.getType() == BaseDanmaku.TYPE_SPECIAL) {
            if (danmaku.getAlpha() == AlphaValue.TRANSPARENT) {
                return IRenderer.NOTHING_RENDERING;
            }
            if (danmaku.rotationZ != 0 || danmaku.rotationY != 0) {
                saveCanvas(danmaku, canvas, left, top);
                needRestore = true;
            }

            int alpha = danmaku.getAlpha();
            if (alpha != AlphaValue.MAX) {
                alphaPaint = ALPHA_PAINT;
                alphaPaint.setAlpha(danmaku.getAlpha());
            }
        }

        // skip drawing when danmaku is transparent
        if (alphaPaint != null && alphaPaint.getAlpha() == AlphaValue.TRANSPARENT) {
            return IRenderer.NOTHING_RENDERING;
        }
        // drawing cache
        boolean cacheDrawn = false;
        int result = IRenderer.CACHE_RENDERING;
        if (danmaku.hasDrawingCache()) {
            DrawingCacheHolder holder = ((DrawingCache) danmaku.cache).get();
            if (holder != null) {
                cacheDrawn = holder.draw(canvas, left, top, alphaPaint);
            }
        }
        if (!cacheDrawn) {
            if (alphaPaint != null) {
                PAINT.setAlpha(alphaPaint.getAlpha());
            } else {
                resetPaintAlpha(PAINT);
            }
            drawDanmaku(danmaku, canvas, left, top, false);
            result = IRenderer.TEXT_RENDERING;
        }

        if (needRestore) {
            restoreCanvas(canvas);
        }

        return result;
    }

    return IRenderer.NOTHING_RENDERING;
}
 
开发者ID:lisnstatic,项目名称:live_master,代码行数:56,代码来源:AndroidDisplayer.java

示例2: draw

@Override
public int draw(BaseDanmaku danmaku) {
    float top = danmaku.getTop();
    float left = danmaku.getLeft();
    if (canvas != null) {

        Paint alphaPaint = null;
        boolean needRestore = false;
        if (danmaku.getType() == BaseDanmaku.TYPE_SPECIAL) {
            if (danmaku.getAlpha() == AlphaValue.TRANSPARENT) {
                return IRenderer.NOTHING_RENDERING;
            }
            if (danmaku.rotationZ != 0 || danmaku.rotationY != 0) {
                saveCanvas(danmaku, canvas, left, top);
                needRestore = true;
            }

            int alpha = danmaku.getAlpha();
            if (alpha != AlphaValue.MAX) {
                alphaPaint = ALPHA_PAINT;
                alphaPaint.setAlpha(danmaku.getAlpha());
            }
        }

        // skip drawing when danmaku is transparent
        if (alphaPaint != null && alphaPaint.getAlpha() == AlphaValue.TRANSPARENT) {
            return IRenderer.NOTHING_RENDERING;
        }
        // drawing cache
        boolean cacheDrawn = false;
        int result = IRenderer.CACHE_RENDERING;
        IDrawingCache<?> cache = danmaku.getDrawingCache();
        if (cache != null) {
            DrawingCacheHolder holder = (DrawingCacheHolder) cache.get();
            if (holder != null) {
                cacheDrawn = holder.draw(canvas, left, top, alphaPaint);
            }
        }
        if (!cacheDrawn) {
            if (alphaPaint != null) {
                PAINT.setAlpha(alphaPaint.getAlpha());
            } else {
                resetPaintAlpha(PAINT);
            }
            drawDanmaku(danmaku, canvas, left, top, false);
            result = IRenderer.TEXT_RENDERING;
        }

        if (needRestore) {
            restoreCanvas(canvas);
        }

        return result;
    }

    return IRenderer.NOTHING_RENDERING;
}
 
开发者ID:amikey,项目名称:DanmakuFlameMaster,代码行数:57,代码来源:AndroidDisplayer.java

示例3: draw

@Override
public int draw(BaseDanmaku danmaku) {
    float top = danmaku.getTop();
    float left = danmaku.getLeft();
    if (canvas != null) {

        Paint alphaPaint = null;
        boolean needRestore = false;
        if (danmaku.getType() == BaseDanmaku.TYPE_SPECIAL) {
            if (danmaku.getAlpha() == AlphaValue.TRANSPARENT) {
                return IRenderer.NOTHING_RENDERING;
            }
            if (danmaku.rotationZ != 0 || danmaku.rotationY != 0) {
                saveCanvas(danmaku, canvas, left, top);
                needRestore = true;
            }

            int alpha = danmaku.getAlpha();
            if (alpha != AlphaValue.MAX) {
                alphaPaint = ALPHA_PAINT;
                alphaPaint.setAlpha(danmaku.getAlpha());
            }
        }

        // skip drawing when danmaku is transparent
        if (alphaPaint != null && alphaPaint.getAlpha() == AlphaValue.TRANSPARENT) {
            return IRenderer.NOTHING_RENDERING;
        }
        // drawing cache
        boolean cacheDrawn = false;
        int result = IRenderer.CACHE_RENDERING;
        if (danmaku.hasDrawingCache()) {
            DrawingCacheHolder holder = ((DrawingCache) danmaku.cache).get();
            if (holder != null) {
                cacheDrawn = holder.draw(canvas, left, top, alphaPaint);
            }
        }
        if (!cacheDrawn) {
            if (alphaPaint != null) {
                PAINT.setAlpha(alphaPaint.getAlpha());
            } else {
                resetPaintAlpha(PAINT);
            }
            drawDanmaku(danmaku, canvas, left, top, true);
            result = IRenderer.TEXT_RENDERING;
        }

        if (needRestore) {
            restoreCanvas(canvas);
        }

        return result;
    }

    return IRenderer.NOTHING_RENDERING;
}
 
开发者ID:liucloo,项目名称:ijkPlayer-Danmaku,代码行数:56,代码来源:AndroidDisplayer.java


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