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

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

Issue 794263002: Cull pushCull and popCull from Skia. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix debugger Created 6 years 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/SkPictureFlat.h ('k') | src/core/SkPictureRecord.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 "SkCanvas.h" 8 #include "SkCanvas.h"
9 #include "SkPatchUtils.h" 9 #include "SkPatchUtils.h"
10 #include "SkPictureData.h" 10 #include "SkPictureData.h"
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 uint32_t packed = reader->readInt(); 141 uint32_t packed = reader->readInt();
142 SkRegion::Op regionOp = ClipParams_unpackRegionOp(packed); 142 SkRegion::Op regionOp = ClipParams_unpackRegionOp(packed);
143 bool doAA = ClipParams_unpackDoAA(packed); 143 bool doAA = ClipParams_unpackDoAA(packed);
144 size_t offsetToRestore = reader->readInt(); 144 size_t offsetToRestore = reader->readInt();
145 SkASSERT(!offsetToRestore || offsetToRestore >= reader->offset()); 145 SkASSERT(!offsetToRestore || offsetToRestore >= reader->offset());
146 canvas->clipRRect(rrect, regionOp, doAA); 146 canvas->clipRRect(rrect, regionOp, doAA);
147 if (canvas->isClipEmpty() && offsetToRestore) { 147 if (canvas->isClipEmpty() && offsetToRestore) {
148 reader->setOffset(offsetToRestore); 148 reader->setOffset(offsetToRestore);
149 } 149 }
150 } break; 150 } break;
151 case PUSH_CULL: { 151 case PUSH_CULL: break; // Deprecated, safe to ignore both push and pop.
152 const SkRect& cullRect = reader->skipT<SkRect>(); 152 case POP_CULL: break;
153 size_t offsetToRestore = reader->readInt();
154 if (offsetToRestore && canvas->quickReject(cullRect)) {
155 reader->setOffset(offsetToRestore);
156 } else {
157 canvas->pushCull(cullRect);
158 }
159 } break;
160 case POP_CULL:
161 canvas->popCull();
162 break;
163 case CONCAT: { 153 case CONCAT: {
164 SkMatrix matrix; 154 SkMatrix matrix;
165 reader->readMatrix(&matrix); 155 reader->readMatrix(&matrix);
166 canvas->concat(matrix); 156 canvas->concat(matrix);
167 break; 157 break;
168 } 158 }
169 case DRAW_BITMAP: { 159 case DRAW_BITMAP: {
170 const SkPaint* paint = fPictureData->getPaint(reader); 160 const SkPaint* paint = fPictureData->getPaint(reader);
171 const SkBitmap bitmap = shallow_copy(fPictureData->getBitmap(reader) ); 161 const SkBitmap bitmap = shallow_copy(fPictureData->getBitmap(reader) );
172 const SkPoint& loc = reader->skipT<SkPoint>(); 162 const SkPoint& loc = reader->skipT<SkPoint>();
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 case TRANSLATE: { 432 case TRANSLATE: {
443 SkScalar dx = reader->readScalar(); 433 SkScalar dx = reader->readScalar();
444 SkScalar dy = reader->readScalar(); 434 SkScalar dy = reader->readScalar();
445 canvas->translate(dx, dy); 435 canvas->translate(dx, dy);
446 } break; 436 } break;
447 default: 437 default:
448 SkASSERTF(false, "Unknown draw type: %d", op); 438 SkASSERTF(false, "Unknown draw type: %d", op);
449 } 439 }
450 } 440 }
451 441
OLDNEW
« no previous file with comments | « src/core/SkPictureFlat.h ('k') | src/core/SkPictureRecord.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698