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() {
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);
+/*
+ * 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>
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"