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

Unified Diff: samplecode/SampleFatBits.cpp

Issue 1817383002: switch surface to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 | « samplecode/SampleAtlas.cpp ('k') | samplecode/SampleFilterQuality.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SampleFatBits.cpp
diff --git a/samplecode/SampleFatBits.cpp b/samplecode/SampleFatBits.cpp
index 4b15e370e496ed092e43f01cedcadc76fed3c8ad..dd588816a06e74168cb6cd49a7102fbf272644a2 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);
« no previous file with comments | « samplecode/SampleAtlas.cpp ('k') | samplecode/SampleFilterQuality.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698