Remove kStatusInvoke & kStatusDraw

They are unused

Change-Id: I44ecf1164dc6bc1b09438e733976d5a97a25f00e
This commit is contained in:
John Reck
2014-03-28 16:33:18 -07:00
parent 0e14f2d455
commit 750ca6dbdb
6 changed files with 16 additions and 85 deletions

View File

@@ -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) {

View File

@@ -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

View File

@@ -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

View File

@@ -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;
}
///////////////////////////////////////////////////////////////////////////////

View File

@@ -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() {

View File

@@ -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);