aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkPicturePriv.h
diff options
context:
space:
mode:
authorGravatar Cary Clark <caryclark@skia.org>2018-06-11 16:25:43 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-06-12 13:56:33 +0000
commitefd99cc92817710117db9924772943b8b78c2fe5 (patch)
tree255256584f7d3d326736c3cc345b9d6c2850bdb2 /src/core/SkPicturePriv.h
parente73d7d84d7702d4b3d4a938f8b18d12924889d7b (diff)
clean up SkPicture include
Get SkPicture.h ready for documenting. - remove private methods - move private forward declarations - name parameters R=reed@google.com, bsalomon@google.com Bug: skia:6898 Change-Id: I28829111203d8ae2a4661cf02c99023403aa0df0 Reviewed-on: https://skia-review.googlesource.com/134120 Reviewed-by: Brian Salomon <bsalomon@google.com> Reviewed-by: Cary Clark <caryclark@skia.org> Commit-Queue: Cary Clark <caryclark@google.com>
Diffstat (limited to 'src/core/SkPicturePriv.h')
-rw-r--r--src/core/SkPicturePriv.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/core/SkPicturePriv.h b/src/core/SkPicturePriv.h
new file mode 100644
index 0000000000..5c772fc9df
--- /dev/null
+++ b/src/core/SkPicturePriv.h
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2018 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef SkPicturePriv_DEFINED
+#define SkPicturePriv_DEFINED
+
+#include "SkPicture.h"
+
+class SkReadBuffer;
+class SkWriteBuffer;
+
+class SkPicturePriv {
+public:
+ /**
+ * Recreate a picture that was serialized into a buffer. If the creation requires bitmap
+ * decoding, the decoder must be set on the SkReadBuffer parameter by calling
+ * SkReadBuffer::setBitmapDecoder() before calling SkPicture::MakeFromBuffer().
+ * @param buffer Serialized picture data.
+ * @return A new SkPicture representing the serialized data, or NULL if the buffer is
+ * invalid.
+ */
+ static sk_sp<SkPicture> MakeFromBuffer(SkReadBuffer& buffer);
+
+ /**
+ * Serialize to a buffer.
+ */
+ static void Flatten(const sk_sp<const SkPicture> , SkWriteBuffer& buffer);
+
+ // Returns NULL if this is not an SkBigPicture.
+ static const SkBigPicture* AsSkBigPicture(const sk_sp<const SkPicture> picture) {
+ return picture->asSkBigPicture();
+ }
+};
+
+#endif