Loading libs/hwui/Android.mk +1 −0 Original line number Diff line number Diff line Loading @@ -242,6 +242,7 @@ LOCAL_SRC_FILES += \ tests/unit/GpuMemoryTrackerTests.cpp \ tests/unit/LayerUpdateQueueTests.cpp \ tests/unit/LinearAllocatorTests.cpp \ tests/unit/MatrixTests.cpp \ tests/unit/OffscreenBufferPoolTests.cpp \ tests/unit/SkiaBehaviorTests.cpp \ tests/unit/StringUtilsTests.cpp \ Loading libs/hwui/ClipArea.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -404,11 +404,17 @@ static bool cannotFitInRectangleList(const ClipArea& clipArea, const ClipBase* s return currentRectCount + recordedRectCount > RectangleList::kMaxTransformedRectangles; } static const ClipRect sEmptyClipRect(Rect(0, 0)); const ClipBase* ClipArea::serializeIntersectedClip(LinearAllocator& allocator, const ClipBase* recordedClip, const Matrix4& recordedClipTransform) { // if no recordedClip passed, just serialize current state if (!recordedClip) return serializeClip(allocator); // if either is empty, clip is empty if (CC_UNLIKELY(recordedClip->rect.isEmpty())|| mClipRect.isEmpty()) return &sEmptyClipRect; if (!mLastResolutionResult || recordedClip != mLastResolutionClip || recordedClipTransform != mLastResolutionTransform) { Loading libs/hwui/Matrix.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -438,7 +438,7 @@ void Matrix4::mapPoint(float& x, float& y) const { } void Matrix4::mapRect(Rect& r) const { if (isIdentity()) return; if (isIdentity() || r.isEmpty()) return; if (isSimple()) { MUL_ADD_STORE(r.left, data[kScaleX], data[kTranslateX]); Loading libs/hwui/RecordingCanvas.cpp +8 −1 Original line number Diff line number Diff line Loading @@ -594,7 +594,14 @@ void RecordingCanvas::callDrawGLFunction(Functor* functor) { } size_t RecordingCanvas::addOp(RecordedOp* op) { // TODO: validate if "addDrawOp" quickrejection logic is useful before adding // skip op with empty clip if (op->localClip && op->localClip->rect.isEmpty()) { // NOTE: this rejection happens after op construction/content ref-ing, so content ref'd // and held by renderthread isn't affected by clip rejection. // Could rewind alloc here if desired, but callers would have to not touch op afterwards. return -1; } int insertIndex = mDisplayList->ops.size(); mDisplayList->ops.push_back(op); if (mDeferredBarrierType != DeferredBarrierType::None) { Loading libs/hwui/tests/unit/ClipAreaTests.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -228,6 +228,7 @@ TEST(ClipArea, serializeIntersectedClip) { ClipRegion recordedClip; recordedClip.region.setPath(ovalPath, SkRegion(SkIRect::MakeWH(200, 200))); recordedClip.rect = Rect(200, 200); Matrix4 translate10x20; translate10x20.loadTranslate(10, 20, 0); Loading Loading
libs/hwui/Android.mk +1 −0 Original line number Diff line number Diff line Loading @@ -242,6 +242,7 @@ LOCAL_SRC_FILES += \ tests/unit/GpuMemoryTrackerTests.cpp \ tests/unit/LayerUpdateQueueTests.cpp \ tests/unit/LinearAllocatorTests.cpp \ tests/unit/MatrixTests.cpp \ tests/unit/OffscreenBufferPoolTests.cpp \ tests/unit/SkiaBehaviorTests.cpp \ tests/unit/StringUtilsTests.cpp \ Loading
libs/hwui/ClipArea.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -404,11 +404,17 @@ static bool cannotFitInRectangleList(const ClipArea& clipArea, const ClipBase* s return currentRectCount + recordedRectCount > RectangleList::kMaxTransformedRectangles; } static const ClipRect sEmptyClipRect(Rect(0, 0)); const ClipBase* ClipArea::serializeIntersectedClip(LinearAllocator& allocator, const ClipBase* recordedClip, const Matrix4& recordedClipTransform) { // if no recordedClip passed, just serialize current state if (!recordedClip) return serializeClip(allocator); // if either is empty, clip is empty if (CC_UNLIKELY(recordedClip->rect.isEmpty())|| mClipRect.isEmpty()) return &sEmptyClipRect; if (!mLastResolutionResult || recordedClip != mLastResolutionClip || recordedClipTransform != mLastResolutionTransform) { Loading
libs/hwui/Matrix.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -438,7 +438,7 @@ void Matrix4::mapPoint(float& x, float& y) const { } void Matrix4::mapRect(Rect& r) const { if (isIdentity()) return; if (isIdentity() || r.isEmpty()) return; if (isSimple()) { MUL_ADD_STORE(r.left, data[kScaleX], data[kTranslateX]); Loading
libs/hwui/RecordingCanvas.cpp +8 −1 Original line number Diff line number Diff line Loading @@ -594,7 +594,14 @@ void RecordingCanvas::callDrawGLFunction(Functor* functor) { } size_t RecordingCanvas::addOp(RecordedOp* op) { // TODO: validate if "addDrawOp" quickrejection logic is useful before adding // skip op with empty clip if (op->localClip && op->localClip->rect.isEmpty()) { // NOTE: this rejection happens after op construction/content ref-ing, so content ref'd // and held by renderthread isn't affected by clip rejection. // Could rewind alloc here if desired, but callers would have to not touch op afterwards. return -1; } int insertIndex = mDisplayList->ops.size(); mDisplayList->ops.push_back(op); if (mDeferredBarrierType != DeferredBarrierType::None) { Loading
libs/hwui/tests/unit/ClipAreaTests.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -228,6 +228,7 @@ TEST(ClipArea, serializeIntersectedClip) { ClipRegion recordedClip; recordedClip.region.setPath(ovalPath, SkRegion(SkIRect::MakeWH(200, 200))); recordedClip.rect = Rect(200, 200); Matrix4 translate10x20; translate10x20.loadTranslate(10, 20, 0); Loading