diff options
author | Cary Clark <caryclark@skia.org> | 2018-06-11 16:25:43 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-06-12 13:56:33 +0000 |
commit | efd99cc92817710117db9924772943b8b78c2fe5 (patch) | |
tree | 255256584f7d3d326736c3cc345b9d6c2850bdb2 /src/core/SkPicture.cpp | |
parent | e73d7d84d7702d4b3d4a938f8b18d12924889d7b (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/SkPicture.cpp')
-rw-r--r-- | src/core/SkPicture.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/core/SkPicture.cpp b/src/core/SkPicture.cpp index 2325fde864..34fa558ef5 100644 --- a/src/core/SkPicture.cpp +++ b/src/core/SkPicture.cpp @@ -8,10 +8,10 @@ #include "SkAtomics.h" #include "SkImageGenerator.h" #include "SkMathPriv.h" -#include "SkPicture.h" #include "SkPictureCommon.h" #include "SkPictureData.h" #include "SkPicturePlayback.h" +#include "SkPicturePriv.h" #include "SkPictureRecord.h" #include "SkPictureRecorder.h" #include "SkSerialProcs.h" @@ -198,9 +198,9 @@ sk_sp<SkPicture> SkPicture::MakeFromStream(SkStream* stream, const SkDeserialPro return nullptr; } -sk_sp<SkPicture> SkPicture::MakeFromBuffer(SkReadBuffer& buffer) { +sk_sp<SkPicture> SkPicturePriv::MakeFromBuffer(SkReadBuffer& buffer) { SkPictInfo info; - if (!BufferIsSKP(&buffer, &info)) { + if (!SkPicture::BufferIsSKP(&buffer, &info)) { return nullptr; } // size should be 0, 1, or negative @@ -218,7 +218,7 @@ sk_sp<SkPicture> SkPicture::MakeFromBuffer(SkReadBuffer& buffer) { return nullptr; } std::unique_ptr<SkPictureData> data(SkPictureData::CreateFromBuffer(buffer, info)); - return Forwardport(info, data.get(), &buffer); + return SkPicture::Forwardport(info, data.get(), &buffer); } SkPictureData* SkPicture::backport() const { @@ -296,15 +296,15 @@ void SkPicture::serialize(SkWStream* stream, const SkSerialProcs* procsPtr, } } -void SkPicture::flatten(SkWriteBuffer& buffer) const { - SkPictInfo info = this->createHeader(); - std::unique_ptr<SkPictureData> data(this->backport()); +void SkPicturePriv::Flatten(const sk_sp<const SkPicture> picture, SkWriteBuffer& buffer) { + SkPictInfo info = picture->createHeader(); + std::unique_ptr<SkPictureData> data(picture->backport()); buffer.writeByteArray(&info.fMagic, sizeof(info.fMagic)); buffer.writeUInt(info.getVersion()); buffer.writeRect(info.fCullRect); - if (auto custom = custom_serialize(this, buffer.fProcs)) { + if (auto custom = custom_serialize(picture.get(), buffer.fProcs)) { int32_t size = SkToS32(custom->size()); buffer.write32(-size); // negative for custom format buffer.writePad32(custom->data(), size); |