OLD | NEW |
| 1 /* |
| 2 * Copyright 2014 Google Inc. |
| 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. |
| 6 */ |
| 7 |
1 #include "SkRecordDraw.h" | 8 #include "SkRecordDraw.h" |
2 | 9 |
3 namespace { | 10 namespace { |
4 | 11 |
5 // This is an SkRecord visitor that will draw that SkRecord to an SkCanvas. | 12 // This is an SkRecord visitor that will draw that SkRecord to an SkCanvas. |
6 class Draw : SkNoncopyable { | 13 class Draw : SkNoncopyable { |
7 public: | 14 public: |
8 explicit Draw(SkCanvas* canvas) : fCanvas(canvas), fIndex(0), fClipEmpty(fal
se) {} | 15 explicit Draw(SkCanvas* canvas) : fCanvas(canvas), fIndex(0), fClipEmpty(fal
se) {} |
9 | 16 |
10 unsigned index() const { return fIndex; } | 17 unsigned index() const { return fIndex; } |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 r.xmode.get(), r.indices, r.indexCount, r.paint)
); | 91 r.xmode.get(), r.indices, r.indexCount, r.paint)
); |
85 #undef CASE | 92 #undef CASE |
86 | 93 |
87 } // namespace | 94 } // namespace |
88 | 95 |
89 void SkRecordDraw(const SkRecord& record, SkCanvas* canvas) { | 96 void SkRecordDraw(const SkRecord& record, SkCanvas* canvas) { |
90 for (Draw draw(canvas); draw.index() < record.count(); draw.next()) { | 97 for (Draw draw(canvas); draw.index() < record.count(); draw.next()) { |
91 record.visit(draw.index(), draw); | 98 record.visit(draw.index(), draw); |
92 } | 99 } |
93 } | 100 } |
OLD | NEW |