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

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

Issue 349973008: Tick off some TODOs: (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: robert Created 6 years, 6 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/SkRecordDraw.h ('k') | tests/RecordDrawTest.cpp » ('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 "SkRecordDraw.h" 8 #include "SkRecordDraw.h"
9 9
10 void SkRecordDraw(const SkRecord& record, SkCanvas* canvas) { 10 void SkRecordDraw(const SkRecord& record, SkCanvas* canvas, SkDrawPictureCallbac k* callback) {
11 SkAutoCanvasRestore saveRestore(canvas, true /*save now, restore at exit*/);
11 for (SkRecords::Draw draw(canvas); draw.index() < record.count(); draw.next( )) { 12 for (SkRecords::Draw draw(canvas); draw.index() < record.count(); draw.next( )) {
13 if (NULL != callback && callback->abortDrawing()) {
14 return;
15 }
12 record.visit<void>(draw.index(), draw); 16 record.visit<void>(draw.index(), draw);
13 } 17 }
14 } 18 }
15 19
16 namespace SkRecords { 20 namespace SkRecords {
17 21
18 bool Draw::skip(const PairedPushCull& r) { 22 bool Draw::skip(const PairedPushCull& r) {
19 if (fCanvas->quickReject(r.base->rect)) { 23 if (fCanvas->quickReject(r.base->rect)) {
20 fIndex += r.skip; 24 fIndex += r.skip;
21 return true; 25 return true;
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 DRAW(DrawText, drawText(r.text, r.byteLength, r.x, r.y, r.paint)); 66 DRAW(DrawText, drawText(r.text, r.byteLength, r.x, r.y, r.paint));
63 DRAW(DrawTextOnPath, drawTextOnPath(r.text, r.byteLength, r.path, r.matrix, r.pa int)); 67 DRAW(DrawTextOnPath, drawTextOnPath(r.text, r.byteLength, r.path, r.matrix, r.pa int));
64 DRAW(DrawVertices, drawVertices(r.vmode, r.vertexCount, r.vertices, r.texs, r.co lors, 68 DRAW(DrawVertices, drawVertices(r.vmode, r.vertexCount, r.vertices, r.texs, r.co lors,
65 r.xmode.get(), r.indices, r.indexCount, r.paint) ); 69 r.xmode.get(), r.indices, r.indexCount, r.paint) );
66 #undef DRAW 70 #undef DRAW
67 71
68 template <> void Draw::draw(const PairedPushCull& r) { this->draw(*r.base); } 72 template <> void Draw::draw(const PairedPushCull& r) { this->draw(*r.base); }
69 template <> void Draw::draw(const BoundedDrawPosTextH& r) { this->draw(*r.base); } 73 template <> void Draw::draw(const BoundedDrawPosTextH& r) { this->draw(*r.base); }
70 74
71 } // namespace SkRecords 75 } // namespace SkRecords
OLDNEW
« no previous file with comments | « src/core/SkRecordDraw.h ('k') | tests/RecordDrawTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698