| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "platform/graphics/paint/PaintController.h" | 5 #include "platform/graphics/paint/PaintController.h" |
| 6 | 6 |
| 7 #include "platform/RuntimeEnabledFeatures.h" | 7 #include "platform/RuntimeEnabledFeatures.h" |
| 8 #include "platform/graphics/GraphicsContext.h" | 8 #include "platform/graphics/GraphicsContext.h" |
| 9 #include "platform/graphics/paint/ClipPathDisplayItem.h" | 9 #include "platform/graphics/paint/ClipPathDisplayItem.h" |
| 10 #include "platform/graphics/paint/ClipPathRecorder.h" | 10 #include "platform/graphics/paint/ClipPathRecorder.h" |
| (...skipping 1758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1769 GetPaintController().GetDisplayItemList()[1]) | 1769 GetPaintController().GetDisplayItemList()[1]) |
| 1770 .GetPaintRecord(); | 1770 .GetPaintRecord(); |
| 1771 sk_sp<const PaintRecord> record2 = | 1771 sk_sp<const PaintRecord> record2 = |
| 1772 static_cast<const DrawingDisplayItem&>( | 1772 static_cast<const DrawingDisplayItem&>( |
| 1773 GetPaintController().GetDisplayItemList()[2]) | 1773 GetPaintController().GetDisplayItemList()[2]) |
| 1774 .GetPaintRecord(); | 1774 .GetPaintRecord(); |
| 1775 EXPECT_NE(record1, record2); | 1775 EXPECT_NE(record1, record2); |
| 1776 | 1776 |
| 1777 // Content's cache is invalid because it has display items skipped cache. | 1777 // Content's cache is invalid because it has display items skipped cache. |
| 1778 EXPECT_FALSE(GetPaintController().ClientCacheIsValid(content)); | 1778 EXPECT_FALSE(GetPaintController().ClientCacheIsValid(content)); |
| 1779 EXPECT_EQ(kPaintInvalidationFull, content.GetPaintInvalidationReason()); | 1779 EXPECT_EQ(PaintInvalidationReason::kFull, |
| 1780 content.GetPaintInvalidationReason()); |
| 1780 | 1781 |
| 1781 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { | 1782 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
| 1782 GetPaintController().UpdateCurrentPaintChunkProperties( | 1783 GetPaintController().UpdateCurrentPaintChunkProperties( |
| 1783 &root_paint_chunk_id_, DefaultPaintChunkProperties()); | 1784 &root_paint_chunk_id_, DefaultPaintChunkProperties()); |
| 1784 } | 1785 } |
| 1785 // Draw again with nothing invalidated. | 1786 // Draw again with nothing invalidated. |
| 1786 DrawRect(context, content, kBackgroundDrawingType, rect1); | 1787 DrawRect(context, content, kBackgroundDrawingType, rect1); |
| 1787 GetPaintController().BeginSkippingCache(); | 1788 GetPaintController().BeginSkippingCache(); |
| 1788 DrawRect(context, content, kForegroundDrawingType, rect2); | 1789 DrawRect(context, content, kForegroundDrawingType, rect2); |
| 1789 GetPaintController().EndSkippingCache(); | 1790 GetPaintController().EndSkippingCache(); |
| (...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2318 TEST_F(PaintControllerUnderInvalidationTest, InvalidationInSubsequence) { | 2319 TEST_F(PaintControllerUnderInvalidationTest, InvalidationInSubsequence) { |
| 2319 // We allow invalidated display item clients as long as they would produce the | 2320 // We allow invalidated display item clients as long as they would produce the |
| 2320 // same display items. The cases of changed display items are tested by other | 2321 // same display items. The cases of changed display items are tested by other |
| 2321 // test cases. | 2322 // test cases. |
| 2322 TestInvalidationInSubsequence(); | 2323 TestInvalidationInSubsequence(); |
| 2323 } | 2324 } |
| 2324 | 2325 |
| 2325 #endif // defined(GTEST_HAS_DEATH_TEST) && !OS(ANDROID) | 2326 #endif // defined(GTEST_HAS_DEATH_TEST) && !OS(ANDROID) |
| 2326 | 2327 |
| 2327 } // namespace blink | 2328 } // namespace blink |
| OLD | NEW |