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

Unified Diff: samplecode/SampleApp.h

Issue 2178353005: Remove use of MakeRenderTargetDirect from view system (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix Mac Created 4 years, 5 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 | « include/views/SkWindow.h ('k') | samplecode/SampleApp.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SampleApp.h
diff --git a/samplecode/SampleApp.h b/samplecode/SampleApp.h
index 8aea272c6d3f48c11ee23692d2b7bce899a8b552..75416426b463941f58f0cee1c7bc7d41225ea418 100644
--- a/samplecode/SampleApp.h
+++ b/samplecode/SampleApp.h
@@ -74,7 +74,7 @@ public:
// called before drawing. should install correct device
// type on the canvas. Will skip drawing if returns false.
- virtual SkSurface* createSurface(DeviceType dType, SampleWindow* win) = 0;
+ virtual sk_sp<SkSurface> makeSurface(DeviceType dType, SampleWindow* win) = 0;
// called after drawing, should get the results onto the
// screen.
@@ -90,7 +90,7 @@ public:
virtual GrContext* getGrContext() = 0;
// return the GrRenderTarget backing gpu devices (nullptr if not built with GPU support)
- virtual GrRenderTarget* getGrRenderTarget() = 0;
+ virtual int numColorSamples() const = 0;
// return the color depth of the output device
virtual int getColorBits() = 0;
@@ -102,13 +102,13 @@ public:
SampleWindow(void* hwnd, int argc, char** argv, DeviceManager*);
virtual ~SampleWindow();
- SkSurface* createSurface() override {
- SkSurface* surface = nullptr;
+ sk_sp<SkSurface> makeSurface() override {
+ sk_sp<SkSurface> surface;
if (fDevManager) {
- surface = fDevManager->createSurface(fDeviceType, this);
+ surface = fDevManager->makeSurface(fDeviceType, this);
}
- if (nullptr == surface) {
- surface = this->INHERITED::createSurface();
+ if (!surface) {
+ surface = this->INHERITED::makeSurface();
}
return surface;
}
« no previous file with comments | « include/views/SkWindow.h ('k') | samplecode/SampleApp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698