summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorMike Cleron <mcleron@google.com>2011-02-04 15:29:42 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-02-04 15:29:42 -0800
commit851beae717dc8e9b66c214d9d6aab2e76d52b086 (patch)
tree4cba7685b943695f29e6ecfc1c5e66f91b41d256 /libs
parent2d47fd3c3566e5fbe16bcee2ec4be87c6cdc2440 (diff)
parentc78b5d50f961ac8f696f8282979ae283cacd3574 (diff)
downloadframeworks_base-851beae717dc8e9b66c214d9d6aab2e76d52b086.zip
frameworks_base-851beae717dc8e9b66c214d9d6aab2e76d52b086.tar.gz
frameworks_base-851beae717dc8e9b66c214d9d6aab2e76d52b086.tar.bz2
Merge "Properly handle dirty rectangles generated from 9-patches Bug #3409580" into honeycomb
Diffstat (limited to 'libs')
-rw-r--r--libs/hwui/OpenGLRenderer.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp
index 90d6ea1..8ee7ec3 100644
--- a/libs/hwui/OpenGLRenderer.cpp
+++ b/libs/hwui/OpenGLRenderer.cpp
@@ -1217,17 +1217,18 @@ void OpenGLRenderer::drawPatch(SkBitmap* bitmap, const int32_t* xDivs, const int
#if RENDER_LAYERS_AS_REGIONS
// Mark the current layer dirty where we are going to draw the patch
if (hasLayer() && mesh->hasEmptyQuads) {
+ const float offsetX = left + mSnapshot->transform->getTranslateX();
+ const float offsetY = top + mSnapshot->transform->getTranslateY();
const size_t count = mesh->quads.size();
for (size_t i = 0; i < count; i++) {
const Rect& bounds = mesh->quads.itemAt(i);
if (pureTranslate) {
- const float x = (int) floorf(bounds.left + 0.5f);
- const float y = (int) floorf(bounds.top + 0.5f);
- dirtyLayer(x, y, x + bounds.getWidth(), y + bounds.getHeight(),
- *mSnapshot->transform);
+ const float x = (int) floorf(bounds.left + offsetX + 0.5f);
+ const float y = (int) floorf(bounds.top + offsetY + 0.5f);
+ dirtyLayer(x, y, x + bounds.getWidth(), y + bounds.getHeight());
} else {
- dirtyLayer(bounds.left, bounds.top, bounds.right, bounds.bottom,
- *mSnapshot->transform);
+ dirtyLayer(left + bounds.left, top + bounds.top,
+ left + bounds.right, top + bounds.bottom, *mSnapshot->transform);
}
}
}