summaryrefslogtreecommitdiffstats
path: root/libs/hwui/DeferredDisplayList.cpp
diff options
context:
space:
mode:
authorTom Hudson <tomhudson@google.com>2014-09-08 11:26:26 -0400
committerTom Hudson <tomhudson@google.com>2014-11-04 15:49:44 -0500
commit107843de4507b3511006cb9c77b8d0364374385a (patch)
tree02b2f6181dbd8665638b174c2819f289a40551fd /libs/hwui/DeferredDisplayList.cpp
parentdaccecb263cad36b55dd84e25709d543ee887202 (diff)
downloadframeworks_base-107843de4507b3511006cb9c77b8d0364374385a.zip
frameworks_base-107843de4507b3511006cb9c77b8d0364374385a.tar.gz
frameworks_base-107843de4507b3511006cb9c77b8d0364374385a.tar.bz2
Remove status return from all uirenderer::Renderer functions
This moves the interface closer to android::Canvas. The only use of return values was in the OpenGLRenderer subclass; that is replaced with an internal dirty flag: returned from finish(), checked by CanvasContext. This is part of a series of CLs to refactor the Graphics JNI bindings. BUG:15672762 R=djsollen@google.com,ccraik@google.com Change-Id: Ifd533eb8839a254b0d3a5d04fc5a2905afdfc89e
Diffstat (limited to 'libs/hwui/DeferredDisplayList.cpp')
-rw-r--r--libs/hwui/DeferredDisplayList.cpp40
1 files changed, 15 insertions, 25 deletions
diff --git a/libs/hwui/DeferredDisplayList.cpp b/libs/hwui/DeferredDisplayList.cpp
index 7b279cb..a5e48e9 100644
--- a/libs/hwui/DeferredDisplayList.cpp
+++ b/libs/hwui/DeferredDisplayList.cpp
@@ -52,7 +52,7 @@ namespace uirenderer {
class Batch {
public:
- virtual status_t replay(OpenGLRenderer& renderer, Rect& dirty, int index) = 0;
+ virtual void replay(OpenGLRenderer& renderer, Rect& dirty, int index) = 0;
virtual ~Batch() {}
virtual bool purelyDrawBatch() { return false; }
virtual bool coversBounds(const Rect& bounds) { return false; }
@@ -91,11 +91,10 @@ public:
return false;
}
- virtual status_t replay(OpenGLRenderer& renderer, Rect& dirty, int index) {
+ virtual void replay(OpenGLRenderer& renderer, Rect& dirty, int index) {
DEFER_LOGD("%d replaying DrawBatch %p, with %d ops (batch id %x, merge id %p)",
index, this, mOps.size(), getBatchId(), getMergeId());
- status_t status = DrawGlInfo::kStatusDone;
DisplayListLogBuffer& logBuffer = DisplayListLogBuffer::getInstance();
for (unsigned int i = 0; i < mOps.size(); i++) {
DrawOp* op = mOps[i].op;
@@ -106,7 +105,7 @@ public:
renderer.eventMark(op->name());
#endif
logBuffer.writeCommand(0, op->name());
- status |= op->applyDraw(renderer, dirty);
+ op->applyDraw(renderer, dirty);
#if DEBUG_MERGE_BEHAVIOR
const Rect& bounds = state->mBounds;
@@ -118,7 +117,6 @@ public:
batchColor);
#endif
}
- return status;
}
virtual bool purelyDrawBatch() { return true; }
@@ -249,12 +247,13 @@ public:
if (newClipSideFlags & kClipSide_Bottom) mClipRect.bottom = state->mClip.bottom;
}
- virtual status_t replay(OpenGLRenderer& renderer, Rect& dirty, int index) {
+ virtual void replay(OpenGLRenderer& renderer, Rect& dirty, int index) {
DEFER_LOGD("%d replaying MergingDrawBatch %p, with %d ops,"
" clip flags %x (batch id %x, merge id %p)",
index, this, mOps.size(), mClipSideFlags, getBatchId(), getMergeId());
if (mOps.size() == 1) {
- return DrawBatch::replay(renderer, dirty, -1);
+ DrawBatch::replay(renderer, dirty, -1);
+ return;
}
// clipping in the merged case is done ahead of time since all ops share the clip (if any)
@@ -269,13 +268,12 @@ public:
renderer.eventMark("multiDraw");
renderer.eventMark(op->name());
#endif
- status_t status = op->multiDraw(renderer, dirty, mOps, mBounds);
+ op->multiDraw(renderer, dirty, mOps, mBounds);
#if DEBUG_MERGE_BEHAVIOR
renderer.drawScreenSpaceColorRect(mBounds.left, mBounds.top, mBounds.right, mBounds.bottom,
DEBUG_COLOR_MERGEDBATCH);
#endif
- return status;
}
private:
@@ -293,7 +291,7 @@ public:
// creates a single operation batch
StateOpBatch(const StateOp* op, const DeferredDisplayState* state) : mOp(op), mState(state) {}
- virtual status_t replay(OpenGLRenderer& renderer, Rect& dirty, int index) {
+ virtual void replay(OpenGLRenderer& renderer, Rect& dirty, int index) {
DEFER_LOGD("replaying state op batch %p", this);
renderer.restoreDisplayState(*mState);
@@ -302,7 +300,6 @@ public:
// renderer.restoreToCount directly
int saveCount = -1;
mOp->applyState(renderer, saveCount);
- return DrawGlInfo::kStatusDone;
}
private:
@@ -315,12 +312,11 @@ public:
RestoreToCountBatch(const StateOp* op, const DeferredDisplayState* state, int restoreCount) :
mOp(op), mState(state), mRestoreCount(restoreCount) {}
- virtual status_t replay(OpenGLRenderer& renderer, Rect& dirty, int index) {
+ virtual void replay(OpenGLRenderer& renderer, Rect& dirty, int index) {
DEFER_LOGD("batch %p restoring to count %d", this, mRestoreCount);
renderer.restoreDisplayState(*mState);
renderer.restoreToCount(mRestoreCount);
- return DrawGlInfo::kStatusDone;
}
private:
@@ -339,9 +335,8 @@ private:
#if DEBUG_MERGE_BEHAVIOR
class BarrierDebugBatch : public Batch {
- virtual status_t replay(OpenGLRenderer& renderer, Rect& dirty, int index) {
+ virtual void replay(OpenGLRenderer& renderer, Rect& dirty, int index) {
renderer.drawScreenSpaceColorRect(0, 0, 10000, 10000, DEBUG_COLOR_BARRIER);
- return DrawGlInfo::kStatusDrew;
}
};
#endif
@@ -628,26 +623,22 @@ void DeferredDisplayList::storeRestoreToCountBarrier(OpenGLRenderer& renderer, S
// Replay / flush
/////////////////////////////////////////////////////////////////////////////////
-static status_t replayBatchList(const Vector<Batch*>& batchList,
+static void replayBatchList(const Vector<Batch*>& batchList,
OpenGLRenderer& renderer, Rect& dirty) {
- status_t status = DrawGlInfo::kStatusDone;
for (unsigned int i = 0; i < batchList.size(); i++) {
if (batchList[i]) {
- status |= batchList[i]->replay(renderer, dirty, i);
+ batchList[i]->replay(renderer, dirty, i);
}
}
DEFER_LOGD("--flushed, drew %d batches", batchList.size());
- return status;
}
-status_t DeferredDisplayList::flush(OpenGLRenderer& renderer, Rect& dirty) {
+void DeferredDisplayList::flush(OpenGLRenderer& renderer, Rect& dirty) {
ATRACE_NAME("flush drawing commands");
Caches::getInstance().fontRenderer->endPrecaching();
- status_t status = DrawGlInfo::kStatusDone;
-
- if (isEmpty()) return status; // nothing to flush
+ if (isEmpty()) return; // nothing to flush
renderer.restoreToCount(1);
DEFER_LOGD("--flushing");
@@ -665,14 +656,13 @@ status_t DeferredDisplayList::flush(OpenGLRenderer& renderer, Rect& dirty) {
// NOTE: depth of the save stack at this point, before playback, should be reflected in
// FLUSH_SAVE_STACK_DEPTH, so that save/restores match up correctly
- status |= replayBatchList(mBatches, renderer, dirty);
+ replayBatchList(mBatches, renderer, dirty);
renderer.restoreToCount(1);
renderer.setDrawModifiers(restoreDrawModifiers);
DEFER_LOGD("--flush complete, returning %x", status);
clear();
- return status;
}
void DeferredDisplayList::discardDrawingBatches(const unsigned int maxIndex) {