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