diff options
| author | 2016-03-02 12:29:56 -0800 | |
|---|---|---|
| committer | 2016-03-02 15:34:02 -0800 | |
| commit | f6c20e4b4232e30901676bcdf1aed64801d50c7e (patch) | |
| tree | 785ef569e7416e4ab6d96b54c65f8c364f8dd4b9 | |
| parent | c9a91cc050d9a1aa7e5a65cf104352e4be75cd25 (diff) | |
Fix merged bitmap mesh generation and reenable merging
bug:26793764
bug:26569206
Change-Id: I54628e99b61f58f5726a387ea3599c29695c0efc
| -rw-r--r-- | libs/hwui/BakedOpDispatcher.cpp | 5 | ||||
| -rw-r--r-- | libs/hwui/FrameBuilder.cpp | 5 | ||||
| -rw-r--r-- | libs/hwui/tests/unit/FrameBuilderTests.cpp | 3 |
3 files changed, 5 insertions, 8 deletions
diff --git a/libs/hwui/BakedOpDispatcher.cpp b/libs/hwui/BakedOpDispatcher.cpp index 80180068c44a..06b712e5f13b 100644 --- a/libs/hwui/BakedOpDispatcher.cpp +++ b/libs/hwui/BakedOpDispatcher.cpp @@ -61,7 +61,10 @@ void BakedOpDispatcher::onMergedBitmapOps(BakedOpRenderer& renderer, for (size_t i = 0; i < opList.count; i++) { const BakedOpState& state = *(opList.states[i]); TextureVertex* rectVerts = &vertices[i * 4]; - Rect opBounds = state.computedState.clippedBounds; + + // calculate unclipped bounds, since they'll determine texture coordinates + Rect opBounds = state.op->unmappedBounds; + state.computedState.transform.mapRect(opBounds); if (CC_LIKELY(state.computedState.transform.isPureTranslate())) { // pure translate, so snap (same behavior as onBitmapOp) opBounds.snapToPixelBoundaries(); diff --git a/libs/hwui/FrameBuilder.cpp b/libs/hwui/FrameBuilder.cpp index 1bc37e25f934..5642170b0ca4 100644 --- a/libs/hwui/FrameBuilder.cpp +++ b/libs/hwui/FrameBuilder.cpp @@ -517,10 +517,6 @@ void FrameBuilder::deferBitmapOp(const BitmapOp& op) { BakedOpState* bakedState = tryBakeOpState(op); if (!bakedState) return; // quick rejected - currentLayer().deferUnmergeableOp(mAllocator, bakedState, OpBatchType::Bitmap); - - // TODO: Fix this ( b/26569206 ) -/* // 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() @@ -535,7 +531,6 @@ void FrameBuilder::deferBitmapOp(const BitmapOp& op) { } else { currentLayer().deferUnmergeableOp(mAllocator, bakedState, OpBatchType::Bitmap); } -*/ } void FrameBuilder::deferBitmapMeshOp(const BitmapMeshOp& op) { diff --git a/libs/hwui/tests/unit/FrameBuilderTests.cpp b/libs/hwui/tests/unit/FrameBuilderTests.cpp index 8802d07de753..4c56a22b09b7 100644 --- a/libs/hwui/tests/unit/FrameBuilderTests.cpp +++ b/libs/hwui/tests/unit/FrameBuilderTests.cpp @@ -216,8 +216,7 @@ TEST(FrameBuilder, simpleBatching) { << "Expect number of ops = 2 * loop count"; } -// TODO: Disabled due to b/26793764 -TEST(FrameBuilder, DISABLED_clippedMerging) { +TEST(FrameBuilder, clippedMerging) { class ClippedMergingTestRenderer : public TestRendererBase { public: void onMergedBitmapOps(const MergedBakedOpList& opList) override { |