summaryrefslogtreecommitdiffstats
path: root/libs/hwui
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2012-07-17 17:46:03 -0700
committerRomain Guy <romainguy@google.com>2012-07-17 18:01:51 -0700
commit3409e728e22609b54de8b33d1e614ca51f6d6a77 (patch)
tree90df9518972aded194e80496514f749cdbe7d417 /libs/hwui
parent634ccf7eb80046749df2f8f30ec3d4dc23fa3457 (diff)
downloadframeworks_base-3409e728e22609b54de8b33d1e614ca51f6d6a77.zip
frameworks_base-3409e728e22609b54de8b33d1e614ca51f6d6a77.tar.gz
frameworks_base-3409e728e22609b54de8b33d1e614ca51f6d6a77.tar.bz2
Correctly pre-clip paths when recording display lists
Bug #6836448 External bug: http://code.google.com/p/android/issues/detail?id=34946 DO NOT MERGE DisplayListRenderer::drawPath was not invoking quickReject() properly, passing x,y,width,height instead of left,top,right,bottom. A path could thus get rejected when it should be drawn instead. While working on this change I found a similar issue with another drawing command, drawBitmapData(). Change-Id: I8306faf72db14d71b54ecb7de295c9a6957d9494
Diffstat (limited to 'libs/hwui')
-rw-r--r--libs/hwui/DisplayListRenderer.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/libs/hwui/DisplayListRenderer.cpp b/libs/hwui/DisplayListRenderer.cpp
index d376e3a..0c89014 100644
--- a/libs/hwui/DisplayListRenderer.cpp
+++ b/libs/hwui/DisplayListRenderer.cpp
@@ -1541,7 +1541,7 @@ status_t DisplayListRenderer::drawBitmap(SkBitmap* bitmap, float srcLeft, float
status_t DisplayListRenderer::drawBitmapData(SkBitmap* bitmap, float left, float top,
SkPaint* paint) {
- const bool reject = quickReject(left, top, left + bitmap->width(), bitmap->height());
+ const bool reject = quickReject(left, top, left + bitmap->width(), top + bitmap->height());
uint32_t* location = addOp(DisplayList::DrawBitmapData, reject);
addBitmapData(bitmap);
addPoint(left, top);
@@ -1643,7 +1643,10 @@ status_t DisplayListRenderer::drawPath(SkPath* path, SkPaint* paint) {
uint32_t width, height;
computePathBounds(path, paint, left, top, offset, width, height);
- const bool reject = quickReject(left - offset, top - offset, width, height);
+ left -= offset;
+ top -= offset;
+
+ const bool reject = quickReject(left, top, left + width, top + height);
uint32_t* location = addOp(DisplayList::DrawPath, reject);
addPath(path);
addPaint(paint);