summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libs/hwui/DisplayListRenderer.cpp3
-rwxr-xr-xlibs/hwui/OpenGLRenderer.cpp11
-rw-r--r--libs/hwui/Snapshot.cpp13
-rw-r--r--libs/hwui/Snapshot.h15
4 files changed, 41 insertions, 1 deletions
diff --git a/libs/hwui/DisplayListRenderer.cpp b/libs/hwui/DisplayListRenderer.cpp
index 7a38b40..8d2a84e 100644
--- a/libs/hwui/DisplayListRenderer.cpp
+++ b/libs/hwui/DisplayListRenderer.cpp
@@ -1442,6 +1442,9 @@ status_t DisplayListRenderer::prepareDirty(float left, float top,
mSaveCount = 1;
mSnapshot->setClip(0.0f, 0.0f, mWidth, mHeight);
+#ifdef QCOM_HARDWARE
+ mSnapshot->setTileClip(0.0f, 0.0f, mWidth, mHeight);
+#endif
mDirtyClip = opaque;
mRestoreSaveCount = -1;
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index 7309e46..efae551 100755
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -179,6 +179,9 @@ status_t OpenGLRenderer::prepareDirty(float left, float top, float right, float
mSaveCount = 1;
mSnapshot->setClip(left, top, right, bottom);
+#ifdef QCOM_HARDWARE
+ mSnapshot->setTileClip(left, top, right, bottom);
+#endif
mDirtyClip = true;
updateLayers();
@@ -246,11 +249,14 @@ void OpenGLRenderer::syncState() {
void OpenGLRenderer::startTiling(const sp<Snapshot>& s, bool opaque) {
if (!mSuppressTiling) {
+#ifdef QCOM_HARDWARE
+ const Rect* clip = &mSnapshot->getTileClip();
+#else
Rect* clip = mTilingSnapshot->clipRect;
if (s->flags & Snapshot::kFlagIsFboLayer) {
clip = s->clipRect;
}
-
+#endif
mCaches.startTiling(clip->left, s->height - clip->bottom,
clip->right - clip->left, clip->bottom - clip->top, opaque);
}
@@ -800,6 +806,9 @@ bool OpenGLRenderer::createFboLayer(Layer* layer, Rect& bounds, Rect& clip, GLui
mSnapshot->fbo = layer->getFbo();
mSnapshot->resetTransform(-bounds.left, -bounds.top, 0.0f);
mSnapshot->resetClip(clip.left, clip.top, clip.right, clip.bottom);
+#ifdef QCOM_HARDWARE
+ mSnapshot->setTileClip(clip.left, clip.top, clip.right, clip.bottom);
+#endif
mSnapshot->viewport.set(0.0f, 0.0f, bounds.getWidth(), bounds.getHeight());
mSnapshot->height = bounds.getHeight();
mSnapshot->flags |= Snapshot::kFlagDirtyOrtho;
diff --git a/libs/hwui/Snapshot.cpp b/libs/hwui/Snapshot.cpp
index fbc8455..e2675a8 100644
--- a/libs/hwui/Snapshot.cpp
+++ b/libs/hwui/Snapshot.cpp
@@ -74,6 +74,9 @@ Snapshot::Snapshot(const sp<Snapshot>& s, int saveFlags):
} else {
region = NULL;
}
+#ifdef QCOM_HARDWARE
+ mTileClip.set(s->getTileClip());
+#endif
}
///////////////////////////////////////////////////////////////////////////////
@@ -192,6 +195,16 @@ const Rect& Snapshot::getLocalClip() {
return mLocalClip;
}
+#ifdef QCOM_HARDWARE
+void Snapshot::setTileClip(float left, float top, float right, float bottom) {
+ mTileClip.set(left, top, right, bottom);
+}
+
+const Rect& Snapshot::getTileClip() {
+ return mTileClip;
+}
+#endif
+
void Snapshot::resetClip(float left, float top, float right, float bottom) {
clipRect = &mClipRectRoot;
setClip(left, top, right, bottom);
diff --git a/libs/hwui/Snapshot.h b/libs/hwui/Snapshot.h
index 9c612ff..18d405b 100644
--- a/libs/hwui/Snapshot.h
+++ b/libs/hwui/Snapshot.h
@@ -104,6 +104,18 @@ public:
*/
const Rect& getLocalClip();
+#ifdef QCOM_HARDWARE
+ /**
+ * Sets the current tile clip.
+ */
+ void setTileClip(float left, float top, float right, float bottom);
+
+ /**
+ * Returns the current tile clip in local coordinates.
+ */
+ const Rect& getTileClip();
+#endif
+
/**
* Resets the clip to the specified rect.
*/
@@ -233,6 +245,9 @@ private:
mat4 mTransformRoot;
Rect mClipRectRoot;
Rect mLocalClip;
+#ifdef QCOM_HARDWARE
+ Rect mTileClip;
+#endif
#if STENCIL_BUFFER_SIZE
SkRegion mClipRegionRoot;