Java Code Examples for master.flame.danmaku.danmaku.model.IDisplayer#isHardwareAccelerated()
The following examples show how to use
master.flame.danmaku.danmaku.model.IDisplayer#isHardwareAccelerated() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DanmakuUtils.java From letv with Apache License 2.0 | 5 votes |
public static DrawingCache buildDanmakuDrawingCache(BaseDanmaku danmaku, IDisplayer disp, DrawingCache cache) { if (cache == null) { cache = new DrawingCache(); } cache.build((int) Math.ceil((double) danmaku.paintWidth), (int) Math.ceil((double) danmaku.paintHeight), disp.getDensityDpi(), false); DrawingCacheHolder holder = cache.get(); if (holder != null) { ((AbsDisplayer) disp).drawDanmaku(danmaku, holder.canvas, 0.0f, 0.0f, true); if (disp.isHardwareAccelerated()) { holder.splitWith(disp.getWidth(), disp.getHeight(), disp.getMaximumCacheWidth(), disp.getMaximumCacheHeight()); } } return cache; }
Example 2
Source File: DanmakuUtils.java From letv with Apache License 2.0 | 4 votes |
public static final boolean isOverSize(IDisplayer disp, BaseDanmaku item) { return disp.isHardwareAccelerated() && (item.paintWidth > ((float) disp.getMaximumCacheWidth()) || item.paintHeight > ((float) disp.getMaximumCacheHeight())); }