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

Side by Side Diff: debugger/SkDebugger.cpp

Issue 282283002: add pathops to debugger (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: make getAllowSimplifyClip const Created 6 years, 7 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 | « debugger/SkDebugger.h ('k') | include/core/SkCanvas.h » ('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 #include "SkDebugger.h" 9 #include "SkDebugger.h"
10 #include "SkPictureRecorder.h" 10 #include "SkPictureRecorder.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 SkPicture* SkDebugger::copyPicture() { 42 SkPicture* SkDebugger::copyPicture() {
43 // We can't just call clone here since we want to removed the "deleted" 43 // We can't just call clone here since we want to removed the "deleted"
44 // commands. Playing back will strip those out. 44 // commands. Playing back will strip those out.
45 SkPictureRecorder recorder; 45 SkPictureRecorder recorder;
46 SkCanvas* canvas = recorder.beginRecording(fPictureWidth, fPictureHeight, NU LL, 0); 46 SkCanvas* canvas = recorder.beginRecording(fPictureWidth, fPictureHeight, NU LL, 0);
47 47
48 bool vizMode = fDebugCanvas->getMegaVizMode(); 48 bool vizMode = fDebugCanvas->getMegaVizMode();
49 fDebugCanvas->setMegaVizMode(false); 49 fDebugCanvas->setMegaVizMode(false);
50 bool overDraw = fDebugCanvas->getOverdrawViz(); 50 bool overDraw = fDebugCanvas->getOverdrawViz();
51 fDebugCanvas->setOverdrawViz(false); 51 fDebugCanvas->setOverdrawViz(false);
52 bool pathOps = fDebugCanvas->getAllowSimplifyClip();
53 fDebugCanvas->setAllowSimplifyClip(false);
52 int saveCount = fDebugCanvas->getOutstandingSaveCount(); 54 int saveCount = fDebugCanvas->getOutstandingSaveCount();
53 fDebugCanvas->setOutstandingSaveCount(0); 55 fDebugCanvas->setOutstandingSaveCount(0);
54 56
55 fDebugCanvas->draw(canvas); 57 fDebugCanvas->draw(canvas);
56 58
57 int temp = fDebugCanvas->getOutstandingSaveCount(); 59 int temp = fDebugCanvas->getOutstandingSaveCount();
58 for (int i = 0; i < temp; ++i) { 60 for (int i = 0; i < temp; ++i) {
59 canvas->restore(); 61 canvas->restore();
60 } 62 }
61 63
62 fDebugCanvas->setMegaVizMode(vizMode); 64 fDebugCanvas->setMegaVizMode(vizMode);
63 fDebugCanvas->setOverdrawViz(overDraw); 65 fDebugCanvas->setOverdrawViz(overDraw);
64 fDebugCanvas->setOutstandingSaveCount(saveCount); 66 fDebugCanvas->setOutstandingSaveCount(saveCount);
67 fDebugCanvas->setAllowSimplifyClip(pathOps);
65 68
66 return recorder.endRecording(); 69 return recorder.endRecording();
67 } 70 }
68 71
69 void SkDebugger::getOverviewText(const SkTDArray<double>* typeTimes, 72 void SkDebugger::getOverviewText(const SkTDArray<double>* typeTimes,
70 double totTime, 73 double totTime,
71 SkString* overview, 74 SkString* overview,
72 int numRuns) { 75 int numRuns) {
73 const SkTDArray<SkDrawCommand*>& commands = this->getDrawCommands(); 76 const SkTDArray<SkDrawCommand*>& commands = this->getDrawCommands();
74 77
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 overview->insert(0, totalStr); 144 overview->insert(0, totalStr);
142 145
143 overview->append("<br/>"); 146 overview->append("<br/>");
144 overview->append("SkPicture Width: "); 147 overview->append("SkPicture Width: ");
145 overview->appendS32(pictureWidth()); 148 overview->appendS32(pictureWidth());
146 overview->append("px<br/>"); 149 overview->append("px<br/>");
147 overview->append("SkPicture Height: "); 150 overview->append("SkPicture Height: ");
148 overview->appendS32(pictureHeight()); 151 overview->appendS32(pictureHeight());
149 overview->append("px"); 152 overview->append("px");
150 } 153 }
154
155 void SkDebugger::getClipStackText(SkString* clipStack) {
156 clipStack->set(fDebugCanvas->clipStackData());
157 }
158
OLDNEW
« no previous file with comments | « debugger/SkDebugger.h ('k') | include/core/SkCanvas.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698