summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2012-09-20 17:38:46 -0700
committerRomain Guy <romainguy@google.com>2012-09-20 17:38:46 -0700
commit57b5268708c3b974296c7d4e58a02a957979224a (patch)
treebb3a36e20b66edcbd7539aefd947c5b57d2897b3 /libs
parent314488b791d36756504ee593f818f04b4cd24893 (diff)
downloadframeworks_base-57b5268708c3b974296c7d4e58a02a957979224a.zip
frameworks_base-57b5268708c3b974296c7d4e58a02a957979224a.tar.gz
frameworks_base-57b5268708c3b974296c7d4e58a02a957979224a.tar.bz2
Optimize tiling management
Bug #7186819 Change-Id: Iebc42a6e9c96ad5605fbbe1539aa887695d2e829
Diffstat (limited to 'libs')
-rw-r--r--libs/hwui/Caches.cpp2
-rw-r--r--libs/hwui/OpenGLRenderer.cpp13
-rw-r--r--libs/hwui/OpenGLRenderer.h3
3 files changed, 5 insertions, 13 deletions
diff --git a/libs/hwui/Caches.cpp b/libs/hwui/Caches.cpp
index b149bb9..068eb9e 100644
--- a/libs/hwui/Caches.cpp
+++ b/libs/hwui/Caches.cpp
@@ -429,7 +429,7 @@ void Caches::resetScissor() {
void Caches::startTiling(GLuint x, GLuint y, GLuint width, GLuint height, bool opaque) {
if (extensions.hasTiledRendering()) {
- glStartTilingQCOM(x, y, width, height, GL_COLOR_BUFFER_BIT0_QCOM);
+ glStartTilingQCOM(x, y, width, height, opaque ? GL_NONE : GL_COLOR_BUFFER_BIT0_QCOM);
}
}
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index 9b9ca12..da0900a 100644
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -175,7 +175,7 @@ int OpenGLRenderer::prepareDirty(float left, float top, float right, float botto
mSaveCount = 1;
mSnapshot->setClip(left, top, right, bottom);
- mDirtyClip = mOpaqueFrame = opaque;
+ mDirtyClip = opaque;
// If we know that we are going to redraw the entire framebuffer,
// perform a discard to let the driver know we don't need to preserve
@@ -189,7 +189,7 @@ int OpenGLRenderer::prepareDirty(float left, float top, float right, float botto
syncState();
mTilingSnapshot = mSnapshot;
- startTiling();
+ startTiling(mTilingSnapshot, true);
if (!opaque) {
mCaches.enableScissor();
@@ -213,16 +213,9 @@ void OpenGLRenderer::syncState() {
}
}
-void OpenGLRenderer::startTiling() {
- startTiling(mTilingSnapshot);
-}
-
-void OpenGLRenderer::startTiling(const sp<Snapshot>& s) {
- bool opaque = mOpaqueFrame;
+void OpenGLRenderer::startTiling(const sp<Snapshot>& s, bool opaque) {
Rect* clip = mTilingSnapshot->clipRect;
-
if (s->flags & Snapshot::kFlagIsFboLayer) {
- opaque = !s->layer->isBlend();
clip = s->clipRect;
}
diff --git a/libs/hwui/OpenGLRenderer.h b/libs/hwui/OpenGLRenderer.h
index 10ba86e..4bbdde1 100644
--- a/libs/hwui/OpenGLRenderer.h
+++ b/libs/hwui/OpenGLRenderer.h
@@ -351,8 +351,7 @@ private:
* This method needs to be invoked every time getTargetFbo() is
* bound again.
*/
- void startTiling();
- void startTiling(const sp<Snapshot>& snapshot);
+ void startTiling(const sp<Snapshot>& snapshot, bool opaque = false);
/**
* Tells the GPU that we are done drawing the frame or that we