diff options
author | Chris Craik <ccraik@google.com> | 2013-09-20 17:37:20 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-09-20 17:37:20 -0700 |
commit | 5caebe4c7c8644b1dbf3fef23551373b95a8efd6 (patch) | |
tree | b8319a89fd466d69bd1c0dbcfbdeabe034521ff9 /libs | |
parent | 0325fc366a3b89bb1e7b2101f1e50adc0365c652 (diff) | |
parent | bd842f96ed4a9b7887be4702828ea0034d66ef85 (diff) | |
download | frameworks_base-5caebe4c7c8644b1dbf3fef23551373b95a8efd6.zip frameworks_base-5caebe4c7c8644b1dbf3fef23551373b95a8efd6.tar.gz frameworks_base-5caebe4c7c8644b1dbf3fef23551373b95a8efd6.tar.bz2 |
am bd842f96: am d8a84a86: Merge "Correct bitmap merging logic" into klp-dev
* commit 'bd842f96ed4a9b7887be4702828ea0034d66ef85':
Correct bitmap merging logic
Diffstat (limited to 'libs')
-rw-r--r-- | libs/hwui/DisplayListOp.h | 6 | ||||
-rw-r--r-- | libs/hwui/Matrix.cpp | 6 | ||||
-rw-r--r-- | libs/hwui/Matrix.h | 3 | ||||
-rw-r--r-- | libs/hwui/OpenGLRenderer.cpp | 4 | ||||
-rw-r--r-- | libs/hwui/OpenGLRenderer.h | 2 |
5 files changed, 8 insertions, 13 deletions
diff --git a/libs/hwui/DisplayListOp.h b/libs/hwui/DisplayListOp.h index b26308b..5816872 100644 --- a/libs/hwui/DisplayListOp.h +++ b/libs/hwui/DisplayListOp.h @@ -772,7 +772,7 @@ public: TextureVertex* vertex = &vertices[0]; const bool hasLayer = renderer.hasLayer(); - bool transformed = false; + bool pureTranslate = true; // TODO: manually handle rect clip for bitmaps by adjusting texCoords per op, // and allowing them to be merged in getBatchId() @@ -782,7 +782,7 @@ public: // When we reach multiDraw(), the matrix can be either // pureTranslate or simple (translate and/or scale). // If the matrix is not pureTranslate, then we have a scale - if (state.mMatrix.isPureTranslate()) transformed = true; + pureTranslate &= state.mMatrix.isPureTranslate(); Rect texCoords(0, 0, 1, 1); ((DrawBitmapOp*) ops[i].op)->mUvMapper.map(texCoords); @@ -801,7 +801,7 @@ public: } return renderer.drawBitmaps(mBitmap, mEntry, ops.size(), &vertices[0], - transformed, bounds, mPaint); + pureTranslate, bounds, mPaint); } virtual void output(int level, uint32_t logFlags) const { diff --git a/libs/hwui/Matrix.cpp b/libs/hwui/Matrix.cpp index 1948778..ba22071 100644 --- a/libs/hwui/Matrix.cpp +++ b/libs/hwui/Matrix.cpp @@ -110,10 +110,6 @@ uint8_t Matrix4::getType() const { mType |= kTypeRectToRect; } } - - if (m00 > 0.0f && m11 > 0.0f) { - mType |= kTypePositiveScale; - } } return mType; } @@ -127,7 +123,7 @@ bool Matrix4::rectToRect() const { } bool Matrix4::positiveScale() const { - return getType() & kTypePositiveScale; + return (data[kScaleX] > 0.0f && data[kScaleY] > 0.0f); } bool Matrix4::changesBounds() const { diff --git a/libs/hwui/Matrix.h b/libs/hwui/Matrix.h index e2c5b20..b861ba4 100644 --- a/libs/hwui/Matrix.h +++ b/libs/hwui/Matrix.h @@ -64,8 +64,7 @@ public: kTypeAffine = 0x4, kTypePerspective = 0x8, kTypeRectToRect = 0x10, - kTypePositiveScale = 0x20, - kTypeUnknown = 0x40, + kTypeUnknown = 0x20, }; static const int sGeometryMask = 0xf; diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp index 7b35ee1..11e2d33 100644 --- a/libs/hwui/OpenGLRenderer.cpp +++ b/libs/hwui/OpenGLRenderer.cpp @@ -2096,7 +2096,7 @@ void OpenGLRenderer::drawAlphaBitmap(Texture* texture, float left, float top, Sk * The caller is responsible for properly dirtying the current layer. */ status_t OpenGLRenderer::drawBitmaps(SkBitmap* bitmap, AssetAtlas::Entry* entry, int bitmapCount, - TextureVertex* vertices, bool transformed, const Rect& bounds, SkPaint* paint) { + TextureVertex* vertices, bool pureTranslate, const Rect& bounds, SkPaint* paint) { mCaches.activeTexture(0); Texture* texture = entry ? entry->texture : mCaches.textureCache.get(bitmap); if (!texture) return DrawGlInfo::kStatusDone; @@ -2108,7 +2108,7 @@ status_t OpenGLRenderer::drawBitmaps(SkBitmap* bitmap, AssetAtlas::Entry* entry, getAlphaAndMode(paint, &alpha, &mode); texture->setWrap(GL_CLAMP_TO_EDGE, true); - texture->setFilter(transformed ? FILTER(paint) : GL_NEAREST, true); + texture->setFilter(pureTranslate ? GL_NEAREST : FILTER(paint), true); const float x = (int) floorf(bounds.left + 0.5f); const float y = (int) floorf(bounds.top + 0.5f); diff --git a/libs/hwui/OpenGLRenderer.h b/libs/hwui/OpenGLRenderer.h index f74df97..9afb7ad 100644 --- a/libs/hwui/OpenGLRenderer.h +++ b/libs/hwui/OpenGLRenderer.h @@ -285,7 +285,7 @@ public: virtual status_t drawLayer(Layer* layer, float x, float y); virtual status_t drawBitmap(SkBitmap* bitmap, float left, float top, SkPaint* paint); status_t drawBitmaps(SkBitmap* bitmap, AssetAtlas::Entry* entry, int bitmapCount, - TextureVertex* vertices, bool transformed, const Rect& bounds, SkPaint* paint); + TextureVertex* vertices, bool pureTranslate, const Rect& bounds, SkPaint* paint); virtual status_t drawBitmap(SkBitmap* bitmap, SkMatrix* matrix, SkPaint* paint); virtual status_t drawBitmap(SkBitmap* bitmap, float srcLeft, float srcTop, float srcRight, float srcBottom, float dstLeft, float dstTop, |