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

Unified Diff: tools/VisualBench/WrappedBenchmark.h

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 | « tools/VisualBench/VisualBench.cpp ('k') | tools/android/SkAndroidSDKCanvas.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/VisualBench/WrappedBenchmark.h
diff --git a/tools/VisualBench/WrappedBenchmark.h b/tools/VisualBench/WrappedBenchmark.h
index 35d64ee1827e1b0ceba33cca333ab1b2c82c2969..bd88f13502ead965cb79cc2a0c182c639a59fd22 100644
--- a/tools/VisualBench/WrappedBenchmark.h
+++ b/tools/VisualBench/WrappedBenchmark.h
@@ -36,20 +36,20 @@ public:
fBench->perCanvasPreDraw(fOffScreen->getCanvas());
}
void onPreDraw(SkCanvas* canvas) override {
- SkASSERT(fOffScreen.get());
+ SkASSERT(fOffScreen);
fBench->preDraw(fOffScreen->getCanvas());
}
void onPostDraw(SkCanvas* canvas) override {
- SkASSERT(fOffScreen.get());
+ SkASSERT(fOffScreen);
fBench->postDraw(fOffScreen->getCanvas());
}
void onPerCanvasPostDraw(SkCanvas* canvas) override {
- SkASSERT(fOffScreen.get());
+ SkASSERT(fOffScreen);
fBench->perCanvasPostDraw(fOffScreen->getCanvas());
}
void onDraw(int loops, SkCanvas* canvas) override {
- SkASSERT(fOffScreen.get());
+ SkASSERT(fOffScreen);
fBench->draw(loops, fOffScreen->getCanvas());
this->blitToScreen(canvas);
}
@@ -68,7 +68,7 @@ protected:
virtual void onBlitToScreen(SkCanvas* canvas, int w, int h) = 0;
SkSurfaceProps fSurfaceProps;
- SkAutoTUnref<SkSurface> fOffScreen;
+ sk_sp<SkSurface> fOffScreen;
SkAutoTUnref<Benchmark> fBench;
};
@@ -80,7 +80,7 @@ public:
private:
void setupOffScreen(SkCanvas* canvas) override {
- fOffScreen.reset(SkSurface::NewRaster(canvas->imageInfo(), &this->surfaceProps()));
+ fOffScreen = SkSurface::MakeRaster(canvas->imageInfo(), &this->surfaceProps());
}
void onBlitToScreen(SkCanvas* canvas, int w, int h) override {
@@ -104,11 +104,11 @@ public:
private:
void setupOffScreen(SkCanvas* canvas) override {
- fOffScreen.reset(SkSurface::NewRenderTarget(canvas->getGrContext(),
+ fOffScreen = SkSurface::MakeRenderTarget(canvas->getGrContext(),
SkBudgeted::kNo,
canvas->imageInfo(),
fNumSamples,
- &this->surfaceProps()));
+ &this->surfaceProps());
}
void onBlitToScreen(SkCanvas* canvas, int w, int h) override {
« no previous file with comments | « tools/VisualBench/VisualBench.cpp ('k') | tools/android/SkAndroidSDKCanvas.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698