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

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

Issue 725373003: No need to short circuit the query rect here anymore. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 1 month 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 | « no previous file | no next file » | 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 "SkLayerInfo.h" 8 #include "SkLayerInfo.h"
9 #include "SkRecordDraw.h" 9 #include "SkRecordDraw.h"
10 #include "SkPatchUtils.h" 10 #include "SkPatchUtils.h"
11 11
12 void SkRecordDraw(const SkRecord& record, 12 void SkRecordDraw(const SkRecord& record,
13 SkCanvas* canvas, 13 SkCanvas* canvas,
14 SkPicture const* const drawablePicts[], int drawableCount, 14 SkPicture const* const drawablePicts[], int drawableCount,
15 const SkBBoxHierarchy* bbh, 15 const SkBBoxHierarchy* bbh,
16 SkDrawPictureCallback* callback) { 16 SkDrawPictureCallback* callback) {
17 SkAutoCanvasRestore saveRestore(canvas, true /*save now, restore at exit*/); 17 SkAutoCanvasRestore saveRestore(canvas, true /*save now, restore at exit*/);
18 18
19 if (bbh) { 19 if (bbh) {
20 // Draw only ops that affect pixels in the canvas's current clip. 20 // Draw only ops that affect pixels in the canvas's current clip.
21 // The SkRecord and BBH were recorded in identity space. This canvas 21 // The SkRecord and BBH were recorded in identity space. This canvas
22 // is not necessarily in that same space. getClipBounds() returns us 22 // is not necessarily in that same space. getClipBounds() returns us
23 // this canvas' clip bounds transformed back into identity space, which 23 // this canvas' clip bounds transformed back into identity space, which
24 // lets us query the BBH. 24 // lets us query the BBH.
25 SkRect query; 25 SkRect query = { 0, 0, 0, 0 };
26 if (!canvas->getClipBounds(&query)) { 26 (void)canvas->getClipBounds(&query);
27 return;
28 }
29 27
30 SkTDArray<unsigned> ops; 28 SkTDArray<unsigned> ops;
31 bbh->search(query, &ops); 29 bbh->search(query, &ops);
32 30
33 SkRecords::Draw draw(canvas, drawablePicts, drawableCount); 31 SkRecords::Draw draw(canvas, drawablePicts, drawableCount);
34 for (int i = 0; i < ops.count(); i++) { 32 for (int i = 0; i < ops.count(); i++) {
35 if (callback && callback->abortDrawing()) { 33 if (callback && callback->abortDrawing()) {
36 return; 34 return;
37 } 35 }
38 // This visit call uses the SkRecords::Draw::operator() to call 36 // This visit call uses the SkRecords::Draw::operator() to call
(...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after
756 SkRecords::CollectLayers visitor(cullRect, record, data); 754 SkRecords::CollectLayers visitor(cullRect, record, data);
757 755
758 for (unsigned curOp = 0; curOp < record.count(); curOp++) { 756 for (unsigned curOp = 0; curOp < record.count(); curOp++) {
759 visitor.setCurrentOp(curOp); 757 visitor.setCurrentOp(curOp);
760 record.visit<void>(curOp, visitor); 758 record.visit<void>(curOp, visitor);
761 } 759 }
762 760
763 visitor.cleanUp(bbh); 761 visitor.cleanUp(bbh);
764 } 762 }
765 763
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698