From 0652baa23ec2ea9e1bcdf686bf1e1118b186b42c Mon Sep 17 00:00:00 2001 From: robertphillips Date: Mon, 8 Aug 2016 09:17:20 -0700 Subject: Revert of Cleanup use of legacy SkSurface creation methods a bit (patchset #2 id:20001 of https://codereview.chromium.org/2223023002/ ) Reason for revert: webkit_headless! Original issue's description: > Cleanup use of legacy SkSurface creation methods a bit > > This: > removes the SK_SUPPORT_LEGACY_NEW_SURFACE_API flag from the bzl build > 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 TBR=benjaminwagner@google.com,egdaniel@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review-Url: https://codereview.chromium.org/2220933004 --- .../src/main/jni/org_skia_canvasproof_GaneshPictureRenderer.cpp | 5 +++-- platform_tools/android/examples/hello_skia_app/jni/helloskia.cpp | 9 +-------- 2 files changed, 4 insertions(+), 10 deletions(-) (limited to 'platform_tools/android') 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 de38919fe5..d1de529674 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,8 +37,9 @@ static void render_picture(GrContext* grContext, SkSurfaceProps surfaceProps(SkSurfaceProps::kUseDeviceIndependentFonts_Flag, kUnknown_SkPixelGeometry); // TODO: Check to see if we can keep the surface between draw calls. - sk_sp surface( - SkSurface::MakeFromBackendRenderTarget(grContext, desc, nullptr, &surfaceProps)); + SkAutoTUnref surface( + SkSurface::NewFromBackendRenderTarget( + grContext, desc, &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 2e12d37a6b..dec529ff3c 100644 --- a/platform_tools/android/examples/hello_skia_app/jni/helloskia.cpp +++ b/platform_tools/android/examples/hello_skia_app/jni/helloskia.cpp @@ -1,10 +1,3 @@ -/* - * 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 #include #include @@ -36,7 +29,7 @@ JNIEXPORT void JNICALL Java_com_example_HelloSkiaActivity_drawIntoBitmap(JNIEnv* SkImageInfo info = SkImageInfo::MakeN32Premul(dstInfo.width, dstInfo.height); // Create a surface from the given bitmap - sk_sp surface(SkSurface::MakeRasterDirect(info, dstPixels, dstInfo.stride)); + SkAutoTUnref surface(SkSurface::NewRasterDirect(info, dstPixels, dstInfo.stride)); SkCanvas* canvas = surface->getCanvas(); // Draw something "interesting" -- cgit v1.2.3