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

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

Issue 1316123003: Style Change: SkNEW->new; SkDELETE->delete (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-26 (Wednesday) 15:59:00 EDT Created 5 years, 3 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/utils/SkRTConf.cpp ('k') | src/utils/debugger/SkObjectParser.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 2012 Google Inc. 2 * Copyright 2012 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 #include "SkClipStack.h" 8 #include "SkClipStack.h"
9 #include "SkColorPriv.h" 9 #include "SkColorPriv.h"
10 #include "SkDebugCanvas.h" 10 #include "SkDebugCanvas.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 } 51 }
52 52
53 Factory getFactory() const override { return NULL; } 53 Factory getFactory() const override { return NULL; }
54 #ifndef SK_IGNORE_TO_STRING 54 #ifndef SK_IGNORE_TO_STRING
55 void toString(SkString* str) const override { str->set("OverdrawXfermode"); } 55 void toString(SkString* str) const override { str->set("OverdrawXfermode"); }
56 #endif 56 #endif
57 }; 57 };
58 58
59 class DebugPaintFilterCanvas : public SkPaintFilterCanvas { 59 class DebugPaintFilterCanvas : public SkPaintFilterCanvas {
60 public: 60 public:
61 DebugPaintFilterCanvas(int width, int height, bool overdrawViz, bool overrid eFilterQuality, 61 DebugPaintFilterCanvas(int width,
62 int height,
63 bool overdrawViz,
64 bool overrideFilterQuality,
62 SkFilterQuality quality) 65 SkFilterQuality quality)
63 : INHERITED(width, height) 66 : INHERITED(width, height)
64 , fOverdrawXfermode(overdrawViz ? SkNEW(OverdrawXfermode) : NULL) 67 , fOverdrawXfermode(overdrawViz ? new OverdrawXfermode : NULL)
65 , fOverrideFilterQuality(overrideFilterQuality) 68 , fOverrideFilterQuality(overrideFilterQuality)
66 , fFilterQuality(quality) { } 69 , fFilterQuality(quality) {}
67 70
68 protected: 71 protected:
69 void onFilterPaint(SkPaint* paint, Type) const override { 72 void onFilterPaint(SkPaint* paint, Type) const override {
70 if (NULL != fOverdrawXfermode.get()) { 73 if (NULL != fOverdrawXfermode.get()) {
71 paint->setAntiAlias(false); 74 paint->setAntiAlias(false);
72 paint->setXfermode(fOverdrawXfermode.get()); 75 paint->setXfermode(fOverdrawXfermode.get());
73 } 76 }
74 77
75 if (fOverrideFilterQuality) { 78 if (fOverrideFilterQuality) {
76 paint->setFilterQuality(fFilterQuality); 79 paint->setFilterQuality(fFilterQuality);
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 return fCommandVector; 357 return fCommandVector;
355 } 358 }
356 359
357 void SkDebugCanvas::updatePaintFilterCanvas() { 360 void SkDebugCanvas::updatePaintFilterCanvas() {
358 if (!fOverdrawViz && !fOverrideFilterQuality) { 361 if (!fOverdrawViz && !fOverrideFilterQuality) {
359 fPaintFilterCanvas.reset(NULL); 362 fPaintFilterCanvas.reset(NULL);
360 return; 363 return;
361 } 364 }
362 365
363 const SkImageInfo info = this->imageInfo(); 366 const SkImageInfo info = this->imageInfo();
364 fPaintFilterCanvas.reset(SkNEW_ARGS(DebugPaintFilterCanvas, (info.width(), 367 fPaintFilterCanvas.reset(new DebugPaintFilterCanvas(info.width(), info.heigh t(), fOverdrawViz,
365 info.height(), 368 fOverrideFilterQuality, fFilterQuality));
366 fOverdrawViz,
367 fOverrideFilter Quality,
368 fFilterQuality) ));
369 } 369 }
370 370
371 void SkDebugCanvas::setOverdrawViz(bool overdrawViz) { 371 void SkDebugCanvas::setOverdrawViz(bool overdrawViz) {
372 if (fOverdrawViz == overdrawViz) { 372 if (fOverdrawViz == overdrawViz) {
373 return; 373 return;
374 } 374 }
375 375
376 fOverdrawViz = overdrawViz; 376 fOverdrawViz = overdrawViz;
377 this->updatePaintFilterCanvas(); 377 this->updatePaintFilterCanvas();
378 } 378 }
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
663 } 663 }
664 664
665 bool SkDebugCanvas::lastClipStackData(const SkPath& devPath) { 665 bool SkDebugCanvas::lastClipStackData(const SkPath& devPath) {
666 if (fCalledAddStackData) { 666 if (fCalledAddStackData) {
667 fClipStackData.appendf("<br>"); 667 fClipStackData.appendf("<br>");
668 addPathData(devPath, "pathOut"); 668 addPathData(devPath, "pathOut");
669 return true; 669 return true;
670 } 670 }
671 return false; 671 return false;
672 } 672 }
OLDNEW
« no previous file with comments | « src/utils/SkRTConf.cpp ('k') | src/utils/debugger/SkObjectParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698