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

Side by Side Diff: src/core/SkPictureData.h

Issue 459043002: Cleaning up SkPicture-related classes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 4 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 unified diff | Download patch
« no previous file with comments | « src/core/SkPicture.cpp ('k') | src/core/SkPictureData.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 SkPicture::InstallPixelRefProc); 80 SkPicture::InstallPixelRefProc);
81 static SkPictureData* CreateFromBuffer(SkReadBuffer&, const SkPictInfo&); 81 static SkPictureData* CreateFromBuffer(SkReadBuffer&, const SkPictInfo&);
82 82
83 virtual ~SkPictureData(); 83 virtual ~SkPictureData();
84 84
85 const SkPicture::OperationList* getActiveOps(const SkIRect& queryRect) const ; 85 const SkPicture::OperationList* getActiveOps(const SkIRect& queryRect) const ;
86 86
87 void serialize(SkWStream*, SkPicture::EncodeBitmap) const; 87 void serialize(SkWStream*, SkPicture::EncodeBitmap) const;
88 void flatten(SkWriteBuffer&) const; 88 void flatten(SkWriteBuffer&) const;
89 89
90 void dumpSize() const;
91
92 bool containsBitmaps() const; 90 bool containsBitmaps() const;
93 91
94 const SkData* opData() const { return fOpData; } 92 const SkData* opData() const { return fOpData; }
95 93
96 protected: 94 protected:
97 explicit SkPictureData(const SkPictInfo& info); 95 explicit SkPictureData(const SkPictInfo& info);
98 96
99 bool parseStream(SkStream*, SkPicture::InstallPixelRefProc); 97 bool parseStream(SkStream*, SkPicture::InstallPixelRefProc);
100 bool parseBuffer(SkReadBuffer& buffer); 98 bool parseBuffer(SkReadBuffer& buffer);
101 99
(...skipping 29 matching lines...) Expand all
131 } 129 }
132 130
133 void initIterator(SkPictureStateTree::Iterator* iter, 131 void initIterator(SkPictureStateTree::Iterator* iter,
134 const SkTDArray<void*>& draws, 132 const SkTDArray<void*>& draws,
135 SkCanvas* canvas) const { 133 SkCanvas* canvas) const {
136 if (NULL != fStateTree) { 134 if (NULL != fStateTree) {
137 fStateTree->initIterator(iter, draws, canvas); 135 fStateTree->initIterator(iter, draws, canvas);
138 } 136 }
139 } 137 }
140 138
141 #ifdef SK_DEBUG_SIZE
142 int size(size_t* sizePtr);
143 int bitmaps(size_t* size);
144 int paints(size_t* size);
145 int paths(size_t* size);
146 #endif
147
148 #ifdef SK_DEBUG_DUMP
149 private:
150 void dumpBitmap(const SkBitmap& bitmap) const;
151 void dumpMatrix(const SkMatrix& matrix) const;
152 void dumpPaint(const SkPaint& paint) const;
153 void dumpPath(const SkPath& path) const;
154 void dumpPicture(const SkPicture& picture) const;
155 void dumpRegion(const SkRegion& region) const;
156 int dumpDrawType(char* bufferPtr, char* buffer, DrawType drawType);
157 int dumpInt(char* bufferPtr, char* buffer, char* name);
158 int dumpRect(char* bufferPtr, char* buffer, char* name);
159 int dumpPoint(char* bufferPtr, char* buffer, char* name);
160 void dumpPointArray(char** bufferPtrPtr, char* buffer, int count);
161 int dumpPtr(char* bufferPtr, char* buffer, char* name, void* ptr);
162 int dumpRectPtr(char* bufferPtr, char* buffer, char* name);
163 int dumpScalar(char* bufferPtr, char* buffer, char* name);
164 void dumpText(char** bufferPtrPtr, char* buffer);
165 void dumpStream();
166
167 public:
168 void dump() const;
169 #endif
170
171 #if SK_SUPPORT_GPU 139 #if SK_SUPPORT_GPU
172 /** 140 /**
173 * sampleCount is the number of samples-per-pixel or zero if non-MSAA. 141 * sampleCount is the number of samples-per-pixel or zero if non-MSAA.
174 * It is defaulted to be zero. 142 * It is defaulted to be zero.
175 */ 143 */
176 bool suitableForGpuRasterization(GrContext* context, const char **reason, 144 bool suitableForGpuRasterization(GrContext* context, const char **reason,
177 int sampleCount = 0) const; 145 int sampleCount = 0) const;
178 146
179 /** 147 /**
180 * Calls getRecommendedSampleCount with GrPixelConfig and dpi to calculate s ampleCount 148 * Calls getRecommendedSampleCount with GrPixelConfig and dpi to calculate s ampleCount
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 188
221 const SkPictInfo fInfo; 189 const SkPictInfo fInfo;
222 190
223 static void WriteFactories(SkWStream* stream, const SkFactorySet& rec); 191 static void WriteFactories(SkWStream* stream, const SkFactorySet& rec);
224 static void WriteTypefaces(SkWStream* stream, const SkRefCntSet& rec); 192 static void WriteTypefaces(SkWStream* stream, const SkRefCntSet& rec);
225 193
226 void initForPlayback() const; 194 void initForPlayback() const;
227 }; 195 };
228 196
229 #endif 197 #endif
OLDNEW
« no previous file with comments | « src/core/SkPicture.cpp ('k') | src/core/SkPictureData.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698