diff options
-rw-r--r-- | core/java/android/view/GLRenderer.java | 24 | ||||
-rw-r--r-- | core/java/android/view/HardwareCanvas.java | 28 | ||||
-rw-r--r-- | include/private/hwui/DrawGlInfo.h | 8 | ||||
-rw-r--r-- | libs/hwui/OpenGLRenderer.cpp | 22 | ||||
-rw-r--r-- | libs/hwui/renderthread/CanvasContext.cpp | 18 | ||||
-rw-r--r-- | libs/hwui/renderthread/CanvasContext.h | 1 |
6 files changed, 16 insertions, 85 deletions
diff --git a/core/java/android/view/GLRenderer.java b/core/java/android/view/GLRenderer.java index 90824ab..f083148 100644 --- a/core/java/android/view/GLRenderer.java +++ b/core/java/android/view/GLRenderer.java @@ -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); } } } @@ -1301,7 +1300,6 @@ public class GLRenderer extends HardwareRenderer { mProfileData[mProfileCurrentFrame + 1] = total; } - handleFunctorStatus(attachInfo, status); return status; } @@ -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) { diff --git a/core/java/android/view/HardwareCanvas.java b/core/java/android/view/HardwareCanvas.java index f695b20..233f846 100644 --- a/core/java/android/view/HardwareCanvas.java +++ b/core/java/android/view/HardwareCanvas.java @@ -23,7 +23,7 @@ import android.graphics.Rect; /** * Hardware accelerated canvas. - * + * * @hide */ public abstract class HardwareCanvas extends Canvas { @@ -40,7 +40,7 @@ public abstract class HardwareCanvas extends Canvas { /** * Invoked before any drawing operation is performed in this canvas. - * + * * @param dirty The dirty rectangle to update, can be null. * @return {@link RenderNode#STATUS_DREW} if anything was drawn (such as a call to clear * the canvas). @@ -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 @@ -101,9 +99,8 @@ public abstract class HardwareCanvas extends Canvas { * This function may return true if an invalidation is needed after the call. * * @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 */ @@ -114,11 +111,10 @@ 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} - * - * @return One of {@link RenderNode#STATUS_DONE}, {@link RenderNode#STATUS_DRAW} or - * {@link RenderNode#STATUS_INVOKE} + * + * @param dirty Ignored + * + * @return Ignored * * @hide */ @@ -154,7 +150,7 @@ public abstract class HardwareCanvas extends Canvas { /** * Indicates that the specified layer must be updated as soon as possible. - * + * * @param layer The layer to update * * @see #clearLayerUpdates() @@ -187,7 +183,7 @@ public abstract class HardwareCanvas extends Canvas { /** * Removes all enqueued layer updates. - * + * * @see #pushLayerUpdate(HardwareLayer) * * @hide diff --git a/include/private/hwui/DrawGlInfo.h b/include/private/hwui/DrawGlInfo.h index fc810be..3b7ba8b 100644 --- a/include/private/hwui/DrawGlInfo.h +++ b/include/private/hwui/DrawGlInfo.h @@ -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 diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp index d808735..b730d30 100644 --- a/libs/hwui/OpenGLRenderer.cpp +++ b/libs/hwui/OpenGLRenderer.cpp @@ -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(); } @@ -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; } /////////////////////////////////////////////////////////////////////////////// diff --git a/libs/hwui/renderthread/CanvasContext.cpp b/libs/hwui/renderthread/CanvasContext.cpp index 8ebffc2..017fb56 100644 --- a/libs/hwui/renderthread/CanvasContext.cpp +++ b/libs/hwui/renderthread/CanvasContext.cpp @@ -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 @@ -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() { diff --git a/libs/hwui/renderthread/CanvasContext.h b/libs/hwui/renderthread/CanvasContext.h index e3fdf97..746c1bf 100644 --- a/libs/hwui/renderthread/CanvasContext.h +++ b/libs/hwui/renderthread/CanvasContext.h @@ -82,7 +82,6 @@ private: friend class InvokeFunctorsTask; void invokeFunctors(); - void handleFunctorStatus(int status, const Rect& redrawClip); void removeFunctorsTask(); void queueFunctorsTask(int delayMs = FUNCTOR_PROCESS_DELAY); |