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

Side by Side Diff: include/core/SkFlattenableBuffers.h

Issue 29143005: Constify SkFlattenable::getFactory(). (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « include/core/SkFlattenable.h ('k') | include/effects/SkDashPathEffect.h » ('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 /* 2 /*
3 * Copyright 2012 Google Inc. 3 * Copyright 2012 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #ifndef SkFlattenableBuffers_DEFINED 9 #ifndef SkFlattenableBuffers_DEFINED
10 #define SkFlattenableBuffers_DEFINED 10 #define SkFlattenableBuffers_DEFINED
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 virtual void writeScalarArray(const SkScalar* value, uint32_t count) = 0; 175 virtual void writeScalarArray(const SkScalar* value, uint32_t count) = 0;
176 virtual void writeInt(int32_t value) = 0; 176 virtual void writeInt(int32_t value) = 0;
177 virtual void writeIntArray(const int32_t* value, uint32_t count) = 0; 177 virtual void writeIntArray(const int32_t* value, uint32_t count) = 0;
178 virtual void writeUInt(uint32_t value) = 0; 178 virtual void writeUInt(uint32_t value) = 0;
179 virtual void write32(int32_t value) = 0; // printf in hex 179 virtual void write32(int32_t value) = 0; // printf in hex
180 virtual void writeString(const char* value) = 0; 180 virtual void writeString(const char* value) = 0;
181 virtual void writeEncodedString(const void* value, size_t byteLength, 181 virtual void writeEncodedString(const void* value, size_t byteLength,
182 SkPaint::TextEncoding encoding) = 0; 182 SkPaint::TextEncoding encoding) = 0;
183 183
184 // common data structures 184 // common data structures
185 virtual void writeFlattenable(SkFlattenable* flattenable) = 0; 185 virtual void writeFlattenable(const SkFlattenable* flattenable) = 0;
186 virtual void writeColor(const SkColor& color) = 0; 186 virtual void writeColor(const SkColor& color) = 0;
187 virtual void writeColorArray(const SkColor* color, uint32_t count) = 0; 187 virtual void writeColorArray(const SkColor* color, uint32_t count) = 0;
188 virtual void writePoint(const SkPoint& point) = 0; 188 virtual void writePoint(const SkPoint& point) = 0;
189 virtual void writePointArray(const SkPoint* points, uint32_t count) = 0; 189 virtual void writePointArray(const SkPoint* points, uint32_t count) = 0;
190 virtual void writeMatrix(const SkMatrix& matrix) = 0; 190 virtual void writeMatrix(const SkMatrix& matrix) = 0;
191 virtual void writeIRect(const SkIRect& rect) = 0; 191 virtual void writeIRect(const SkIRect& rect) = 0;
192 virtual void writeRect(const SkRect& rect) = 0; 192 virtual void writeRect(const SkRect& rect) = 0;
193 virtual void writeRegion(const SkRegion& region) = 0; 193 virtual void writeRegion(const SkRegion& region) = 0;
194 virtual void writePath(const SkPath& path) = 0; 194 virtual void writePath(const SkPath& path) = 0;
195 virtual size_t writeStream(SkStream* stream, size_t length) = 0; 195 virtual size_t writeStream(SkStream* stream, size_t length) = 0;
(...skipping 19 matching lines...) Expand all
215 } 215 }
216 216
217 bool persistTypeface() const { return (fFlags & kCrossProcess_Flag) != 0; } 217 bool persistTypeface() const { return (fFlags & kCrossProcess_Flag) != 0; }
218 218
219 void writeDataAsByteArray(SkData* data) { 219 void writeDataAsByteArray(SkData* data) {
220 this->writeByteArray(data->data(), data->size()); 220 this->writeByteArray(data->data(), data->size());
221 } 221 }
222 222
223 protected: 223 protected:
224 // A helper function so that each subclass does not have to be a friend of S kFlattenable 224 // A helper function so that each subclass does not have to be a friend of S kFlattenable
225 void flattenObject(SkFlattenable* obj, SkFlattenableWriteBuffer& buffer); 225 void flattenObject(const SkFlattenable* obj, SkFlattenableWriteBuffer& buffe r);
226 226
227 uint32_t fFlags; 227 uint32_t fFlags;
228 }; 228 };
229 229
230 #endif 230 #endif
OLDNEW
« no previous file with comments | « include/core/SkFlattenable.h ('k') | include/effects/SkDashPathEffect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698