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

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

Issue 474983002: SkRecordDraw: incorporate clip into BBH (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: sign comparison 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/SkRecorder.h ('k') | src/core/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 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 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 #include "SkRecorder.h" 8 #include "SkRecorder.h"
9 #include "SkPatchUtils.h" 9 #include "SkPatchUtils.h"
10 #include "SkPicture.h" 10 #include "SkPicture.h"
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 223
224 SkCanvas::SaveLayerStrategy SkRecorder::willSaveLayer(const SkRect* bounds, 224 SkCanvas::SaveLayerStrategy SkRecorder::willSaveLayer(const SkRect* bounds,
225 const SkPaint* paint, 225 const SkPaint* paint,
226 SkCanvas::SaveFlags flags) { 226 SkCanvas::SaveFlags flags) {
227 APPEND(SaveLayer, this->copy(bounds), this->copy(paint), flags); 227 APPEND(SaveLayer, this->copy(bounds), this->copy(paint), flags);
228 INHERITED(willSaveLayer, bounds, paint, flags); 228 INHERITED(willSaveLayer, bounds, paint, flags);
229 return SkCanvas::kNoLayer_SaveLayerStrategy; 229 return SkCanvas::kNoLayer_SaveLayerStrategy;
230 } 230 }
231 231
232 void SkRecorder::didRestore() { 232 void SkRecorder::didRestore() {
233 APPEND(Restore, this->getTotalMatrix()); 233 APPEND(Restore, this->devBounds(), this->getTotalMatrix());
234 INHERITED(didRestore); 234 INHERITED(didRestore);
235 } 235 }
236 236
237 void SkRecorder::onPushCull(const SkRect& rect) { 237 void SkRecorder::onPushCull(const SkRect& rect) {
238 APPEND(PushCull, rect); 238 APPEND(PushCull, rect);
239 } 239 }
240 240
241 void SkRecorder::onPopCull() { 241 void SkRecorder::onPopCull() {
242 APPEND(PopCull); 242 APPEND(PopCull);
243 } 243 }
244 244
245 void SkRecorder::didConcat(const SkMatrix& matrix) { 245 void SkRecorder::didConcat(const SkMatrix& matrix) {
246 APPEND(Concat, matrix); 246 APPEND(Concat, matrix);
247 INHERITED(didConcat, matrix); 247 INHERITED(didConcat, matrix);
248 } 248 }
249 249
250 void SkRecorder::didSetMatrix(const SkMatrix& matrix) { 250 void SkRecorder::didSetMatrix(const SkMatrix& matrix) {
251 SkASSERT(matrix == this->getTotalMatrix()); 251 SkASSERT(matrix == this->getTotalMatrix());
252 APPEND(SetMatrix, matrix); 252 APPEND(SetMatrix, matrix);
253 INHERITED(didSetMatrix, matrix); 253 INHERITED(didSetMatrix, matrix);
254 } 254 }
255 255
256 void SkRecorder::onClipRect(const SkRect& rect, SkRegion::Op op, ClipEdgeStyle e dgeStyle) { 256 void SkRecorder::onClipRect(const SkRect& rect, SkRegion::Op op, ClipEdgeStyle e dgeStyle) {
257 APPEND(ClipRect, rect, op, edgeStyle == kSoft_ClipEdgeStyle);
258 INHERITED(onClipRect, rect, op, edgeStyle); 257 INHERITED(onClipRect, rect, op, edgeStyle);
258 APPEND(ClipRect, this->devBounds(), rect, op, edgeStyle == kSoft_ClipEdgeSty le);
259 } 259 }
260 260
261 void SkRecorder::onClipRRect(const SkRRect& rrect, SkRegion::Op op, ClipEdgeStyl e edgeStyle) { 261 void SkRecorder::onClipRRect(const SkRRect& rrect, SkRegion::Op op, ClipEdgeStyl e edgeStyle) {
262 APPEND(ClipRRect, rrect, op, edgeStyle == kSoft_ClipEdgeStyle);
263 INHERITED(updateClipConservativelyUsingBounds, rrect.getBounds(), op, false) ; 262 INHERITED(updateClipConservativelyUsingBounds, rrect.getBounds(), op, false) ;
263 APPEND(ClipRRect, this->devBounds(), rrect, op, edgeStyle == kSoft_ClipEdgeS tyle);
264 } 264 }
265 265
266 void SkRecorder::onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle e dgeStyle) { 266 void SkRecorder::onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle e dgeStyle) {
267 APPEND(ClipPath, delay_copy(path), op, edgeStyle == kSoft_ClipEdgeStyle);
268 INHERITED(updateClipConservativelyUsingBounds, path.getBounds(), op, path.is InverseFillType()); 267 INHERITED(updateClipConservativelyUsingBounds, path.getBounds(), op, path.is InverseFillType());
268 APPEND(ClipPath, this->devBounds(), delay_copy(path), op, edgeStyle == kSoft _ClipEdgeStyle);
269 } 269 }
270 270
271 void SkRecorder::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) { 271 void SkRecorder::onClipRegion(const SkRegion& deviceRgn, SkRegion::Op op) {
272 APPEND(ClipRegion, delay_copy(deviceRgn), op);
273 INHERITED(onClipRegion, deviceRgn, op); 272 INHERITED(onClipRegion, deviceRgn, op);
273 APPEND(ClipRegion, this->devBounds(), delay_copy(deviceRgn), op);
274 } 274 }
OLDNEW
« no previous file with comments | « src/core/SkRecorder.h ('k') | src/core/SkRecords.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698