OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef SkPictureData_DEFINED | 8 #ifndef SkPictureData_DEFINED |
9 #define SkPictureData_DEFINED | 9 #define SkPictureData_DEFINED |
10 | 10 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 void flatten(SkWriteBuffer&) const; | 70 void flatten(SkWriteBuffer&) const; |
71 | 71 |
72 bool containsBitmaps() const; | 72 bool containsBitmaps() const; |
73 | 73 |
74 bool hasText() const { return fContentInfo.hasText(); } | 74 bool hasText() const { return fContentInfo.hasText(); } |
75 | 75 |
76 int opCount() const { return fContentInfo.numOperations(); } | 76 int opCount() const { return fContentInfo.numOperations(); } |
77 | 77 |
78 const SkData* opData() const { return fOpData; } | 78 const SkData* opData() const { return fOpData; } |
79 | 79 |
| 80 int version() const { return fInfo.fVersion; } |
| 81 |
80 protected: | 82 protected: |
81 explicit SkPictureData(const SkPictInfo& info); | 83 explicit SkPictureData(const SkPictInfo& info); |
82 | 84 |
83 // Does not affect ownership of SkStream. | 85 // Does not affect ownership of SkStream. |
84 bool parseStream(SkStream*, SkPicture::InstallPixelRefProc); | 86 bool parseStream(SkStream*, SkPicture::InstallPixelRefProc); |
85 bool parseBuffer(SkReadBuffer& buffer); | 87 bool parseBuffer(SkReadBuffer& buffer); |
86 | 88 |
87 public: | 89 public: |
88 const SkBitmap& getBitmap(SkReader32* reader) const { | 90 const SkBitmap& getBitmap(SkReader32* reader) const { |
89 const int index = reader->readInt(); | 91 const int index = reader->readInt(); |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 | 166 |
165 const SkPictInfo fInfo; | 167 const SkPictInfo fInfo; |
166 | 168 |
167 static void WriteFactories(SkWStream* stream, const SkFactorySet& rec); | 169 static void WriteFactories(SkWStream* stream, const SkFactorySet& rec); |
168 static void WriteTypefaces(SkWStream* stream, const SkRefCntSet& rec); | 170 static void WriteTypefaces(SkWStream* stream, const SkRefCntSet& rec); |
169 | 171 |
170 void initForPlayback() const; | 172 void initForPlayback() const; |
171 }; | 173 }; |
172 | 174 |
173 #endif | 175 #endif |
OLD | NEW |