Skip to content

Commit 95c21d0

Browse files
author
Romain Guy
committed
Correctly pre-clip paths when recording display lists
External bug: http://code.google.com/p/android/issues/detail?id=34946 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: I56484e8c101768cde6a78625290872f7849dd5ee
1 parent 8a4ac61 commit 95c21d0

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
@@ -1552,7 +1552,7 @@ status_t DisplayListRenderer::drawBitmap(SkBitmap* bitmap, float srcLeft, float
15521552

15531553
status_t DisplayListRenderer::drawBitmapData(SkBitmap* bitmap, float left, float top,
15541554
SkPaint* paint) {
1555-
const bool reject = quickReject(left, top, left + bitmap->width(), bitmap->height());
1555+
const bool reject = quickReject(left, top, left + bitmap->width(), top + bitmap->height());
15561556
uint32_t* location = addOp(DisplayList::DrawBitmapData, reject);
15571557
addBitmapData(bitmap);
15581558
addPoint(left, top);
@@ -1659,7 +1659,10 @@ status_t DisplayListRenderer::drawPath(SkPath* path, SkPaint* paint) {
16591659
uint32_t width, height;
16601660
computePathBounds(path, paint, left, top, offset, width, height);
16611661

1662-
const bool reject = quickReject(left - offset, top - offset, width, height);
1662+
left -= offset;
1663+
top -= offset;
1664+
1665+
const bool reject = quickReject(left, top, left + width, top + height);
16631666
uint32_t* location = addOp(DisplayList::DrawPath, reject);
16641667
addPath(path);
16651668
addPaint(paint);

0 commit comments

Comments
 (0)