diff options
author | Romain Guy <romainguy@google.com> | 2012-09-10 17:43:20 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-09-10 17:43:21 -0700 |
commit | df46c637550b4c6f0543574cfbd544329f48f5c7 (patch) | |
tree | bb07b38061e33722cc51eceee9484bbf7b08c3fb /libs/hwui | |
parent | 3c396fccd52f9d06b453b655c20c2266dd984d19 (diff) | |
parent | 70561df470c31513056df181571632851fd0d081 (diff) | |
download | frameworks_base-df46c637550b4c6f0543574cfbd544329f48f5c7.zip frameworks_base-df46c637550b4c6f0543574cfbd544329f48f5c7.tar.gz frameworks_base-df46c637550b4c6f0543574cfbd544329f48f5c7.tar.bz2 |
Merge "Prevent degenerate 9-patches from drawing out of bounds Bug #7137292" into jb-mr1-dev
Diffstat (limited to 'libs/hwui')
-rw-r--r-- | libs/hwui/Patch.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libs/hwui/Patch.cpp b/libs/hwui/Patch.cpp index 6971d8a..abc88fa 100644 --- a/libs/hwui/Patch.cpp +++ b/libs/hwui/Patch.cpp @@ -266,6 +266,11 @@ void Patch::generateQuad(TextureVertex*& vertex, float x1, float y1, float x2, f const uint32_t oldQuadCount = quadCount; quadCount++; + if (x1 < 0.0f) x1 = 0.0f; + if (x2 < 0.0f) x2 = 0.0f; + if (y1 < 0.0f) y1 = 0.0f; + if (y2 < 0.0f) y2 = 0.0f; + // Skip degenerate and transparent (empty) quads if ((mColorKey >> oldQuadCount) & 0x1) { #if DEBUG_PATCHES_EMPTY_VERTICES |