本文整理汇总了Java中master.flame.danmaku.danmaku.model.AbsDisplayer.getExtraData方法的典型用法代码示例。如果您正苦于以下问题:Java AbsDisplayer.getExtraData方法的具体用法?Java AbsDisplayer.getExtraData怎么用?Java AbsDisplayer.getExtraData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类master.flame.danmaku.danmaku.model.AbsDisplayer
的用法示例。
在下文中一共展示了AbsDisplayer.getExtraData方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: drawDanmakus
import master.flame.danmaku.danmaku.model.AbsDisplayer; //导入方法依赖的package包/类
protected RenderingState drawDanmakus(AbsDisplayer<?> disp, DanmakuTimer timer) {
if (danmakuList != null) {
Canvas canvas = (Canvas) disp.getExtraData();
if (clearFlag > 0) {
DrawHelper.clearCanvas(canvas);
clearFlag--;
} else {
float[] refreshRect = mRenderer.getRefreshArea().mRefreshRect;
mRectCache.push(refreshRect);
float[] rect = mRectCache.getRect();
DrawHelper.clearCanvas(canvas, Math.max(0, rect[0]), Math.max(0, rect[1]),
Math.min(disp.getWidth(), rect[2]), Math.min(disp.getHeight(), rect[3]));
}
long currMills = timer.currMillisecond;
danmakus = danmakuList.sub(currMills - DanmakuFactory.MAX_DANMAKU_DURATION - 100,
currMills);
if (danmakus != null) {
return mRenderer.draw(mDisp, danmakus, mStartRenderTime);
}
}
return null;
}
示例2: drawDanmakus
import master.flame.danmaku.danmaku.model.AbsDisplayer; //导入方法依赖的package包/类
protected RenderingState drawDanmakus(AbsDisplayer disp, DanmakuTimer timer) {
if (clearRetainerFlag) {
mRenderer.clearRetainer();
clearRetainerFlag = false;
}
if (danmakuList != null) {
Canvas canvas = (Canvas) disp.getExtraData();
DrawHelper.clearCanvas(canvas);
if (mIsHidden) {
return mRenderingState;
}
long beginMills = timer.currMillisecond - mContext.mDanmakuFactory.MAX_DANMAKU_DURATION - 100;
long endMills = timer.currMillisecond + mContext.mDanmakuFactory.MAX_DANMAKU_DURATION;
if(mLastBeginMills > beginMills || timer.currMillisecond > mLastEndMills) {
IDanmakus subDanmakus = danmakuList.sub(beginMills, endMills);
if(subDanmakus != null) {
danmakus = subDanmakus;
}
mLastBeginMills = beginMills;
mLastEndMills = endMills;
} else {
beginMills = mLastBeginMills;
endMills = mLastEndMills;
}
if (danmakus != null && !danmakus.isEmpty()) {
RenderingState renderingState = mRenderingState = mRenderer.draw(mDisp, danmakus, mStartRenderTime);
if (renderingState.nothingRendered) {
if(mLastDanmaku != null && mLastDanmaku.isTimeOut()) {
mLastDanmaku = null;
if (mTaskListener != null) {
mTaskListener.onDanmakusDrawingFinished();
}
}
if (renderingState.beginTime == RenderingState.UNKNOWN_TIME) {
renderingState.beginTime = beginMills;
}
if (renderingState.endTime == RenderingState.UNKNOWN_TIME) {
renderingState.endTime = endMills;
}
}
return renderingState;
} else {
mRenderingState.nothingRendered = true;
mRenderingState.beginTime = beginMills;
mRenderingState.endTime = endMills;
return mRenderingState;
}
}
return null;
}
示例3: drawDanmakus
import master.flame.danmaku.danmaku.model.AbsDisplayer; //导入方法依赖的package包/类
protected RenderingState drawDanmakus(AbsDisplayer disp, DanmakuTimer timer) {
if (clearRetainerFlag) {
mRenderer.clearRetainer();
clearRetainerFlag = false;
}
if (danmakuList != null) {
Canvas canvas = (Canvas) disp.getExtraData();
DrawHelper.clearCanvas(canvas);
if (mIsHidden) {
return mRenderingState;
}
long beginMills = timer.currMillisecond - mContext.mDanmakuFactory.MAX_DANMAKU_DURATION - 100;
long endMills = timer.currMillisecond + mContext.mDanmakuFactory.MAX_DANMAKU_DURATION;
if(mLastBeginMills > beginMills || timer.currMillisecond > mLastEndMills) {
IDanmakus subDanmakus = danmakuList.sub(beginMills, endMills);
if(subDanmakus != null) {
danmakus = subDanmakus;
} else if (danmakus != null) {
BaseDanmaku last = danmakus.last();
if (last == null || last.isTimeOut()) {
danmakus.clear();
}
}
mLastBeginMills = beginMills;
mLastEndMills = endMills;
} else {
beginMills = mLastBeginMills;
endMills = mLastEndMills;
}
if (danmakus != null && !danmakus.isEmpty()) {
RenderingState renderingState = mRenderingState = mRenderer.draw(mDisp, danmakus, mStartRenderTime);
if (renderingState.nothingRendered) {
if(mTaskListener != null && mLastDanmaku != null && mLastDanmaku.isTimeOut()) {
mTaskListener.onDanmakusDrawingFinished();
}
if (renderingState.beginTime == RenderingState.UNKNOWN_TIME) {
renderingState.beginTime = beginMills;
}
if (renderingState.endTime == RenderingState.UNKNOWN_TIME) {
renderingState.endTime = endMills;
}
}
return renderingState;
} else {
mRenderingState.nothingRendered = true;
mRenderingState.beginTime = beginMills;
mRenderingState.endTime = endMills;
return mRenderingState;
}
}
return null;
}
示例4: drawDanmakus
import master.flame.danmaku.danmaku.model.AbsDisplayer; //导入方法依赖的package包/类
protected RenderingState drawDanmakus(AbsDisplayer disp, DanmakuTimer timer) {
if (clearRetainerFlag) {
mRenderer.clearRetainer();
clearRetainerFlag = false;
}
if (danmakuList != null) {
Canvas canvas = (Canvas) disp.getExtraData();
DrawHelper.clearCanvas(canvas);
if (mIsHidden) {
return mRenderingState;
}
long beginMills = timer.currMillisecond - mContext.mDanmakuFactory.MAX_DANMAKU_DURATION - 100;
long endMills = timer.currMillisecond + mContext.mDanmakuFactory.MAX_DANMAKU_DURATION;
if(mLastBeginMills > beginMills || timer.currMillisecond > mLastEndMills) {
IDanmakus subDanmakus = danmakuList.sub(beginMills, endMills);
if(subDanmakus != null) {
danmakus = subDanmakus;
} else {
danmakus.clear();
}
mLastBeginMills = beginMills;
mLastEndMills = endMills;
} else {
beginMills = mLastBeginMills;
endMills = mLastEndMills;
}
if (danmakus != null && !danmakus.isEmpty()) {
RenderingState renderingState = mRenderingState = mRenderer.draw(mDisp, danmakus, mStartRenderTime);
if (renderingState.nothingRendered) {
if(mTaskListener != null && mLastDanmaku != null && mLastDanmaku.isTimeOut()) {
mTaskListener.onDanmakusDrawingFinished();
}
if (renderingState.beginTime == RenderingState.UNKNOWN_TIME) {
renderingState.beginTime = beginMills;
}
if (renderingState.endTime == RenderingState.UNKNOWN_TIME) {
renderingState.endTime = endMills;
}
}
return renderingState;
} else {
mRenderingState.nothingRendered = true;
mRenderingState.beginTime = beginMills;
mRenderingState.endTime = endMills;
return mRenderingState;
}
}
return null;
}