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

Side by Side Diff: src/utils/debugger/SkDebugCanvas.cpp

Issue 166583002: Factory methods for heap-allocated SkPathEffect and SkXfermode objects. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update experimental/PdfViewer Created 6 years, 10 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/effects/SkArithmeticMode.cpp ('k') | tests/DrawPathTest.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 /* 2 /*
3 * Copyright 2012 Google Inc. 3 * Copyright 2012 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 } 111 }
112 112
113 return gTable[SK_ARRAY_COUNT(gTable)-1]; 113 return gTable[SK_ARRAY_COUNT(gTable)-1];
114 } 114 }
115 115
116 // The OverdrawFilter modifies every paint to use an SkProcXfermode which 116 // The OverdrawFilter modifies every paint to use an SkProcXfermode which
117 // in turn invokes OverdrawXferModeProc 117 // in turn invokes OverdrawXferModeProc
118 class SkOverdrawFilter : public SkDrawFilter { 118 class SkOverdrawFilter : public SkDrawFilter {
119 public: 119 public:
120 SkOverdrawFilter() { 120 SkOverdrawFilter() {
121 fXferMode = new SkProcXfermode(OverdrawXferModeProc); 121 fXferMode = SkProcXfermode::Create(OverdrawXferModeProc);
122 } 122 }
123 123
124 virtual ~SkOverdrawFilter() { 124 virtual ~SkOverdrawFilter() {
125 delete fXferMode; 125 delete fXferMode;
126 } 126 }
127 127
128 virtual bool filter(SkPaint* p, Type) SK_OVERRIDE { 128 virtual bool filter(SkPaint* p, Type) SK_OVERRIDE {
129 p->setXfermode(fXferMode); 129 p->setXfermode(fXferMode);
130 return true; 130 return true;
131 } 131 }
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 461
462 bool SkDebugCanvas::translate(SkScalar dx, SkScalar dy) { 462 bool SkDebugCanvas::translate(SkScalar dx, SkScalar dy) {
463 addDrawCommand(new SkTranslateCommand(dx, dy)); 463 addDrawCommand(new SkTranslateCommand(dx, dy));
464 return true; 464 return true;
465 } 465 }
466 466
467 void SkDebugCanvas::toggleCommand(int index, bool toggle) { 467 void SkDebugCanvas::toggleCommand(int index, bool toggle) {
468 SkASSERT(index < fCommandVector.count()); 468 SkASSERT(index < fCommandVector.count());
469 fCommandVector[index]->setVisible(toggle); 469 fCommandVector[index]->setVisible(toggle);
470 } 470 }
OLDNEW
« no previous file with comments | « src/effects/SkArithmeticMode.cpp ('k') | tests/DrawPathTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698