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

Unified Diff: cmake/example.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 | « bench/nanobench.cpp ('k') | dm/DMGpuSupport.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cmake/example.cpp
diff --git a/cmake/example.cpp b/cmake/example.cpp
index 93611d7c96e3ff7abd2c68e8c0a226642073b36f..96bf4d3ff81761446dd8f24bc37f8531bcf7eee5 100644
--- a/cmake/example.cpp
+++ b/cmake/example.cpp
@@ -47,15 +47,15 @@ template <typename T> std::shared_ptr<T> adopt(T* ptr) {
static std::shared_ptr<SkSurface> create_raster_surface(int w, int h) {
std::cout << "Using raster surface" << std::endl;
- return adopt(SkSurface::NewRasterN32Premul(w, h));
+ return adopt(SkSurface::MakeRasterN32Premul(w, h).release());
}
static std::shared_ptr<SkSurface> create_opengl_surface(int w, int h) {
std::cout << "Using opengl surface" << std::endl;
std::shared_ptr<GrContext> grContext = adopt(GrContext::Create(kOpenGL_GrBackend, 0));
- return adopt(SkSurface::NewRenderTarget(grContext.get(),
+ return adopt(SkSurface::MakeRenderTarget(grContext.get(),
SkBudgeted::kNo,
- SkImageInfo::MakeN32Premul(w,h)));
+ SkImageInfo::MakeN32Premul(w,h)).release());
}
int main(int, char**) {
« no previous file with comments | « bench/nanobench.cpp ('k') | dm/DMGpuSupport.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698