Deferred layer updates
Change-Id: I83d9e564fe274db658dcee9e0cc5bbf9223ebb49
diff --git a/libs/hwui/Layer.h b/libs/hwui/Layer.h
index ee6ef1a..f243177 100644
--- a/libs/hwui/Layer.h
+++ b/libs/hwui/Layer.h
@@ -37,6 +37,10 @@
// Layers
///////////////////////////////////////////////////////////////////////////////
+// Forward declarations
+class OpenGLRenderer;
+class DisplayList;
+
/**
* A layer has dimensions and is backed by an OpenGL texture or FBO.
*/
@@ -51,6 +55,9 @@
texture.width = layerWidth;
texture.height = layerHeight;
colorFilter = NULL;
+ deferredUpdateScheduled = false;
+ renderer = NULL;
+ displayList = NULL;
}
~Layer() {
@@ -77,6 +84,15 @@
regionRect.translate(layer.left, layer.top);
}
+ void updateDeferred(OpenGLRenderer* renderer, DisplayList* displayList,
+ int left, int top, int right, int bottom) {
+ this->renderer = renderer;
+ this->displayList = displayList;
+ const Rect r(left, top, right, bottom);
+ dirtyRect.unionWith(r);
+ deferredUpdateScheduled = true;
+ }
+
inline uint32_t getWidth() {
return texture.width;
}
@@ -234,6 +250,14 @@
uint16_t* meshIndices;
GLsizei meshElementCount;
+ /**
+ * Used for deferred updates.
+ */
+ bool deferredUpdateScheduled;
+ OpenGLRenderer* renderer;
+ DisplayList* displayList;
+ Rect dirtyRect;
+
private:
/**
* Name of the FBO used to render the layer. If the name is 0