From e8f3062a36d3682f4019309a32b5b84dc9eddf8c Mon Sep 17 00:00:00 2001 From: reed Date: Wed, 23 Mar 2016 18:59:25 -0700 Subject: switch surface to sk_sp BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1817383002 CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Ubuntu-GCC-x86_64-Release-CMake-Trybot,Build-Mac-Clang-x86_64-Release-CMake-Trybot Review URL: https://codereview.chromium.org/1817383002 --- samplecode/SampleFatBits.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'samplecode/SampleFatBits.cpp') diff --git a/samplecode/SampleFatBits.cpp b/samplecode/SampleFatBits.cpp index 4b15e370e4..dd588816a0 100644 --- a/samplecode/SampleFatBits.cpp +++ b/samplecode/SampleFatBits.cpp @@ -91,9 +91,9 @@ public: fShader = sk_tool_utils::create_checkerboard_shader(0xFFCCCCCC, 0xFFFFFFFF, zoom); SkImageInfo info = SkImageInfo::MakeN32Premul(width, height); - fMinSurface.reset(SkSurface::NewRaster(info)); + fMinSurface = SkSurface::MakeRaster(info); info = info.makeWH(width * zoom, height * zoom); - fMaxSurface.reset(SkSurface::NewRaster(info)); + fMaxSurface = SkSurface::MakeRaster(info); } void drawBG(SkCanvas*); @@ -111,8 +111,8 @@ private: SkMatrix fMatrix, fInverse; SkRect fBounds, fClipRect; sk_sp fShader; - SkAutoTUnref fMinSurface; - SkAutoTUnref fMaxSurface; + sk_sp fMinSurface; + sk_sp fMaxSurface; void setupPaint(SkPaint* paint) { bool aa = this->getAA(); @@ -162,7 +162,7 @@ private: } void copyMinToMax() { - erase(fMaxSurface); + erase(fMaxSurface.get()); SkCanvas* canvas = fMaxSurface->getCanvas(); canvas->save(); canvas->concat(fMatrix); @@ -275,7 +275,7 @@ void FatBits::drawLine(SkCanvas* canvas, SkPoint pts[]) { apply_grid(pts, 2); } - erase(fMinSurface); + erase(fMinSurface.get()); this->setupPaint(&paint); paint.setColor(FAT_PIXEL_COLOR); if (fUseClip) { @@ -310,7 +310,7 @@ void FatBits::drawRect(SkCanvas* canvas, SkPoint pts[2]) { SkRect r; r.set(pts, 2); - erase(fMinSurface); + erase(fMinSurface.get()); this->setupPaint(&paint); paint.setColor(FAT_PIXEL_COLOR); { @@ -356,7 +356,7 @@ void FatBits::drawTriangle(SkCanvas* canvas, SkPoint pts[3]) { path.lineTo(pts[2]); path.close(); - erase(fMinSurface); + erase(fMinSurface.get()); this->setupPaint(&paint); paint.setColor(FAT_PIXEL_COLOR); fMinSurface->getCanvas()->drawPath(path, paint); -- cgit v1.2.3