use of master.flame.danmaku.danmaku.model.android.AndroidDisplayer in project ABPlayer by winkstu.
the class DrawHandler method createDrawTask.
private IDrawTask createDrawTask(boolean useDrwaingCache, DanmakuTimer timer, Context context, int width, int height, boolean isHardwareAccelerated, IDrawTask.TaskListener taskListener) {
mDisp = new AndroidDisplayer();
mDisp.setSize(width, height);
DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
mDisp.setDensities(displayMetrics.density, displayMetrics.densityDpi, displayMetrics.scaledDensity);
mDisp.resetSlopPixel(DanmakuGlobalConfig.DEFAULT.scaleTextSize);
mDisp.setHardwareAccelerated(isHardwareAccelerated);
obtainMessage(NOTIFY_DISP_SIZE_CHANGED, false).sendToTarget();
IDrawTask task = useDrwaingCache ? new CacheManagingDrawTask(timer, context, mDisp, taskListener, 1024 * 1024 * AndroidUtils.getMemoryClass(context) / 3) : new DrawTask(timer, context, mDisp, taskListener);
task.setParser(mParser);
task.prepare();
return task;
}
Aggregations