diff options
author | Chris Craik <ccraik@google.com> | 2013-09-17 18:56:18 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-09-17 18:56:18 -0700 |
commit | e08e6632294143f889ab68f0c3453ee6802dc60e (patch) | |
tree | 95d6cf6296ab180504dd65c1457ec6e445abde10 /libs/hwui | |
parent | cd93486d20a22832b5c831f9235cb991ec6dd31d (diff) | |
parent | 7cb404dda770da24aaf1b484d6575d5480cf080f (diff) | |
download | frameworks_base-e08e6632294143f889ab68f0c3453ee6802dc60e.zip frameworks_base-e08e6632294143f889ab68f0c3453ee6802dc60e.tar.gz frameworks_base-e08e6632294143f889ab68f0c3453ee6802dc60e.tar.bz2 |
am 7cb404dd: am a42ceb03: Merge "Disallow negative scale matrices in merged Bitmap drawing" into klp-dev
* commit '7cb404dda770da24aaf1b484d6575d5480cf080f':
Disallow negative scale matrices in merged Bitmap drawing
Diffstat (limited to 'libs/hwui')
-rw-r--r-- | libs/hwui/DeferredDisplayList.cpp | 5 | ||||
-rw-r--r-- | libs/hwui/DisplayListOp.h | 7 | ||||
-rw-r--r-- | libs/hwui/Matrix.cpp | 8 | ||||
-rw-r--r-- | libs/hwui/Matrix.h | 4 |
4 files changed, 21 insertions, 3 deletions
diff --git a/libs/hwui/DeferredDisplayList.cpp b/libs/hwui/DeferredDisplayList.cpp index c0b77c7..7eb7028 100644 --- a/libs/hwui/DeferredDisplayList.cpp +++ b/libs/hwui/DeferredDisplayList.cpp @@ -275,6 +275,11 @@ public: DisplayListLogBuffer& buffer = DisplayListLogBuffer::getInstance(); buffer.writeCommand(0, "multiDraw"); buffer.writeCommand(1, op->name()); + +#if DEBUG_DISPLAY_LIST_OPS_AS_EVENTS + renderer.eventMark("multiDraw"); + renderer.eventMark(op->name()); +#endif status_t status = op->multiDraw(renderer, dirty, mOps, mBounds); #if DEBUG_MERGE_BEHAVIOR diff --git a/libs/hwui/DisplayListOp.h b/libs/hwui/DisplayListOp.h index 8a5b32c..b26308b 100644 --- a/libs/hwui/DisplayListOp.h +++ b/libs/hwui/DisplayListOp.h @@ -813,12 +813,15 @@ public: virtual void onDefer(OpenGLRenderer& renderer, DeferInfo& deferInfo, const DeferredDisplayState& state) { deferInfo.batchId = DeferredDisplayList::kOpBatch_Bitmap; - deferInfo.mergeId = getAtlasEntry() ? (mergeid_t) mEntry->getMergeId() : (mergeid_t) mBitmap; + deferInfo.mergeId = getAtlasEntry() ? + (mergeid_t) mEntry->getMergeId() : (mergeid_t) mBitmap; + // Don't merge non-simply transformed or neg scale ops, SET_TEXTURE doesn't handle rotation // Don't merge A8 bitmaps - the paint's color isn't compared by mergeId, or in // MergingDrawBatch::canMergeWith() // TODO: support clipped bitmaps by handling them in SET_TEXTURE - deferInfo.mergeable = state.mMatrix.isSimple() && !state.mClipSideFlags && + deferInfo.mergeable = state.mMatrix.isSimple() && state.mMatrix.positiveScale() && + !state.mClipSideFlags && OpenGLRenderer::getXfermodeDirect(mPaint) == SkXfermode::kSrcOver_Mode && (mBitmap->getConfig() != SkBitmap::kA8_Config); } diff --git a/libs/hwui/Matrix.cpp b/libs/hwui/Matrix.cpp index 65e7eae..1948778 100644 --- a/libs/hwui/Matrix.cpp +++ b/libs/hwui/Matrix.cpp @@ -110,6 +110,10 @@ uint8_t Matrix4::getType() const { mType |= kTypeRectToRect; } } + + if (m00 > 0.0f && m11 > 0.0f) { + mType |= kTypePositiveScale; + } } return mType; } @@ -122,6 +126,10 @@ bool Matrix4::rectToRect() const { return getType() & kTypeRectToRect; } +bool Matrix4::positiveScale() const { + return getType() & kTypePositiveScale; +} + bool Matrix4::changesBounds() const { return getType() & (kTypeScale | kTypeAffine | kTypePerspective); } diff --git a/libs/hwui/Matrix.h b/libs/hwui/Matrix.h index 5116203..e2c5b20 100644 --- a/libs/hwui/Matrix.h +++ b/libs/hwui/Matrix.h @@ -64,7 +64,8 @@ public: kTypeAffine = 0x4, kTypePerspective = 0x8, kTypeRectToRect = 0x10, - kTypeUnknown = 0x20, + kTypePositiveScale = 0x20, + kTypeUnknown = 0x40, }; static const int sGeometryMask = 0xf; @@ -183,6 +184,7 @@ public: bool isIdentity() const; bool isPerspective() const; bool rectToRect() const; + bool positiveScale() const; bool changesBounds() const; |