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

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

Issue 23545017: Create a semi-stable API for capturing the state of an SkCanvas and reconstructing that state acros… (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebase Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2008 The Android Open Source Project 3 * Copyright 2008 The Android Open Source Project
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 9
10 #ifndef SkWriter32_DEFINED 10 #ifndef SkWriter32_DEFINED
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 } 107 }
108 108
109 void writePoint(const SkPoint& pt) { 109 void writePoint(const SkPoint& pt) {
110 *(SkPoint*)this->reserve(sizeof(pt)) = pt; 110 *(SkPoint*)this->reserve(sizeof(pt)) = pt;
111 } 111 }
112 112
113 void writeRect(const SkRect& rect) { 113 void writeRect(const SkRect& rect) {
114 *(SkRect*)this->reserve(sizeof(rect)) = rect; 114 *(SkRect*)this->reserve(sizeof(rect)) = rect;
115 } 115 }
116 116
117 void writeIRect(const SkIRect& rect) {
118 *(SkIRect*)this->reserve(sizeof(rect)) = rect;
119 }
120
117 void writeRRect(const SkRRect& rrect) { 121 void writeRRect(const SkRRect& rrect) {
118 rrect.writeToMemory(this->reserve(SkRRect::kSizeInMemory)); 122 rrect.writeToMemory(this->reserve(SkRRect::kSizeInMemory));
119 } 123 }
120 124
121 void writePath(const SkPath& path) { 125 void writePath(const SkPath& path) {
122 size_t size = path.writeToMemory(NULL); 126 size_t size = path.writeToMemory(NULL);
123 SkASSERT(SkAlign4(size) == size); 127 SkASSERT(SkAlign4(size) == size);
124 path.writeToMemory(this->reserve(size)); 128 path.writeToMemory(this->reserve(size));
125 } 129 }
126 130
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 296
293 private: 297 private:
294 union { 298 union {
295 void* fPtrAlignment; 299 void* fPtrAlignment;
296 double fDoubleAlignment; 300 double fDoubleAlignment;
297 char fStorage[SIZE]; 301 char fStorage[SIZE];
298 } fData; 302 } fData;
299 }; 303 };
300 304
301 #endif 305 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698