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

Side by Side Diff: src/record/SkRecorder.cpp

Issue 224723026: Add push/pop cull to SkRecord. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 8 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/record/SkRecorder.h ('k') | src/record/SkRecords.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 #include "SkRecorder.h" 1 #include "SkRecorder.h"
2 #include "SkPicture.h" 2 #include "SkPicture.h"
3 3
4 // SkCanvas will fail in mysterious ways if it doesn't know the real width and h eight. 4 // SkCanvas will fail in mysterious ways if it doesn't know the real width and h eight.
5 SkRecorder::SkRecorder(SkRecord* record, int width, int height) 5 SkRecorder::SkRecorder(SkRecord* record, int width, int height)
6 : SkCanvas(width, height), fRecord(record) {} 6 : SkCanvas(width, height), fRecord(record) {}
7 7
8 // To make appending to fRecord a little less verbose. 8 // To make appending to fRecord a little less verbose.
9 #define APPEND(T, ...) \ 9 #define APPEND(T, ...) \
10 SkNEW_PLACEMENT_ARGS(fRecord->append<SkRecords::T>(), SkRecords::T, (__V A_ARGS__)) 10 SkNEW_PLACEMENT_ARGS(fRecord->append<SkRecords::T>(), SkRecords::T, (__V A_ARGS__))
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 const SkPaint* paint, 188 const SkPaint* paint,
189 SkCanvas::SaveFlags flags) { 189 SkCanvas::SaveFlags flags) {
190 APPEND(SaveLayer, this->copy(bounds), this->copy(paint), flags); 190 APPEND(SaveLayer, this->copy(bounds), this->copy(paint), flags);
191 return SkCanvas::kNoLayer_SaveLayerStrategy; 191 return SkCanvas::kNoLayer_SaveLayerStrategy;
192 } 192 }
193 193
194 void SkRecorder::willRestore() { 194 void SkRecorder::willRestore() {
195 APPEND(Restore); 195 APPEND(Restore);
196 } 196 }
197 197
198 void SkRecorder::onPushCull(const SkRect& rect) {
199 APPEND(PushCull, rect);
200 }
201
202 void SkRecorder::onPopCull() {
203 APPEND(PopCull);
204 }
205
198 void SkRecorder::didConcat(const SkMatrix& matrix) { 206 void SkRecorder::didConcat(const SkMatrix& matrix) {
199 APPEND(Concat, matrix); 207 APPEND(Concat, matrix);
200 } 208 }
201 209
202 void SkRecorder::didSetMatrix(const SkMatrix& matrix) { 210 void SkRecorder::didSetMatrix(const SkMatrix& matrix) {
203 APPEND(SetMatrix, matrix); 211 APPEND(SetMatrix, matrix);
204 } 212 }
205 213
206 void SkRecorder::onDrawDRRect(const SkRRect& outer, const SkRRect& inner, const SkPaint& paint) { 214 void SkRecorder::onDrawDRRect(const SkRRect& outer, const SkRRect& inner, const SkPaint& paint) {
207 APPEND(DrawDRRect, outer, inner, delay_copy(paint)); 215 APPEND(DrawDRRect, outer, inner, delay_copy(paint));
208 } 216 }
209 217
210 void SkRecorder::onClipRect(const SkRect& rect, SkRegion::Op op, ClipEdgeStyle e dgeStyle) { 218 void SkRecorder::onClipRect(const SkRect& rect, SkRegion::Op op, ClipEdgeStyle e dgeStyle) {
211 APPEND(ClipRect, rect, op, edgeStyle == kSoft_ClipEdgeStyle); 219 APPEND(ClipRect, rect, op, edgeStyle == kSoft_ClipEdgeStyle);
212 } 220 }
213 221
214 void SkRecorder::onClipRRect(const SkRRect& rrect, SkRegion::Op op, ClipEdgeStyl e edgeStyle) { 222 void SkRecorder::onClipRRect(const SkRRect& rrect, SkRegion::Op op, ClipEdgeStyl e edgeStyle) {
215 APPEND(ClipRRect, rrect, op, edgeStyle == kSoft_ClipEdgeStyle); 223 APPEND(ClipRRect, rrect, op, edgeStyle == kSoft_ClipEdgeStyle);
216 } 224 }
217 225
218 void SkRecorder::onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle e dgeStyle) { 226 void SkRecorder::onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle e dgeStyle) {
219 APPEND(ClipPath, delay_copy(path), op, edgeStyle == kSoft_ClipEdgeStyle); 227 APPEND(ClipPath, delay_copy(path), op, edgeStyle == kSoft_ClipEdgeStyle);
220 } 228 }
221 229
222 void SkRecorder::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) { 230 void SkRecorder::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) {
223 APPEND(ClipRegion, delay_copy(deviceRgn), op); 231 APPEND(ClipRegion, delay_copy(deviceRgn), op);
224 } 232 }
OLDNEW
« no previous file with comments | « src/record/SkRecorder.h ('k') | src/record/SkRecords.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698