OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |