Skip to content

Commit df46c63

Browse files
Romain GuyAndroid (Google) Code Review
authored andcommitted
Merge "Prevent degenerate 9-patches from drawing out of bounds Bug #7137292" into jb-mr1-dev
2 parents 3c396fc + 70561df commit df46c63

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

libs/hwui/Patch.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,11 @@ void Patch::generateQuad(TextureVertex*& vertex, float x1, float y1, float x2, f
266266
const uint32_t oldQuadCount = quadCount;
267267
quadCount++;
268268

269+
if (x1 < 0.0f) x1 = 0.0f;
270+
if (x2 < 0.0f) x2 = 0.0f;
271+
if (y1 < 0.0f) y1 = 0.0f;
272+
if (y2 < 0.0f) y2 = 0.0f;
273+
269274
// Skip degenerate and transparent (empty) quads
270275
if ((mColorKey >> oldQuadCount) & 0x1) {
271276
#if DEBUG_PATCHES_EMPTY_VERTICES

0 commit comments

Comments
 (0)