diff options
author | Romain Guy <romainguy@google.com> | 2011-01-13 12:13:20 -0800 |
---|---|---|
committer | Romain Guy <romainguy@google.com> | 2011-01-13 12:13:20 -0800 |
commit | ada830f639591b99c3e40de22b07296c7932a33f (patch) | |
tree | 308f469469e96ce7f99d2ec5135e7d44eb858a35 /libs/hwui/LayerRenderer.h | |
parent | 4f6aff386045000c2c03b903c7109cb42092b7ea (diff) | |
download | frameworks_base-ada830f639591b99c3e40de22b07296c7932a33f.zip frameworks_base-ada830f639591b99c3e40de22b07296c7932a33f.tar.gz frameworks_base-ada830f639591b99c3e40de22b07296c7932a33f.tar.bz2 |
Cleanup implementation of hardware layers.
The new implementation relies on OpenGLRenderer's existing layer
code instead of duplicating it. The new code is much cleaner, with
simpler and better APIs and allows tracking of drawn regions inside
layers. Region tracking is not yet enabled but this will be done
in a future CL.
Change-Id: Ie826121a2227de8252c77b992a61218defea5143
Diffstat (limited to 'libs/hwui/LayerRenderer.h')
-rw-r--r-- | libs/hwui/LayerRenderer.h | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/libs/hwui/LayerRenderer.h b/libs/hwui/LayerRenderer.h index be68412..ed5d960 100644 --- a/libs/hwui/LayerRenderer.h +++ b/libs/hwui/LayerRenderer.h @@ -18,6 +18,7 @@ #define ANDROID_HWUI_LAYER_RENDERER_H #include "OpenGLRenderer.h" +#include "Layer.h" namespace android { namespace uirenderer { @@ -39,7 +40,7 @@ namespace uirenderer { class LayerRenderer: public OpenGLRenderer { public: - LayerRenderer(GLuint fbo): mFbo(fbo) { + LayerRenderer(Layer* layer): mLayer(layer) { } ~LayerRenderer() { @@ -48,15 +49,13 @@ public: void prepare(bool opaque); void finish(); - static GLuint createLayer(uint32_t width, uint32_t height, - uint32_t* layerWidth, uint32_t* layerHeight, GLuint* texture); - static void resizeLayer(GLuint fbo, GLuint texture, uint32_t width, uint32_t height, - uint32_t* layerWidth, uint32_t* layerHeight); - static void destroyLayer(GLuint fbo, GLuint texture); - static void destroyLayerDeferred(GLuint fbo, GLuint texture); + static Layer* createLayer(uint32_t width, uint32_t height, bool isOpaque = false); + static bool resizeLayer(Layer* layer, uint32_t width, uint32_t height); + static void destroyLayer(Layer* layer); + static void destroyLayerDeferred(Layer* layer); private: - GLuint mFbo; + Layer* mLayer; GLuint mPreviousFbo; }; // class LayerRenderer |