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

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

Issue 933043006: Implement SkBaseDevice snapshot support Base URL: https://skia.googlesource.com/skia.git@skimage-filters-04-snapshot-devices
Patch Set: Created 5 years, 9 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/SkCanvas.cpp ('k') | src/gpu/SkGpuDevice.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 * 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 SkPictureRecord_DEFINED 8 #ifndef SkPictureRecord_DEFINED
9 #define SkPictureRecord_DEFINED 9 #define SkPictureRecord_DEFINED
10 10
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 * Returns the start offset of the chunk. This is the location at which 89 * Returns the start offset of the chunk. This is the location at which
90 * the opcode & size are stored. 90 * the opcode & size are stored.
91 * TODO: since we are handing the size into here we could call reserve 91 * TODO: since we are handing the size into here we could call reserve
92 * and then return a pointer to the memory storage. This could decrease 92 * and then return a pointer to the memory storage. This could decrease
93 * allocation overhead but could lead to more wasted space (the tail 93 * allocation overhead but could lead to more wasted space (the tail
94 * end of blocks could go unused). Possibly add a second addDraw that 94 * end of blocks could go unused). Possibly add a second addDraw that
95 * operates in this manner. 95 * operates in this manner.
96 */ 96 */
97 size_t addDraw(DrawType drawType, size_t* size) { 97 size_t addDraw(DrawType drawType, size_t* size) {
98 size_t offset = fWriter.bytesWritten(); 98 size_t offset = fWriter.bytesWritten();
99
100 this->predrawNotify();
101 fContentInfo.addOperation(); 99 fContentInfo.addOperation();
102 100
103 SkASSERT(0 != *size); 101 SkASSERT(0 != *size);
104 SkASSERT(((uint8_t) drawType) == drawType); 102 SkASSERT(((uint8_t) drawType) == drawType);
105 103
106 if (0 != (*size & ~MASK_24) || *size == MASK_24) { 104 if (0 != (*size & ~MASK_24) || *size == MASK_24) {
107 fWriter.writeInt(PACK_8_24(drawType, MASK_24)); 105 fWriter.writeInt(PACK_8_24(drawType, MASK_24));
108 *size += 1; 106 *size += 1;
109 fWriter.writeInt(SkToU32(*size)); 107 fWriter.writeInt(SkToU32(*size));
110 } else { 108 } else {
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 235
238 uint32_t fRecordFlags; 236 uint32_t fRecordFlags;
239 int fInitialSaveCount; 237 int fInitialSaveCount;
240 238
241 friend class SkPictureData; // for SkPictureData's SkPictureRecord-based c onstructor 239 friend class SkPictureData; // for SkPictureData's SkPictureRecord-based c onstructor
242 240
243 typedef SkCanvas INHERITED; 241 typedef SkCanvas INHERITED;
244 }; 242 };
245 243
246 #endif 244 #endif
OLDNEW
« no previous file with comments | « src/core/SkCanvas.cpp ('k') | src/gpu/SkGpuDevice.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698