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

Unified Diff: samplecode/SampleApp.cpp

Issue 580073003: use surface in SkView/SampleApp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 3 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/SampleApp.h ('k') | samplecode/SampleBitmapRect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SampleApp.cpp
diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp
index 9d7e727ce5e87d46347facaf9e36b007bd9eaafe..08e7240f989f1bd131fcadb5318d66c3f774cd1a 100644
--- a/samplecode/SampleApp.cpp
+++ b/samplecode/SampleApp.cpp
@@ -271,17 +271,14 @@ public:
fBackend = kNone_BackEndType;
}
- virtual SkCanvas* createCanvas(SampleWindow::DeviceType dType,
- SampleWindow* win) {
+ virtual SkSurface* createSurface(SampleWindow::DeviceType dType,
+ SampleWindow* win) SK_OVERRIDE {
#if SK_SUPPORT_GPU
if (IsGpuDeviceType(dType) && fCurContext) {
- SkAutoTUnref<SkBaseDevice> device(SkGpuDevice::Create(fCurRenderTarget));
- return new SkCanvas(device);
- } else
-#endif
- {
- return NULL;
+ return SkSurface::NewRenderTargetDirect(fCurRenderTarget);
}
+#endif
+ return NULL;
}
virtual void publishCanvas(SampleWindow::DeviceType dType,
« no previous file with comments | « samplecode/SampleApp.h ('k') | samplecode/SampleBitmapRect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698