diff options
author | reed <reed@google.com> | 2016-03-23 18:59:25 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-23 18:59:25 -0700 |
commit | e8f3062a36d3682f4019309a32b5b84dc9eddf8c (patch) | |
tree | ff5cd50c65edb6e3b77f77327165ad0162557137 /samplecode/SampleFatBits.cpp | |
parent | 041c870425eb0a3e2b0cbc46581b3da2f50571d9 (diff) |
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
Diffstat (limited to 'samplecode/SampleFatBits.cpp')
-rw-r--r-- | samplecode/SampleFatBits.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
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<SkShader> fShader; - SkAutoTUnref<SkSurface> fMinSurface; - SkAutoTUnref<SkSurface> fMaxSurface; + sk_sp<SkSurface> fMinSurface; + sk_sp<SkSurface> 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); |