summaryrefslogtreecommitdiffstats
path: root/libs/hwui/Snapshot.h
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2010-10-27 18:57:51 -0700
committerRomain Guy <romainguy@google.com>2010-11-02 16:17:23 -0700
commit5b3b35296e8b2c8d3f07d32bb645d5414db41a1d (patch)
treebad2ebdbfeb8a3a0be1591d5a357a8280df7d1d2 /libs/hwui/Snapshot.h
parent2444ddb3d9b59ec45ba50858fcbff639e59b93b1 (diff)
downloadframeworks_base-5b3b35296e8b2c8d3f07d32bb645d5414db41a1d.zip
frameworks_base-5b3b35296e8b2c8d3f07d32bb645d5414db41a1d.tar.gz
frameworks_base-5b3b35296e8b2c8d3f07d32bb645d5414db41a1d.tar.bz2
Optimize FBO drawing with regions.
This optimization is currently disabled until Launcher is modified to take advantage of it. The optimization can be enabled by turning on RENDER_LAYERS_AS_REGIONS in the OpenGLRenderer.h file. Change-Id: I2fdf59d0f4dc690a3d7f712173ab8db3848b27b1
Diffstat (limited to 'libs/hwui/Snapshot.h')
-rw-r--r--libs/hwui/Snapshot.h26
1 files changed, 22 insertions, 4 deletions
diff --git a/libs/hwui/Snapshot.h b/libs/hwui/Snapshot.h
index 2da1950..9f78063 100644
--- a/libs/hwui/Snapshot.h
+++ b/libs/hwui/Snapshot.h
@@ -14,16 +14,16 @@
* limitations under the License.
*/
-#ifndef ANDROID_UI_SNAPSHOT_H
-#define ANDROID_UI_SNAPSHOT_H
+#ifndef ANDROID_HWUI_SNAPSHOT_H
+#define ANDROID_HWUI_SNAPSHOT_H
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
#include <utils/RefBase.h>
+#include <ui/Region.h>
#include <SkCanvas.h>
-#include <SkRegion.h>
#include "Layer.h"
#include "Matrix.h"
@@ -46,6 +46,7 @@ public:
Snapshot(): flags(0), previous(NULL), layer(NULL), fbo(0), invisible(false) {
transform = &mTransformRoot;
clipRect = &mClipRectRoot;
+ region = NULL;
}
/**
@@ -75,6 +76,13 @@ public:
} else {
flags |= Snapshot::kFlagDirtyLocalClip;
}
+
+ if (s->flags & Snapshot::kFlagFboTarget) {
+ flags |= Snapshot::kFlagFboTarget;
+ region = s->region;
+ } else {
+ region = NULL;
+ }
}
/**
@@ -105,6 +113,11 @@ public:
* Indicates that this snapshot has changed the ortho matrix.
*/
kFlagDirtyOrtho = 0x10,
+ /**
+ * Indicates that this snapshot or an ancestor snapshot is
+ * an FBO layer.
+ */
+ kFlagFboTarget = 0x20
};
/**
@@ -243,6 +256,11 @@ public:
*/
Rect* clipRect;
+ /**
+ * The ancestor layer's dirty region..
+ */
+ Region* region;
+
private:
mat4 mTransformRoot;
Rect mClipRectRoot;
@@ -253,4 +271,4 @@ private:
}; // namespace uirenderer
}; // namespace android
-#endif // ANDROID_UI_SNAPSHOT_H
+#endif // ANDROID_HWUI_SNAPSHOT_H