Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(130)

Unified Diff: src/core/SkPipe.h

Issue 2347593004: test/fix/tweak writePicture/readPicture (Closed)
Patch Set: remove dead code Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/pipe/SkPipeCanvas.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPipe.h
diff --git a/src/core/SkPipe.h b/src/core/SkPipe.h
index d3d5a362e7af1822f841650368fc46681a33d983..04c3ae2dcae3facd278e4ef20f82217df77ce824 100644
--- a/src/core/SkPipe.h
+++ b/src/core/SkPipe.h
@@ -8,7 +8,7 @@
#ifndef SkPipe_DEFINED
#define SkPipe_DEFINED
-#include "SkTypes.h"
+#include "SkData.h"
class SkCanvas;
class SkImage;
@@ -27,8 +27,11 @@ public:
void resetCache();
- void write(SkPicture*, SkWStream*);
- void write(SkImage*, SkWStream*);
+ sk_sp<SkData> writeImage(SkImage*);
+ sk_sp<SkData> writePicture(SkPicture*);
+
+ void writeImage(SkImage*, SkWStream*);
+ void writePicture(SkPicture*, SkWStream*);
SkCanvas* beginWrite(const SkRect& cullBounds, SkWStream*);
void endWrite();
@@ -46,8 +49,23 @@ public:
// Ownership is not transferred, so caller must ceep the deserializer alive
void setTypefaceDeserializer(SkTypefaceDeserializer*);
- sk_sp<SkPicture> readPicture(const void*, size_t);
+ sk_sp<SkImage> readImage(const SkData* data) {
+ if (!data) {
+ return nullptr;
+ }
+ return this->readImage(data->data(), data->size());
+ }
+
+ sk_sp<SkPicture> readPicture(const SkData* data) {
+ if (!data) {
+ return nullptr;
+ }
+ return this->readPicture(data->data(), data->size());
+ }
+
sk_sp<SkImage> readImage(const void*, size_t);
+ sk_sp<SkPicture> readPicture(const void*, size_t);
+
bool playback(const void*, size_t, SkCanvas*);
private:
« no previous file with comments | « no previous file | src/pipe/SkPipeCanvas.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698