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

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

Issue 695403003: Add comments to SkRecordDraw to help people follow. (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 | src/core/SkRecordDraw.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 #ifndef SkRecordDraw_DEFINED 8 #ifndef SkRecordDraw_DEFINED
9 #define SkRecordDraw_DEFINED 9 #define SkRecordDraw_DEFINED
10 10
(...skipping 19 matching lines...) Expand all
30 30
31 namespace SkRecords { 31 namespace SkRecords {
32 32
33 // This is an SkRecord visitor that will draw that SkRecord to an SkCanvas. 33 // This is an SkRecord visitor that will draw that SkRecord to an SkCanvas.
34 class Draw : SkNoncopyable { 34 class Draw : SkNoncopyable {
35 public: 35 public:
36 explicit Draw(SkCanvas* canvas, const SkMatrix* initialCTM = NULL) 36 explicit Draw(SkCanvas* canvas, const SkMatrix* initialCTM = NULL)
37 : fInitialCTM(initialCTM ? *initialCTM : canvas->getTotalMatrix()) 37 : fInitialCTM(initialCTM ? *initialCTM : canvas->getTotalMatrix())
38 , fCanvas(canvas) {} 38 , fCanvas(canvas) {}
39 39
40 // This operator calls methods on the |canvas|. The various draw() wrapper
41 // methods around SkCanvas are defined by the DRAW() macro in
42 // SkRecordDraw.cpp.
40 template <typename T> void operator()(const T& r) { 43 template <typename T> void operator()(const T& r) {
41 this->draw(r); 44 this->draw(r);
42 } 45 }
43 46
44 private: 47 private:
45 // No base case, so we'll be compile-time checked that we implement all poss ibilities. 48 // No base case, so we'll be compile-time checked that we implement all poss ibilities.
46 template <typename T> void draw(const T&); 49 template <typename T> void draw(const T&);
47 50
48 const SkMatrix fInitialCTM; 51 const SkMatrix fInitialCTM;
49 SkCanvas* fCanvas; 52 SkCanvas* fCanvas;
(...skipping 17 matching lines...) Expand all
67 } 70 }
68 71
69 private: 72 private:
70 const SkRect fClearRect; 73 const SkRect fClearRect;
71 typedef Draw INHERITED; 74 typedef Draw INHERITED;
72 }; 75 };
73 76
74 } // namespace SkRecords 77 } // namespace SkRecords
75 78
76 #endif//SkRecordDraw_DEFINED 79 #endif//SkRecordDraw_DEFINED
OLDNEW
« no previous file with comments | « no previous file | src/core/SkRecordDraw.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698