Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1328)

Unified Diff: third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp

Issue 2290903002: Change (Pass)RefPtr<SkXxx> into sk_sp<SkXxx>. (Closed)
Patch Set: Rebasing... Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp b/third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp
index ff4549feb805873272ce4085e076a02e404b1108..22e556dcbde063cd5c50b360fb5fb10b6f23da09 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp
+++ b/third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp
@@ -1125,8 +1125,8 @@ TEST_P(PaintControllerTest, SkipCache)
TestDisplayItem(multicol, backgroundDrawingType),
TestDisplayItem(content, foregroundDrawingType),
TestDisplayItem(content, foregroundDrawingType));
- RefPtr<const SkPicture> picture1 = static_cast<const DrawingDisplayItem&>(getPaintController().getDisplayItemList()[1]).picture();
- RefPtr<const SkPicture> picture2 = static_cast<const DrawingDisplayItem&>(getPaintController().getDisplayItemList()[2]).picture();
+ sk_sp<const SkPicture> picture1 = sk_ref_sp(static_cast<const DrawingDisplayItem&>(getPaintController().getDisplayItemList()[1]).picture());
+ sk_sp<const SkPicture> picture2 = sk_ref_sp(static_cast<const DrawingDisplayItem&>(getPaintController().getDisplayItemList()[2]).picture());
EXPECT_NE(picture1, picture2);
if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
@@ -1158,8 +1158,8 @@ TEST_P(PaintControllerTest, SkipCache)
TestDisplayItem(multicol, backgroundDrawingType),
TestDisplayItem(content, foregroundDrawingType),
TestDisplayItem(content, foregroundDrawingType));
- EXPECT_NE(picture1, static_cast<const DrawingDisplayItem&>(getPaintController().getDisplayItemList()[1]).picture());
- EXPECT_NE(picture2, static_cast<const DrawingDisplayItem&>(getPaintController().getDisplayItemList()[2]).picture());
+ EXPECT_NE(picture1.get(), static_cast<const DrawingDisplayItem&>(getPaintController().getDisplayItemList()[1]).picture());
+ EXPECT_NE(picture2.get(), static_cast<const DrawingDisplayItem&>(getPaintController().getDisplayItemList()[2]).picture());
if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
EXPECT_EQ(1u, getPaintController().paintChunks().size());
@@ -1186,8 +1186,8 @@ TEST_P(PaintControllerTest, SkipCache)
TestDisplayItem(content, foregroundDrawingType),
TestDisplayItem(content, foregroundDrawingType),
TestDisplayItem(content, foregroundDrawingType));
- EXPECT_NE(picture1, static_cast<const DrawingDisplayItem&>(getPaintController().newDisplayItemList()[1]).picture());
- EXPECT_NE(picture2, static_cast<const DrawingDisplayItem&>(getPaintController().newDisplayItemList()[2]).picture());
+ EXPECT_NE(picture1.get(), static_cast<const DrawingDisplayItem&>(getPaintController().newDisplayItemList()[1]).picture());
+ EXPECT_NE(picture2.get(), static_cast<const DrawingDisplayItem&>(getPaintController().newDisplayItemList()[2]).picture());
getPaintController().commitNewDisplayItems();
@@ -1222,9 +1222,9 @@ TEST_P(PaintControllerTest, PartialSkipCache)
TestDisplayItem(content, backgroundDrawingType),
TestDisplayItem(content, foregroundDrawingType),
TestDisplayItem(content, foregroundDrawingType));
- RefPtr<const SkPicture> picture0 = static_cast<const DrawingDisplayItem&>(getPaintController().getDisplayItemList()[0]).picture();
- RefPtr<const SkPicture> picture1 = static_cast<const DrawingDisplayItem&>(getPaintController().getDisplayItemList()[1]).picture();
- RefPtr<const SkPicture> picture2 = static_cast<const DrawingDisplayItem&>(getPaintController().getDisplayItemList()[2]).picture();
+ sk_sp<const SkPicture> picture0 = sk_ref_sp(static_cast<const DrawingDisplayItem&>(getPaintController().getDisplayItemList()[0]).picture());
+ sk_sp<const SkPicture> picture1 = sk_ref_sp(static_cast<const DrawingDisplayItem&>(getPaintController().getDisplayItemList()[1]).picture());
+ sk_sp<const SkPicture> picture2 = sk_ref_sp(static_cast<const DrawingDisplayItem&>(getPaintController().getDisplayItemList()[2]).picture());
EXPECT_NE(picture1, picture2);
// Content's cache is invalid because it has display items skipped cache.
@@ -1251,9 +1251,9 @@ TEST_P(PaintControllerTest, PartialSkipCache)
TestDisplayItem(content, backgroundDrawingType),
TestDisplayItem(content, foregroundDrawingType),
TestDisplayItem(content, foregroundDrawingType));
- EXPECT_NE(picture0, static_cast<const DrawingDisplayItem&>(getPaintController().getDisplayItemList()[0]).picture());
- EXPECT_NE(picture1, static_cast<const DrawingDisplayItem&>(getPaintController().getDisplayItemList()[1]).picture());
- EXPECT_NE(picture2, static_cast<const DrawingDisplayItem&>(getPaintController().getDisplayItemList()[2]).picture());
+ EXPECT_NE(picture0.get(), static_cast<const DrawingDisplayItem&>(getPaintController().getDisplayItemList()[0]).picture());
+ EXPECT_NE(picture1.get(), static_cast<const DrawingDisplayItem&>(getPaintController().getDisplayItemList()[1]).picture());
+ EXPECT_NE(picture2.get(), static_cast<const DrawingDisplayItem&>(getPaintController().getDisplayItemList()[2]).picture());
}
TEST_F(PaintControllerTestBase, OptimizeNoopPairs)

Powered by Google App Engine
This is Rietveld 408576698