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

Side by Side Diff: debugger/SkDebugger.cpp

Issue 844493003: Remove incremental draw optimization from SkDebugCanvas (Closed) Base URL: https://skia.googlesource.com/skia.git@debugcanvas-stateless-draw-02-debugger-rasterwidget-update-on-need
Patch Set: rebase Created 5 years, 11 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 | « no previous file | src/utils/debugger/SkDebugCanvas.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 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
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 }
OLDNEW
« no previous file with comments | « no previous file | src/utils/debugger/SkDebugCanvas.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698