diff --git a/libs/hwui/DeferredDisplayList.h b/libs/hwui/DeferredDisplayList.h index 3e450daf888ac..653f315c69fb5 100644 --- a/libs/hwui/DeferredDisplayList.h +++ b/libs/hwui/DeferredDisplayList.h @@ -52,8 +52,6 @@ public: kOpBatch_Count, // Add other batch ids before this }; - void clear(); - bool isEmpty() { return mBatches.isEmpty(); } /** @@ -80,6 +78,8 @@ private: */ void resetBatchingState(); + void clear(); + void storeStateOpBarrier(OpenGLRenderer& renderer, StateOp* op); void storeRestoreToCountBarrier(OpenGLRenderer& renderer, StateOp* op, int newSaveCount); diff --git a/libs/hwui/Layer.cpp b/libs/hwui/Layer.cpp index 63bb73f12775b..d257110c5088d 100644 --- a/libs/hwui/Layer.cpp +++ b/libs/hwui/Layer.cpp @@ -167,7 +167,6 @@ void Layer::defer() { displayList->defer(deferredState, 0); deferredUpdateScheduled = false; - displayList = NULL; } void Layer::flush() { @@ -182,7 +181,7 @@ void Layer::flush() { renderer = NULL; dirtyRect.setEmpty(); - deferredList->clear(); + displayList = NULL; } } diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp index 1138998432a6e..d34246d815335 100644 --- a/libs/hwui/OpenGLRenderer.cpp +++ b/libs/hwui/OpenGLRenderer.cpp @@ -571,8 +571,8 @@ void OpenGLRenderer::updateLayers() { startMark("Defer Layer Updates"); } - // Note: it is very important to update the layers in reverse order - for (int i = count - 1; i >= 0; i--) { + // Note: it is very important to update the layers in order + for (int i = 0; i < count; i++) { Layer* layer = mLayerUpdates.itemAt(i); updateLayer(layer, false); if (CC_UNLIKELY(mCaches.drawDeferDisabled)) { @@ -594,8 +594,8 @@ void OpenGLRenderer::flushLayers() { startMark("Apply Layer Updates"); char layerName[12]; - // Note: it is very important to update the layers in reverse order - for (int i = count - 1; i >= 0; i--) { + // Note: it is very important to update the layers in order + for (int i = 0; i < count; i++) { sprintf(layerName, "Layer #%d", i); startMark(layerName);