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

Unified Diff: tests/LayerRasterizerTest.cpp

Issue 1821533002: guard rasterizer and drawlooper setters (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: guard google3 Created 4 years, 9 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
« no previous file with comments | « tests/LayerDrawLooperTest.cpp ('k') | tests/PaintTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/LayerRasterizerTest.cpp
diff --git a/tests/LayerRasterizerTest.cpp b/tests/LayerRasterizerTest.cpp
index a81cca40370e440c96fd57996df5964b54e061e5..b71c305d59740a67d545db5a38e203780c3e87c6 100644
--- a/tests/LayerRasterizerTest.cpp
+++ b/tests/LayerRasterizerTest.cpp
@@ -49,7 +49,7 @@ SkFlattenable* DummyRasterizer::CreateProc(SkReadBuffer&) { return new DummyRast
DEF_TEST(LayerRasterizer_destructor, reporter) {
{
SkPaint paint;
- paint.setRasterizer(new DummyRasterizer)->unref();
+ paint.setRasterizer(sk_make_sp<DummyRasterizer>());
REPORTER_ASSERT(reporter, DummyRasterizer::GetCount() == 1);
SkLayerRasterizer::Builder builder;
@@ -81,7 +81,7 @@ static bool equals(const SkLayerRasterizer_Rec& rec1, const SkLayerRasterizer_Re
DEF_TEST(LayerRasterizer_copy, reporter) {
SkLayerRasterizer::Builder builder;
- REPORTER_ASSERT(reporter, nullptr == builder.snapshotRasterizer());
+ REPORTER_ASSERT(reporter, nullptr == builder.snapshot());
SkPaint paint;
// Create a bunch of paints with different flags.
for (uint32_t flags = 0x01; flags < SkPaint::kAllFlags; flags <<= 1) {
@@ -90,14 +90,14 @@ DEF_TEST(LayerRasterizer_copy, reporter) {
}
// Create a layer rasterizer with all the existing layers.
- SkAutoTUnref<SkLayerRasterizer> firstCopy(builder.snapshotRasterizer());
+ sk_sp<SkLayerRasterizer> firstCopy(builder.snapshot());
// Add one more layer.
paint.setFlags(SkPaint::kAllFlags);
builder.addLayer(paint);
- SkAutoTUnref<SkLayerRasterizer> oneLarger(builder.snapshotRasterizer());
- SkAutoTUnref<SkLayerRasterizer> detached(builder.detachRasterizer());
+ sk_sp<SkLayerRasterizer> oneLarger(builder.snapshot());
+ sk_sp<SkLayerRasterizer> detached(builder.detach());
// Check the counts for consistency.
const int largerCount = LayerRasterizerTester::CountLayers(*oneLarger.get());
@@ -140,5 +140,5 @@ DEF_TEST(LayerRasterizer_copy, reporter) {
DEF_TEST(LayerRasterizer_detachEmpty, reporter) {
SkLayerRasterizer::Builder builder;
- REPORTER_ASSERT(reporter, nullptr == builder.detachRasterizer());
+ REPORTER_ASSERT(reporter, nullptr == builder.detach());
}
« no previous file with comments | « tests/LayerDrawLooperTest.cpp ('k') | tests/PaintTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698