本文整理汇总了Java中master.flame.danmaku.danmaku.renderer.IRenderer.RenderingState类的典型用法代码示例。如果您正苦于以下问题:Java RenderingState类的具体用法?Java RenderingState怎么用?Java RenderingState使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RenderingState类属于master.flame.danmaku.danmaku.renderer.IRenderer包,在下文中一共展示了RenderingState类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: drawDanmakus
import master.flame.danmaku.danmaku.renderer.IRenderer.RenderingState; //导入依赖的package包/类
public long drawDanmakus() {
if (!this.isSurfaceCreated) {
return 0;
}
if (!isShown()) {
return -1;
}
long stime = SystemClock.uptimeMillis();
Canvas canvas = this.mSurfaceHolder.lockCanvas();
if (canvas != null) {
if (this.handler != null) {
RenderingState rs = this.handler.draw(canvas);
if (this.mShowFps) {
if (this.mDrawTimes == null) {
this.mDrawTimes = new LinkedList();
}
long dtime = SystemClock.uptimeMillis() - stime;
DrawHelper.drawFPS(canvas, String.format(Locale.getDefault(), "fps %.2f,time:%d s,cache:%d,miss:%d", new Object[]{Float.valueOf(fps()), Long.valueOf(getCurrentTime() / 1000), Long.valueOf(rs.cacheHitCount), Long.valueOf(rs.cacheMissCount)}));
}
}
if (this.isSurfaceCreated) {
this.mSurfaceHolder.unlockCanvasAndPost(canvas);
}
}
return SystemClock.uptimeMillis() - stime;
}
开发者ID:JackChan1999,项目名称:letv,代码行数:27,代码来源:DanmakuSurfaceView.java
示例2: onDraw
import master.flame.danmaku.danmaku.renderer.IRenderer.RenderingState; //导入依赖的package包/类
protected void onDraw(Canvas canvas) {
if (this.mDanmakuVisible || this.mRequestRender) {
if (this.mClearFlag) {
DrawHelper.clearCanvas(canvas);
this.mClearFlag = false;
} else if (this.handler != null) {
RenderingState rs = this.handler.draw(canvas);
if (this.mShowFps) {
if (this.mDrawTimes == null) {
this.mDrawTimes = new LinkedList();
}
DrawHelper.drawFPS(canvas, String.format(Locale.getDefault(), "fps %.2f,time:%d s,cache:%d,miss:%d", new Object[]{Float.valueOf(fps()), Long.valueOf(getCurrentTime() / 1000), Long.valueOf(rs.cacheHitCount), Long.valueOf(rs.cacheMissCount)}));
}
}
this.mRequestRender = false;
unlockCanvasAndPost();
return;
}
super.onDraw(canvas);
}
开发者ID:JackChan1999,项目名称:letv,代码行数:21,代码来源:DanmakuView.java
示例3: onDraw
import master.flame.danmaku.danmaku.renderer.IRenderer.RenderingState; //导入依赖的package包/类
@Override
protected void onDraw(Canvas canvas) {
if ((!mDanmakuVisible) && (!mRequestRender)) {
super.onDraw(canvas);
return;
}
if (mClearFlag) {
DrawHelper.clearCanvas(canvas);
mClearFlag = false;
} else {
if (handler != null) {
RenderingState rs = handler.draw(canvas);
if (mShowFps) {
if (mDrawTimes == null)
mDrawTimes = new LinkedList<Long>();
String fps = String.format(Locale.getDefault(),
"fps %.2f,time:%d s,cache:%d,miss:%d", fps(), getCurrentTime() / 1000,
rs.cacheHitCount, rs.cacheMissCount);
DrawHelper.drawFPS(canvas, fps);
}
}
}
mRequestRender = false;
unlockCanvasAndPost();
}
开发者ID:lisnstatic,项目名称:live_master,代码行数:26,代码来源:DanmakuView.java
示例4: drawDanmakus
import master.flame.danmaku.danmaku.renderer.IRenderer.RenderingState; //导入依赖的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;
}
开发者ID:jiangerji,项目名称:danmaku-project,代码行数:23,代码来源:DrawTask.java
示例5: draw
import master.flame.danmaku.danmaku.renderer.IRenderer.RenderingState; //导入依赖的package包/类
public RenderingState draw(Canvas canvas) {
if (this.drawTask == null) {
return this.mRenderingState;
}
this.mDisp.setExtraData(canvas);
this.mRenderingState.set(this.drawTask.draw(this.mDisp));
recordRenderingTime();
return this.mRenderingState;
}
开发者ID:JackChan1999,项目名称:letv,代码行数:10,代码来源:DrawHandler.java
示例6: draw
import master.flame.danmaku.danmaku.renderer.IRenderer.RenderingState; //导入依赖的package包/类
public RenderingState draw(AbsDisplayer displayer) {
RenderingState result = super.draw(displayer);
synchronized (this.mDrawingNotify) {
this.mDrawingNotify.notify();
}
if (!(result == null || this.mCacheManager == null || result.incrementCount >= -20)) {
this.mCacheManager.requestClearTimeout();
this.mCacheManager.requestBuild(-this.mContext.mDanmakuFactory.MAX_DANMAKU_DURATION);
}
return result;
}
开发者ID:JackChan1999,项目名称:letv,代码行数:12,代码来源:CacheManagingDrawTask.java
示例7: drawDanmakus
import master.flame.danmaku.danmaku.renderer.IRenderer.RenderingState; //导入依赖的package包/类
public synchronized long drawDanmakus() {
long dtime;
if (this.isSurfaceCreated) {
long stime = SystemClock.uptimeMillis();
if (isShown()) {
Canvas canvas = lockCanvas();
if (canvas != null) {
if (this.handler != null) {
RenderingState rs = this.handler.draw(canvas);
if (this.mShowFps) {
if (this.mDrawTimes == null) {
this.mDrawTimes = new LinkedList();
}
dtime = SystemClock.uptimeMillis() - stime;
DrawHelper.drawFPS(canvas, String.format(Locale.getDefault(), "fps %.2f,time:%d s,cache:%d,miss:%d", new Object[]{Float.valueOf(fps()), Long.valueOf(getCurrentTime() / 1000), Long.valueOf(rs.cacheHitCount), Long.valueOf(rs.cacheMissCount)}));
}
}
if (this.isSurfaceCreated) {
unlockCanvasAndPost(canvas);
}
}
dtime = SystemClock.uptimeMillis() - stime;
} else {
dtime = -1;
}
} else {
dtime = 0;
}
return dtime;
}
开发者ID:JackChan1999,项目名称:letv,代码行数:31,代码来源:DanmakuTextureView.java
示例8: draw
import master.flame.danmaku.danmaku.renderer.IRenderer.RenderingState; //导入依赖的package包/类
public RenderingState draw(Canvas canvas) {
if (drawTask == null)
return mRenderingState;
mDisp.setExtraData(canvas);
mRenderingState.set(drawTask.draw(mDisp));
recordRenderingTime();
return mRenderingState;
}
开发者ID:lisnstatic,项目名称:live_master,代码行数:9,代码来源:DrawHandler.java
示例9: draw
import master.flame.danmaku.danmaku.renderer.IRenderer.RenderingState; //导入依赖的package包/类
@Override
public RenderingState draw(AbsDisplayer displayer) {
RenderingState result = super.draw(displayer);
synchronized (mDrawingNotify) {
mDrawingNotify.notify();
}
if (result != null && mCacheManager != null) {
if (result.incrementCount < -20) {
mCacheManager.requestClearTimeout();
mCacheManager.requestBuild(-mContext.mDanmakuFactory.MAX_DANMAKU_DURATION);
}
}
return result;
}
开发者ID:lisnstatic,项目名称:live_master,代码行数:15,代码来源:CacheManagingDrawTask.java
示例10: drawDanmakus
import master.flame.danmaku.danmaku.renderer.IRenderer.RenderingState; //导入依赖的package包/类
@Override
public long drawDanmakus() {
if (!isSurfaceCreated)
return 0;
if (!isShown())
return -1;
long stime = SystemClock.uptimeMillis();
long dtime = 0;
Canvas canvas = mSurfaceHolder.lockCanvas();
if (canvas != null){
if (handler != null) {
RenderingState rs = handler.draw(canvas);
if (mShowFps) {
if (mDrawTimes == null)
mDrawTimes = new LinkedList<Long>();
dtime = SystemClock.uptimeMillis() - stime;
String fps = String.format(Locale.getDefault(),
"fps %.2f,time:%d s,cache:%d,miss:%d", fps(), getCurrentTime() / 1000,
rs.cacheHitCount, rs.cacheMissCount);
DrawHelper.drawFPS(canvas, fps);
}
}
if (isSurfaceCreated)
mSurfaceHolder.unlockCanvasAndPost(canvas);
}
dtime = SystemClock.uptimeMillis() - stime;
return dtime;
}
开发者ID:lisnstatic,项目名称:live_master,代码行数:29,代码来源:DanmakuSurfaceView.java
示例11: drawDanmakus
import master.flame.danmaku.danmaku.renderer.IRenderer.RenderingState; //导入依赖的package包/类
@Override
public synchronized long drawDanmakus() {
if (!isSurfaceCreated)
return 0;
long stime = SystemClock.uptimeMillis();
if (!isShown())
return -1;
long dtime = 0;
Canvas canvas = lockCanvas();
if (canvas != null) {
if (handler != null) {
RenderingState rs = handler.draw(canvas);
if (mShowFps) {
if (mDrawTimes == null)
mDrawTimes = new LinkedList<Long>();
dtime = SystemClock.uptimeMillis() - stime;
String fps = String.format(Locale.getDefault(),
"fps %.2f,time:%d s,cache:%d,miss:%d", fps(), getCurrentTime() / 1000,
rs.cacheHitCount, rs.cacheMissCount);
DrawHelper.drawFPS(canvas, fps);
}
}
if (isSurfaceCreated)
unlockCanvasAndPost(canvas);
}
dtime = SystemClock.uptimeMillis() - stime;
return dtime;
}
开发者ID:lisnstatic,项目名称:live_master,代码行数:29,代码来源:DanmakuTextureView.java
示例12: drawDanmakus
import master.flame.danmaku.danmaku.renderer.IRenderer.RenderingState; //导入依赖的package包/类
@Override
public long drawDanmakus() {
if (!isSurfaceCreated)
return 0;
if (!isShown())
return -1;
long stime = System.currentTimeMillis();
long dtime = 0;
Canvas canvas = mSurfaceHolder.lockCanvas();
if (canvas != null){
if (handler != null) {
RenderingState rs = handler.draw(canvas);
if (mShowFps) {
if (mDrawTimes == null)
mDrawTimes = new LinkedList<Long>();
dtime = System.currentTimeMillis() - stime;
String fps = String.format(Locale.getDefault(),
"fps %.2f,time:%d s,cache:%d,miss:%d", fps(), getCurrentTime() / 1000,
rs.cacheHitCount, rs.cacheMissCount);
DrawHelper.drawFPS(canvas, fps);
}
}
if (isSurfaceCreated)
mSurfaceHolder.unlockCanvasAndPost(canvas);
}
dtime = System.currentTimeMillis() - stime;
return dtime;
}
开发者ID:liucloo,项目名称:ijkPlayer-Danmaku,代码行数:29,代码来源:DanmakuSurfaceView.java
示例13: drawDanmakus
import master.flame.danmaku.danmaku.renderer.IRenderer.RenderingState; //导入依赖的package包/类
@Override
public synchronized long drawDanmakus() {
if (!isSurfaceCreated)
return 0;
long stime = System.currentTimeMillis();
if (!isShown())
return -1;
long dtime = 0;
Canvas canvas = lockCanvas();
if (canvas != null) {
if (handler != null) {
RenderingState rs = handler.draw(canvas);
if (mShowFps) {
if (mDrawTimes == null)
mDrawTimes = new LinkedList<Long>();
dtime = System.currentTimeMillis() - stime;
String fps = String.format(Locale.getDefault(),
"fps %.2f,time:%d s,cache:%d,miss:%d", fps(), getCurrentTime() / 1000,
rs.cacheHitCount, rs.cacheMissCount);
DrawHelper.drawFPS(canvas, fps);
}
}
if (isSurfaceCreated)
unlockCanvasAndPost(canvas);
}
dtime = System.currentTimeMillis() - stime;
return dtime;
}
开发者ID:liucloo,项目名称:ijkPlayer-Danmaku,代码行数:29,代码来源:DanmakuTextureView.java
示例14: drawDanmakus
import master.flame.danmaku.danmaku.renderer.IRenderer.RenderingState; //导入依赖的package包/类
@Override
public long drawDanmakus() {
if (!isSurfaceCreated)
return 0;
if (!isShown())
return -1;
long stime = SystemClock.uptimeMillis();
long dtime = 0;
Canvas canvas = mSurfaceHolder.lockCanvas();
if (canvas != null) {
if (handler != null) {
RenderingState rs = handler.draw(canvas);
if (mShowFps) {
if (mDrawTimes == null)
mDrawTimes = new LinkedList<Long>();
dtime = SystemClock.uptimeMillis() - stime;
String fps = String.format(Locale.getDefault(),
"fps %.2f,time:%d s,cache:%d,miss:%d", fps(), getCurrentTime() / 1000,
rs.cacheHitCount, rs.cacheMissCount);
DrawHelper.drawFPS(canvas, fps);
}
}
if (isSurfaceCreated)
mSurfaceHolder.unlockCanvasAndPost(canvas);
}
dtime = SystemClock.uptimeMillis() - stime;
return dtime;
}
开发者ID:succlz123,项目名称:BlueBoard,代码行数:29,代码来源:DanmakuSurfaceView.java
示例15: draw
import master.flame.danmaku.danmaku.renderer.IRenderer.RenderingState; //导入依赖的package包/类
@Override
public RenderingState draw(AbsDisplayer<?> displayer) {
RenderingState result = null;
synchronized (danmakuList) {
result = super.draw(displayer);
}
synchronized(mDrawingNotify){
mDrawingNotify.notify();
}
return result;
}
开发者ID:jiangerji,项目名称:danmaku-project,代码行数:12,代码来源:CacheManagingDrawTask.java
示例16: draw
import master.flame.danmaku.danmaku.renderer.IRenderer.RenderingState; //导入依赖的package包/类
public synchronized RenderingState draw(AbsDisplayer displayer) {
return drawDanmakus(displayer, this.mTimer);
}
开发者ID:JackChan1999,项目名称:letv,代码行数:4,代码来源:DrawTask.java
示例17: drawDanmakus
import master.flame.danmaku.danmaku.renderer.IRenderer.RenderingState; //导入依赖的package包/类
protected RenderingState drawDanmakus(AbsDisplayer disp, DanmakuTimer timer) {
if (this.clearRetainerFlag) {
this.mRenderer.clearRetainer();
this.clearRetainerFlag = false;
}
if (this.danmakuList == null) {
return null;
}
DrawHelper.clearCanvas((Canvas) disp.getExtraData());
if (this.mIsHidden) {
return this.mRenderingState;
}
long beginMills = (timer.currMillisecond - this.mContext.mDanmakuFactory.MAX_DANMAKU_DURATION) - 100;
long endMills = timer.currMillisecond + this.mContext.mDanmakuFactory.MAX_DANMAKU_DURATION;
if (this.mLastBeginMills > beginMills || timer.currMillisecond > this.mLastEndMills) {
IDanmakus subDanmakus = this.danmakuList.sub(beginMills, endMills);
if (subDanmakus != null) {
this.danmakus = subDanmakus;
} else {
this.danmakus.clear();
}
this.mLastBeginMills = beginMills;
this.mLastEndMills = endMills;
} else {
beginMills = this.mLastBeginMills;
endMills = this.mLastEndMills;
}
if (this.danmakus == null || this.danmakus.isEmpty()) {
this.mRenderingState.nothingRendered = true;
this.mRenderingState.beginTime = beginMills;
this.mRenderingState.endTime = endMills;
return this.mRenderingState;
}
RenderingState renderingState = this.mRenderer.draw(this.mDisp, this.danmakus, this.mStartRenderTime);
this.mRenderingState = renderingState;
if (!renderingState.nothingRendered) {
return renderingState;
}
if (!(this.mTaskListener == null || this.mLastDanmaku == null || !this.mLastDanmaku.isTimeOut())) {
this.mTaskListener.onDanmakusDrawingFinished();
}
if (renderingState.beginTime == -1) {
renderingState.beginTime = beginMills;
}
if (renderingState.endTime != -1) {
return renderingState;
}
renderingState.endTime = endMills;
return renderingState;
}
开发者ID:JackChan1999,项目名称:letv,代码行数:51,代码来源:DrawTask.java
示例18: draw
import master.flame.danmaku.danmaku.renderer.IRenderer.RenderingState; //导入依赖的package包/类
public RenderingState draw(IDisplayer disp, IDanmakus danmakus, long startRenderTime) {
int lastTotalDanmakuCount = this.mRenderingState.totalDanmakuCount;
this.mRenderingState.reset();
IDanmakuIterator itr = danmakus.iterator();
int orderInScreen = 0;
this.mStartTimer.update(SystemClock.uptimeMillis());
int sizeInScreen = danmakus.size();
BaseDanmaku drawItem = null;
while (itr.hasNext()) {
drawItem = itr.next();
if (!drawItem.hasPassedFilter()) {
this.mContext.mDanmakuFilters.filter(drawItem, orderInScreen, sizeInScreen, this.mStartTimer, false, this.mContext);
}
if (drawItem.time >= startRenderTime && (!(drawItem.priority == (byte) 0 && drawItem.isFiltered()) && drawItem.time >= startRenderTime)) {
if (!drawItem.isDanmakuTypeFiltered || !drawItem.isFiltered()) {
if (drawItem.isLate()) {
if (this.mCacheManager == null || drawItem.hasDrawingCache()) {
break;
}
this.mCacheManager.addDanmaku(drawItem);
} else {
orderInScreen++;
if (!drawItem.isMeasured()) {
drawItem.measure(disp, false);
}
this.mDanmakusRetainer.fix(drawItem, disp, this.mVerifier);
if (!drawItem.isOutside() && drawItem.isShown()) {
if (drawItem.lines != null || drawItem.getBottom() <= ((float) disp.getHeight())) {
int renderingType = drawItem.draw(disp);
RenderingState renderingState;
if (renderingType == 1) {
renderingState = this.mRenderingState;
renderingState.cacheHitCount++;
} else if (renderingType == 2) {
renderingState = this.mRenderingState;
renderingState.cacheMissCount++;
if (this.mCacheManager != null) {
this.mCacheManager.addDanmaku(drawItem);
}
}
this.mRenderingState.addCount(drawItem.getType(), 1);
this.mRenderingState.addTotalCount(1);
if (!(this.mOnDanmakuShownListener == null || drawItem.firstShownFlag == this.mContext.mGlobalFlagValues.FIRST_SHOWN_RESET_FLAG)) {
drawItem.firstShownFlag = this.mContext.mGlobalFlagValues.FIRST_SHOWN_RESET_FLAG;
this.mOnDanmakuShownListener.onDanmakuShown(drawItem);
}
}
}
}
}
}
}
this.mRenderingState.nothingRendered = this.mRenderingState.totalDanmakuCount == 0;
this.mRenderingState.endTime = drawItem != null ? drawItem.time : -1;
if (this.mRenderingState.nothingRendered) {
this.mRenderingState.beginTime = -1;
}
this.mRenderingState.incrementCount = this.mRenderingState.totalDanmakuCount - lastTotalDanmakuCount;
this.mRenderingState.consumingTime = this.mStartTimer.update(SystemClock.uptimeMillis());
return this.mRenderingState;
}
开发者ID:JackChan1999,项目名称:letv,代码行数:62,代码来源:DanmakuRenderer.java
示例19: draw
import master.flame.danmaku.danmaku.renderer.IRenderer.RenderingState; //导入依赖的package包/类
@Override
public synchronized RenderingState draw(AbsDisplayer displayer) {
return drawDanmakus(displayer,mTimer);
}
开发者ID:lisnstatic,项目名称:live_master,代码行数:5,代码来源:DrawTask.java
示例20: drawDanmakus
import master.flame.danmaku.danmaku.renderer.IRenderer.RenderingState; //导入依赖的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;
}
开发者ID:lisnstatic,项目名称:live_master,代码行数:51,代码来源:DrawTask.java
注:本文中的master.flame.danmaku.danmaku.renderer.IRenderer.RenderingState类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论