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 #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 Loading... |
42 SkPictureRecorder recorder; | 42 SkPictureRecorder recorder; |
43 SkCanvas* canvas = recorder.beginRecording(this->pictureCull().width(), | 43 SkCanvas* canvas = recorder.beginRecording(this->pictureCull().width(), |
44 this->pictureCull().height()); | 44 this->pictureCull().height()); |
45 | 45 |
46 bool vizMode = fDebugCanvas->getMegaVizMode(); | 46 bool vizMode = fDebugCanvas->getMegaVizMode(); |
47 fDebugCanvas->setMegaVizMode(false); | 47 fDebugCanvas->setMegaVizMode(false); |
48 bool overDraw = fDebugCanvas->getOverdrawViz(); | 48 bool overDraw = fDebugCanvas->getOverdrawViz(); |
49 fDebugCanvas->setOverdrawViz(false); | 49 fDebugCanvas->setOverdrawViz(false); |
50 bool pathOps = fDebugCanvas->getAllowSimplifyClip(); | 50 bool pathOps = fDebugCanvas->getAllowSimplifyClip(); |
51 fDebugCanvas->setAllowSimplifyClip(false); | 51 fDebugCanvas->setAllowSimplifyClip(false); |
52 int saveCount = fDebugCanvas->getOutstandingSaveCount(); | |
53 fDebugCanvas->setOutstandingSaveCount(0); | |
54 | 52 |
55 fDebugCanvas->draw(canvas); | 53 fDebugCanvas->draw(canvas); |
56 | 54 |
57 int temp = fDebugCanvas->getOutstandingSaveCount(); | |
58 for (int i = 0; i < temp; ++i) { | |
59 canvas->restore(); | |
60 } | |
61 | |
62 fDebugCanvas->setMegaVizMode(vizMode); | 55 fDebugCanvas->setMegaVizMode(vizMode); |
63 fDebugCanvas->setOverdrawViz(overDraw); | 56 fDebugCanvas->setOverdrawViz(overDraw); |
64 fDebugCanvas->setOutstandingSaveCount(saveCount); | |
65 fDebugCanvas->setAllowSimplifyClip(pathOps); | 57 fDebugCanvas->setAllowSimplifyClip(pathOps); |
66 | 58 |
67 return recorder.endRecording(); | 59 return recorder.endRecording(); |
68 } | 60 } |
69 | 61 |
70 void SkDebugger::getOverviewText(const SkTDArray<double>* typeTimes, | 62 void SkDebugger::getOverviewText(const SkTDArray<double>* typeTimes, |
71 double totTime, | 63 double totTime, |
72 SkString* overview, | 64 SkString* overview, |
73 int numRuns) { | 65 int numRuns) { |
74 const SkTDArray<SkDrawCommand*>& commands = this->getDrawCommands(); | 66 const SkTDArray<SkDrawCommand*>& commands = this->getDrawCommands(); |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 overview->append(" R: "); | 140 overview->append(" R: "); |
149 overview->appendScalar(this->pictureCull().fRight); | 141 overview->appendScalar(this->pictureCull().fRight); |
150 overview->append(" B: "); | 142 overview->append(" B: "); |
151 overview->appendScalar(this->pictureCull().fBottom); | 143 overview->appendScalar(this->pictureCull().fBottom); |
152 overview->append("<br/>"); | 144 overview->append("<br/>"); |
153 } | 145 } |
154 | 146 |
155 void SkDebugger::getClipStackText(SkString* clipStack) { | 147 void SkDebugger::getClipStackText(SkString* clipStack) { |
156 clipStack->set(fDebugCanvas->clipStackData()); | 148 clipStack->set(fDebugCanvas->clipStackData()); |
157 } | 149 } |
OLD | NEW |