Skip to content

Commit 3409e72

Browse files
author
Romain Guy
committed
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
1 parent 634ccf7 commit 3409e72

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

libs/hwui/DisplayListRenderer.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1541,7 +1541,7 @@ status_t DisplayListRenderer::drawBitmap(SkBitmap* bitmap, float srcLeft, float
15411541

15421542
status_t DisplayListRenderer::drawBitmapData(SkBitmap* bitmap, float left, float top,
15431543
SkPaint* paint) {
1544-
const bool reject = quickReject(left, top, left + bitmap->width(), bitmap->height());
1544+
const bool reject = quickReject(left, top, left + bitmap->width(), top + bitmap->height());
15451545
uint32_t* location = addOp(DisplayList::DrawBitmapData, reject);
15461546
addBitmapData(bitmap);
15471547
addPoint(left, top);
@@ -1643,7 +1643,10 @@ status_t DisplayListRenderer::drawPath(SkPath* path, SkPaint* paint) {
16431643
uint32_t width, height;
16441644
computePathBounds(path, paint, left, top, offset, width, height);
16451645

1646-
const bool reject = quickReject(left - offset, top - offset, width, height);
1646+
left -= offset;
1647+
top -= offset;
1648+
1649+
const bool reject = quickReject(left, top, left + width, top + height);
16471650
uint32_t* location = addOp(DisplayList::DrawPath, reject);
16481651
addPath(path);
16491652
addPaint(paint);

0 commit comments

Comments
 (0)