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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 SkXfermode* fXferMode; | 149 SkXfermode* fXferMode; |
150 | 150 |
151 private: | 151 private: |
152 typedef SkDrawFilter INHERITED; | 152 typedef SkDrawFilter INHERITED; |
153 }; | 153 }; |
154 | 154 |
155 // SkTexOverrideFilter modifies every paint to use the specified | 155 // SkTexOverrideFilter modifies every paint to use the specified |
156 // texture filtering mode | 156 // texture filtering mode |
157 class SkTexOverrideFilter : public SkDrawFilter { | 157 class SkTexOverrideFilter : public SkDrawFilter { |
158 public: | 158 public: |
159 SkTexOverrideFilter() : fFilterLevel(SkPaint::kNone_FilterLevel) { | 159 SkTexOverrideFilter() : fFilterQuality(kNone_SkFilterQuality) { |
160 } | 160 } |
161 | 161 |
162 void setFilterLevel(SkPaint::FilterLevel filterLevel) { | 162 void setFilterQuality(SkFilterQuality filterQuality) { |
163 fFilterLevel = filterLevel; | 163 fFilterQuality = filterQuality; |
164 } | 164 } |
165 | 165 |
166 bool filter(SkPaint* p, Type) SK_OVERRIDE { | 166 bool filter(SkPaint* p, Type) SK_OVERRIDE { |
167 p->setFilterLevel(fFilterLevel); | 167 p->setFilterQuality(fFilterQuality); |
168 return true; | 168 return true; |
169 } | 169 } |
170 | 170 |
171 protected: | 171 protected: |
172 SkPaint::FilterLevel fFilterLevel; | 172 SkFilterQuality fFilterQuality; |
173 | 173 |
174 private: | 174 private: |
175 typedef SkDrawFilter INHERITED; | 175 typedef SkDrawFilter INHERITED; |
176 }; | 176 }; |
177 | 177 |
178 class SkDebugClipVisitor : public SkCanvas::ClipVisitor { | 178 class SkDebugClipVisitor : public SkCanvas::ClipVisitor { |
179 public: | 179 public: |
180 SkDebugClipVisitor(SkCanvas* canvas) : fCanvas(canvas) {} | 180 SkDebugClipVisitor(SkCanvas* canvas) : fCanvas(canvas) {} |
181 | 181 |
182 void clipRect(const SkRect& r, SkRegion::Op, bool doAA) SK_OVERRIDE { | 182 void clipRect(const SkRect& r, SkRegion::Op, bool doAA) SK_OVERRIDE { |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 } | 372 } |
373 | 373 |
374 const SkTDArray <SkDrawCommand*>& SkDebugCanvas::getDrawCommands() const { | 374 const SkTDArray <SkDrawCommand*>& SkDebugCanvas::getDrawCommands() const { |
375 return fCommandVector; | 375 return fCommandVector; |
376 } | 376 } |
377 | 377 |
378 SkTDArray <SkDrawCommand*>& SkDebugCanvas::getDrawCommands() { | 378 SkTDArray <SkDrawCommand*>& SkDebugCanvas::getDrawCommands() { |
379 return fCommandVector; | 379 return fCommandVector; |
380 } | 380 } |
381 | 381 |
382 void SkDebugCanvas::overrideTexFiltering(bool overrideTexFiltering, SkPaint::Fil
terLevel level) { | 382 void SkDebugCanvas::overrideTexFiltering(bool overrideTexFiltering, SkFilterQual
ity quality) { |
383 if (NULL == fTexOverrideFilter) { | 383 if (NULL == fTexOverrideFilter) { |
384 fTexOverrideFilter = new SkTexOverrideFilter; | 384 fTexOverrideFilter = new SkTexOverrideFilter; |
385 } | 385 } |
386 | 386 |
387 fOverrideTexFiltering = overrideTexFiltering; | 387 fOverrideTexFiltering = overrideTexFiltering; |
388 fTexOverrideFilter->setFilterLevel(level); | 388 fTexOverrideFilter->setFilterQuality(quality); |
389 } | 389 } |
390 | 390 |
391 void SkDebugCanvas::onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyl
e edgeStyle) { | 391 void SkDebugCanvas::onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyl
e edgeStyle) { |
392 this->addDrawCommand(new SkClipPathCommand(path, op, kSoft_ClipEdgeStyle ==
edgeStyle)); | 392 this->addDrawCommand(new SkClipPathCommand(path, op, kSoft_ClipEdgeStyle ==
edgeStyle)); |
393 } | 393 } |
394 | 394 |
395 void SkDebugCanvas::onClipRect(const SkRect& rect, SkRegion::Op op, ClipEdgeStyl
e edgeStyle) { | 395 void SkDebugCanvas::onClipRect(const SkRect& rect, SkRegion::Op op, ClipEdgeStyl
e edgeStyle) { |
396 this->addDrawCommand(new SkClipRectCommand(rect, op, kSoft_ClipEdgeStyle ==
edgeStyle)); | 396 this->addDrawCommand(new SkClipRectCommand(rect, op, kSoft_ClipEdgeStyle ==
edgeStyle)); |
397 } | 397 } |
398 | 398 |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
673 } | 673 } |
674 | 674 |
675 bool SkDebugCanvas::lastClipStackData(const SkPath& devPath) { | 675 bool SkDebugCanvas::lastClipStackData(const SkPath& devPath) { |
676 if (fCalledAddStackData) { | 676 if (fCalledAddStackData) { |
677 fClipStackData.appendf("<br>"); | 677 fClipStackData.appendf("<br>"); |
678 addPathData(devPath, "pathOut"); | 678 addPathData(devPath, "pathOut"); |
679 return true; | 679 return true; |
680 } | 680 } |
681 return false; | 681 return false; |
682 } | 682 } |
OLD | NEW |