Cleanup use of legacy SkSurface creation methods a bit
This CL cleans up some remaining uses of the old API
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2223023002
Committed: https://skia.googlesource.com/skia/+/f21cd16228c20927fa4e9b937d6951471cfaa37a
Review-Url: https://codereview.chromium.org/2223023002
diff --git a/experimental/GLFWTest/glfw_main.cpp b/experimental/GLFWTest/glfw_main.cpp
index a8ca7ea..21ec33d 100644
--- a/experimental/GLFWTest/glfw_main.cpp
+++ b/experimental/GLFWTest/glfw_main.cpp
@@ -42,7 +42,7 @@
desc.fStencilBits = 0;
desc.fRenderTargetHandle = 0; // assume default framebuffer
- sSurface = SkSurface::NewFromBackendRenderTarget(sContext, desc, NULL);
+ sSurface = SkSurface::MakeFromBackendRenderTarget(sContext, desc, nullptr, nullptr).release();
}
static void cleanup_skia() {
diff --git a/platform_tools/android/apps/canvasproof/src/main/jni/org_skia_canvasproof_GaneshPictureRenderer.cpp b/platform_tools/android/apps/canvasproof/src/main/jni/org_skia_canvasproof_GaneshPictureRenderer.cpp
index d1de529..de38919 100644
--- a/platform_tools/android/apps/canvasproof/src/main/jni/org_skia_canvasproof_GaneshPictureRenderer.cpp
+++ b/platform_tools/android/apps/canvasproof/src/main/jni/org_skia_canvasproof_GaneshPictureRenderer.cpp
@@ -37,9 +37,8 @@
SkSurfaceProps surfaceProps(SkSurfaceProps::kUseDeviceIndependentFonts_Flag,
kUnknown_SkPixelGeometry);
// TODO: Check to see if we can keep the surface between draw calls.
- SkAutoTUnref<SkSurface> surface(
- SkSurface::NewFromBackendRenderTarget(
- grContext, desc, &surfaceProps));
+ sk_sp<SkSurface> surface(
+ SkSurface::MakeFromBackendRenderTarget(grContext, desc, nullptr, &surfaceProps));
if (surface) {
SkCanvas* canvas = surface->getCanvas();
SkASSERT(canvas);
diff --git a/platform_tools/android/examples/hello_skia_app/jni/helloskia.cpp b/platform_tools/android/examples/hello_skia_app/jni/helloskia.cpp
index dec529f..2e12d37 100644
--- a/platform_tools/android/examples/hello_skia_app/jni/helloskia.cpp
+++ b/platform_tools/android/examples/hello_skia_app/jni/helloskia.cpp
@@ -1,3 +1,10 @@
+/*
+ * Copyright 2016 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
#include <math.h>
#include <jni.h>
#include <android/bitmap.h>
@@ -29,7 +36,7 @@
SkImageInfo info = SkImageInfo::MakeN32Premul(dstInfo.width, dstInfo.height);
// Create a surface from the given bitmap
- SkAutoTUnref<SkSurface> surface(SkSurface::NewRasterDirect(info, dstPixels, dstInfo.stride));
+ sk_sp<SkSurface> surface(SkSurface::MakeRasterDirect(info, dstPixels, dstInfo.stride));
SkCanvas* canvas = surface->getCanvas();
// Draw something "interesting"