Loading core/java/android/view/GLRenderer.java +1 −23 Original line number Diff line number Diff line Loading @@ -1096,8 +1096,7 @@ public class GLRenderer extends HardwareRenderer { } if (checkRenderContext() != SURFACE_STATE_ERROR) { int status = mCanvas.invokeFunctors(mRedrawClip); handleFunctorStatus(attachInfo, status); mCanvas.invokeFunctors(mRedrawClip); } } } Loading Loading @@ -1301,7 +1300,6 @@ public class GLRenderer extends HardwareRenderer { mProfileData[mProfileCurrentFrame + 1] = total; } handleFunctorStatus(attachInfo, status); return status; } Loading Loading @@ -1337,26 +1335,6 @@ public class GLRenderer extends HardwareRenderer { } } private void handleFunctorStatus(View.AttachInfo attachInfo, int status) { // If the draw flag is set, functors will be invoked while executing // the tree of display lists if ((status & RenderNode.STATUS_DRAW) != 0) { if (mRedrawClip.isEmpty()) { attachInfo.mViewRootImpl.invalidate(); } else { attachInfo.mViewRootImpl.invalidateChildInParent(null, mRedrawClip); mRedrawClip.setEmpty(); } } if ((status & RenderNode.STATUS_INVOKE) != 0 || attachInfo.mHandler.hasCallbacks(mFunctorsRunnable)) { attachInfo.mHandler.removeCallbacks(mFunctorsRunnable); mFunctorsRunnable.attachInfo = attachInfo; attachInfo.mHandler.postDelayed(mFunctorsRunnable, FUNCTOR_PROCESS_DELAY); } } @Override void detachFunctor(long functor) { if (mCanvas != null) { Loading core/java/android/view/HardwareCanvas.java +12 −16 Original line number Diff line number Diff line Loading @@ -70,13 +70,11 @@ public abstract class HardwareCanvas extends Canvas { * Draws the specified display list onto this canvas. * * @param displayList The display list to replay. * @param dirty The dirty region to redraw in the next pass, matters only * if this method returns {@link RenderNode#STATUS_DRAW}, can be null. * @param dirty Ignored, can be null. * @param flags Optional flags about drawing, see {@link RenderNode} for * the possible flags. * * @return One of {@link RenderNode#STATUS_DONE}, {@link RenderNode#STATUS_DRAW}, or * {@link RenderNode#STATUS_INVOKE}, or'd with {@link RenderNode#STATUS_DREW} * @return One of {@link RenderNode#STATUS_DONE} or {@link RenderNode#STATUS_DREW} * if anything was drawn. * * @hide Loading @@ -102,8 +100,7 @@ public abstract class HardwareCanvas extends Canvas { * * @param drawGLFunction A native function pointer * * @return One of {@link RenderNode#STATUS_DONE}, {@link RenderNode#STATUS_DRAW} or * {@link RenderNode#STATUS_INVOKE} * @return {@link RenderNode#STATUS_DONE} * * @hide */ Loading @@ -115,10 +112,9 @@ public abstract class HardwareCanvas extends Canvas { /** * Invoke all the functors who requested to be invoked during the previous frame. * * @param dirty The region to redraw when the functors return {@link RenderNode#STATUS_DRAW} * @param dirty Ignored * * @return One of {@link RenderNode#STATUS_DONE}, {@link RenderNode#STATUS_DRAW} or * {@link RenderNode#STATUS_INVOKE} * @return Ignored * * @hide */ Loading include/private/hwui/DrawGlInfo.h +0 −8 Original line number Diff line number Diff line Loading @@ -65,14 +65,6 @@ struct DrawGlInfo { enum Status { // The functor is done kStatusDone = 0x0, // The functor is requesting a redraw (the clip rect // used by the redraw is specified by DrawGlInfo.) // The rest of the UI might redraw too. kStatusDraw = 0x1, // The functor needs to be invoked again but will // not redraw. Only the functor is invoked again // (unless another functor requests a redraw.) kStatusInvoke = 0x2, // DisplayList actually issued GL drawing commands. // This is used to signal the HardwareRenderer that the // buffers should be flipped - otherwise, there were no Loading libs/hwui/OpenGLRenderer.cpp +2 −20 Original line number Diff line number Diff line Loading @@ -409,15 +409,6 @@ status_t OpenGLRenderer::invokeFunctors(Rect& dirty) { for (size_t i = 0; i < count; i++) { Functor* f = functors.itemAt(i); result |= (*f)(DrawGlInfo::kModeProcess, &info); if (result & DrawGlInfo::kStatusDraw) { Rect localDirty(info.dirtyLeft, info.dirtyTop, info.dirtyRight, info.dirtyBottom); dirty.unionWith(localDirty); } if (result & DrawGlInfo::kStatusInvoke) { mFunctors.add(f); } } resume(); } Loading Loading @@ -461,19 +452,10 @@ status_t OpenGLRenderer::callDrawGLFunction(Functor* functor, Rect& dirty) { interrupt(); // call functor immediately after GL state setup status_t result = (*functor)(DrawGlInfo::kModeDraw, &info); if (result != DrawGlInfo::kStatusDone) { Rect localDirty(info.dirtyLeft, info.dirtyTop, info.dirtyRight, info.dirtyBottom); dirty.unionWith(localDirty); if (result & DrawGlInfo::kStatusInvoke) { mFunctors.add(functor); } } (*functor)(DrawGlInfo::kModeDraw, &info); resume(); return result | DrawGlInfo::kStatusDrew; return DrawGlInfo::kStatusDrew; } /////////////////////////////////////////////////////////////////////////////// Loading libs/hwui/renderthread/CanvasContext.cpp +1 −17 Original line number Diff line number Diff line Loading @@ -411,7 +411,6 @@ void CanvasContext::drawDisplayList(RenderNode* displayList, Rect* dirty) { Rect outBounds; status |= mCanvas->drawDisplayList(displayList, outBounds); handleFunctorStatus(status, outBounds); // TODO: Draw debug info // TODO: Performance tracking Loading Loading @@ -448,22 +447,7 @@ void CanvasContext::invokeFunctors() { makeCurrent(); Rect dirty; int status = mCanvas->invokeFunctors(dirty); handleFunctorStatus(status, dirty); } void CanvasContext::handleFunctorStatus(int status, const Rect& redrawClip) { if (status & DrawGlInfo::kStatusDraw) { // TODO: Invalidate the redrawClip // Do we need to post to ViewRootImpl like the current renderer? // Can we just enqueue ourselves to re-invoke the same display list? // Something else entirely? Does ChromiumView still want this in a // RenderThread world? } if (status & DrawGlInfo::kStatusInvoke) { queueFunctorsTask(); } mCanvas->invokeFunctors(dirty); } void CanvasContext::removeFunctorsTask() { Loading Loading
core/java/android/view/GLRenderer.java +1 −23 Original line number Diff line number Diff line Loading @@ -1096,8 +1096,7 @@ public class GLRenderer extends HardwareRenderer { } if (checkRenderContext() != SURFACE_STATE_ERROR) { int status = mCanvas.invokeFunctors(mRedrawClip); handleFunctorStatus(attachInfo, status); mCanvas.invokeFunctors(mRedrawClip); } } } Loading Loading @@ -1301,7 +1300,6 @@ public class GLRenderer extends HardwareRenderer { mProfileData[mProfileCurrentFrame + 1] = total; } handleFunctorStatus(attachInfo, status); return status; } Loading Loading @@ -1337,26 +1335,6 @@ public class GLRenderer extends HardwareRenderer { } } private void handleFunctorStatus(View.AttachInfo attachInfo, int status) { // If the draw flag is set, functors will be invoked while executing // the tree of display lists if ((status & RenderNode.STATUS_DRAW) != 0) { if (mRedrawClip.isEmpty()) { attachInfo.mViewRootImpl.invalidate(); } else { attachInfo.mViewRootImpl.invalidateChildInParent(null, mRedrawClip); mRedrawClip.setEmpty(); } } if ((status & RenderNode.STATUS_INVOKE) != 0 || attachInfo.mHandler.hasCallbacks(mFunctorsRunnable)) { attachInfo.mHandler.removeCallbacks(mFunctorsRunnable); mFunctorsRunnable.attachInfo = attachInfo; attachInfo.mHandler.postDelayed(mFunctorsRunnable, FUNCTOR_PROCESS_DELAY); } } @Override void detachFunctor(long functor) { if (mCanvas != null) { Loading
core/java/android/view/HardwareCanvas.java +12 −16 Original line number Diff line number Diff line Loading @@ -70,13 +70,11 @@ public abstract class HardwareCanvas extends Canvas { * Draws the specified display list onto this canvas. * * @param displayList The display list to replay. * @param dirty The dirty region to redraw in the next pass, matters only * if this method returns {@link RenderNode#STATUS_DRAW}, can be null. * @param dirty Ignored, can be null. * @param flags Optional flags about drawing, see {@link RenderNode} for * the possible flags. * * @return One of {@link RenderNode#STATUS_DONE}, {@link RenderNode#STATUS_DRAW}, or * {@link RenderNode#STATUS_INVOKE}, or'd with {@link RenderNode#STATUS_DREW} * @return One of {@link RenderNode#STATUS_DONE} or {@link RenderNode#STATUS_DREW} * if anything was drawn. * * @hide Loading @@ -102,8 +100,7 @@ public abstract class HardwareCanvas extends Canvas { * * @param drawGLFunction A native function pointer * * @return One of {@link RenderNode#STATUS_DONE}, {@link RenderNode#STATUS_DRAW} or * {@link RenderNode#STATUS_INVOKE} * @return {@link RenderNode#STATUS_DONE} * * @hide */ Loading @@ -115,10 +112,9 @@ public abstract class HardwareCanvas extends Canvas { /** * Invoke all the functors who requested to be invoked during the previous frame. * * @param dirty The region to redraw when the functors return {@link RenderNode#STATUS_DRAW} * @param dirty Ignored * * @return One of {@link RenderNode#STATUS_DONE}, {@link RenderNode#STATUS_DRAW} or * {@link RenderNode#STATUS_INVOKE} * @return Ignored * * @hide */ Loading
include/private/hwui/DrawGlInfo.h +0 −8 Original line number Diff line number Diff line Loading @@ -65,14 +65,6 @@ struct DrawGlInfo { enum Status { // The functor is done kStatusDone = 0x0, // The functor is requesting a redraw (the clip rect // used by the redraw is specified by DrawGlInfo.) // The rest of the UI might redraw too. kStatusDraw = 0x1, // The functor needs to be invoked again but will // not redraw. Only the functor is invoked again // (unless another functor requests a redraw.) kStatusInvoke = 0x2, // DisplayList actually issued GL drawing commands. // This is used to signal the HardwareRenderer that the // buffers should be flipped - otherwise, there were no Loading
libs/hwui/OpenGLRenderer.cpp +2 −20 Original line number Diff line number Diff line Loading @@ -409,15 +409,6 @@ status_t OpenGLRenderer::invokeFunctors(Rect& dirty) { for (size_t i = 0; i < count; i++) { Functor* f = functors.itemAt(i); result |= (*f)(DrawGlInfo::kModeProcess, &info); if (result & DrawGlInfo::kStatusDraw) { Rect localDirty(info.dirtyLeft, info.dirtyTop, info.dirtyRight, info.dirtyBottom); dirty.unionWith(localDirty); } if (result & DrawGlInfo::kStatusInvoke) { mFunctors.add(f); } } resume(); } Loading Loading @@ -461,19 +452,10 @@ status_t OpenGLRenderer::callDrawGLFunction(Functor* functor, Rect& dirty) { interrupt(); // call functor immediately after GL state setup status_t result = (*functor)(DrawGlInfo::kModeDraw, &info); if (result != DrawGlInfo::kStatusDone) { Rect localDirty(info.dirtyLeft, info.dirtyTop, info.dirtyRight, info.dirtyBottom); dirty.unionWith(localDirty); if (result & DrawGlInfo::kStatusInvoke) { mFunctors.add(functor); } } (*functor)(DrawGlInfo::kModeDraw, &info); resume(); return result | DrawGlInfo::kStatusDrew; return DrawGlInfo::kStatusDrew; } /////////////////////////////////////////////////////////////////////////////// Loading
libs/hwui/renderthread/CanvasContext.cpp +1 −17 Original line number Diff line number Diff line Loading @@ -411,7 +411,6 @@ void CanvasContext::drawDisplayList(RenderNode* displayList, Rect* dirty) { Rect outBounds; status |= mCanvas->drawDisplayList(displayList, outBounds); handleFunctorStatus(status, outBounds); // TODO: Draw debug info // TODO: Performance tracking Loading Loading @@ -448,22 +447,7 @@ void CanvasContext::invokeFunctors() { makeCurrent(); Rect dirty; int status = mCanvas->invokeFunctors(dirty); handleFunctorStatus(status, dirty); } void CanvasContext::handleFunctorStatus(int status, const Rect& redrawClip) { if (status & DrawGlInfo::kStatusDraw) { // TODO: Invalidate the redrawClip // Do we need to post to ViewRootImpl like the current renderer? // Can we just enqueue ourselves to re-invoke the same display list? // Something else entirely? Does ChromiumView still want this in a // RenderThread world? } if (status & DrawGlInfo::kStatusInvoke) { queueFunctorsTask(); } mCanvas->invokeFunctors(dirty); } void CanvasContext::removeFunctorsTask() { Loading