aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--experimental/nanomsg/picture_demo.cpp15
-rw-r--r--gyp/skia_for_android_framework_defines.gypi1
-rw-r--r--include/core/SkPicture.h2
-rw-r--r--public.bzl1
4 files changed, 13 insertions, 6 deletions
diff --git a/experimental/nanomsg/picture_demo.cpp b/experimental/nanomsg/picture_demo.cpp
index 5efa03c72c..859f20e96c 100644
--- a/experimental/nanomsg/picture_demo.cpp
+++ b/experimental/nanomsg/picture_demo.cpp
@@ -1,3 +1,10 @@
+/*
+ * Copyright 2014 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
#include "nanomsg/src/nn.h"
#include "nanomsg/src/pipeline.h"
#include "nanomsg/src/reqrep.h"
@@ -53,7 +60,7 @@ static void send_picture(int socket, const PictureHeader& header, const SkData&
nn_sendmsg(socket, &msg, 0/*flags*/);
}
-static SkPicture* recv_picture(int socket, PictureHeader* header) {
+static sk_sp<SkPicture> recv_picture(int socket, PictureHeader* header) {
static const size_t hSize = sizeof(*header); // It's easy to slip up and use sizeof(header).
void* msg;
@@ -63,7 +70,7 @@ static SkPicture* recv_picture(int socket, PictureHeader* header) {
// msg is first a fixed-size header, then an .skp.
memcpy(header, msg, hSize);
SkMemoryStream stream((uint8_t*)msg + hSize, size - hSize);
- SkPicture* pic = SkPicture::CreateFromStream(&stream);
+ sk_sp<SkPicture> pic = SkPicture::MakeFromStream(&stream);
SkDebugf(" from proccess %d:", header->pid);
@@ -79,7 +86,7 @@ static void client(const char* skpPath, const char* dataEndpoint) {
exit(1);
}
SkMemoryStream stream(skp->data(), skp->size());
- SkAutoTUnref<SkPicture> picture(SkPicture::CreateFromStream(&stream));
+ sk_sp<SkPicture> picture(SkPicture::MakeFromStream(&stream));
PictureHeader header;
SkRandom rand(picture->cullRect().width() * picture->cullRect().height());
@@ -143,7 +150,7 @@ static void server(const char* dataEndpoint, const char* controlEndpoint, SkCanv
// We should have an .skp waiting for us on data socket.
PictureHeader header;
- SkAutoTUnref<SkPicture> picture(recv_picture(data, &header));
+ sk_sp<SkPicture> picture(recv_picture(data, &header));
SkPaint paint;
paint.setAlpha(header.alpha);
diff --git a/gyp/skia_for_android_framework_defines.gypi b/gyp/skia_for_android_framework_defines.gypi
index 88a9e23452..aab2ea7cb3 100644
--- a/gyp/skia_for_android_framework_defines.gypi
+++ b/gyp/skia_for_android_framework_defines.gypi
@@ -24,6 +24,7 @@
'SK_SUPPORT_LEGACY_CREATESHADER_PTR',
'SK_SUPPORT_LEGACY_PATHEFFECT_PTR',
'SK_SUPPORT_LEGACY_NEW_SURFACE_API',
+ 'SK_SUPPORT_LEGACY_PICTURE_PTR',
],
},
}
diff --git a/include/core/SkPicture.h b/include/core/SkPicture.h
index 0cf9411f56..808944b5ef 100644
--- a/include/core/SkPicture.h
+++ b/include/core/SkPicture.h
@@ -27,8 +27,6 @@ class SkWStream;
class SkWriteBuffer;
struct SkPictInfo;
-#define SK_SUPPORT_LEGACY_PICTURE_PTR
-
/** \class SkPicture
An SkPicture records drawing commands made to a canvas to be played back at a later time.
diff --git a/public.bzl b/public.bzl
index f55cd35e17..65d5e03b0d 100644
--- a/public.bzl
+++ b/public.bzl
@@ -530,6 +530,7 @@ DEFINES_ALL = [
# Staging flags for API changes
"SK_SUPPORT_LEGACY_COLORFILTER_PTR",
"SK_SUPPORT_LEGACY_CREATESHADER_PTR",
+ "SK_SUPPORT_LEGACY_PICTURE_PTR",
]
################################################################################