From 11cb642756093a4af901b1525375b1eb2b5c3e2b Mon Sep 17 00:00:00 2001 From: Romain Guy Date: Fri, 21 Sep 2012 00:39:43 -0700 Subject: Update layers in a single batch at the beginning of a frame Bug #7186819 Change-Id: Ice5926dfedfb3be3a3064e65008dafa2852407da --- libs/hwui/OpenGLRenderer.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'libs/hwui/OpenGLRenderer.h') diff --git a/libs/hwui/OpenGLRenderer.h b/libs/hwui/OpenGLRenderer.h index 4bbdde18a83d..3e343361eede 100644 --- a/libs/hwui/OpenGLRenderer.h +++ b/libs/hwui/OpenGLRenderer.h @@ -132,6 +132,9 @@ public: ANDROID_API void attachFunctor(Functor* functor); virtual status_t callDrawGLFunction(Functor* functor, Rect& dirty); + ANDROID_API void pushLayerUpdate(Layer* layer); + ANDROID_API void clearLayerUpdates(); + ANDROID_API int getSaveCount() const; virtual int save(int flags); virtual void restore(); @@ -339,6 +342,13 @@ protected: return resultMode; } + /** + * Set to true to suppress error checks at the end of a frame. + */ + virtual bool suppressErrorChecks() { + return false; + } + private: /** * Ensures the state of the renderer is the same as the state of @@ -720,6 +730,9 @@ private: void finishDrawTexture(); void accountForClear(SkXfermode::Mode mode); + bool updateLayer(Layer* layer, bool inFrame); + void updateLayers(); + /** * Renders the specified region as a series of rectangles. This method * is used for debugging only. @@ -780,6 +793,8 @@ private: Vector mLayers; // List of functors to invoke after a frame is drawn SortedVector mFunctors; + // List of layers to update at the beginning of a frame + Vector mLayerUpdates; // Indentity matrix const mat4 mIdentity; -- cgit v1.2.3-59-g8ed1b