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

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

Issue 21789005: Fix OverdrawFilter not set on first call to SkDebugCanvas::drawTo() (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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 9
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 canvas->restore(); 146 canvas->restore();
147 } 147 }
148 i = 0; 148 i = 0;
149 canvas->clear(SK_ColorTRANSPARENT); 149 canvas->clear(SK_ColorTRANSPARENT);
150 canvas->resetMatrix(); 150 canvas->resetMatrix();
151 SkRect rect = SkRect::MakeWH(SkIntToScalar(fWidth), 151 SkRect rect = SkRect::MakeWH(SkIntToScalar(fWidth),
152 SkIntToScalar(fHeight)); 152 SkIntToScalar(fHeight));
153 canvas->clipRect(rect, SkRegion::kReplace_Op ); 153 canvas->clipRect(rect, SkRegion::kReplace_Op );
154 applyUserTransform(canvas); 154 applyUserTransform(canvas);
155 fOutstandingSaveCount = 0; 155 fOutstandingSaveCount = 0;
156 }
156 157
157 // The setting of the draw filter has to go here (rather than in 158 // The setting of the draw filter has to go here (rather than in
158 // SkRasterWidget) due to the canvas restores this class performs. 159 // SkRasterWidget) due to the canvas restores this class performs.
159 // Since the draw filter is stored in the layer stack if we 160 // Since the draw filter is stored in the layer stack if we
160 // call setDrawFilter on anything but the root layer odd things happen 161 // call setDrawFilter on anything but the root layer odd things happen.
161 if (fOverdrawViz) { 162 if (fOverdrawViz) {
162 if (NULL == fOverdrawFilter) { 163 if (NULL == fOverdrawFilter) {
163 fOverdrawFilter = new OverdrawFilter; 164 fOverdrawFilter = new OverdrawFilter;
164 } 165 }
165 166
166 if (fOverdrawFilter != canvas->getDrawFilter()) { 167 if (fOverdrawFilter != canvas->getDrawFilter()) {
167 canvas->setDrawFilter(fOverdrawFilter); 168 canvas->setDrawFilter(fOverdrawFilter);
168 }
169 } else {
170 canvas->setDrawFilter(NULL);
171 } 169 }
170 } else {
171 canvas->setDrawFilter(NULL);
172 } 172 }
173 173
174 for (; i <= index; i++) { 174 for (; i <= index; i++) {
175 if (i == index && fFilter) { 175 if (i == index && fFilter) {
176 SkPaint p; 176 SkPaint p;
177 p.setColor(0xAAFFFFFF); 177 p.setColor(0xAAFFFFFF);
178 canvas->save(); 178 canvas->save();
179 canvas->resetMatrix(); 179 canvas->resetMatrix();
180 SkRect mask; 180 SkRect mask;
181 mask.set(SkIntToScalar(0), SkIntToScalar(0), 181 mask.set(SkIntToScalar(0), SkIntToScalar(0),
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 412
413 bool SkDebugCanvas::translate(SkScalar dx, SkScalar dy) { 413 bool SkDebugCanvas::translate(SkScalar dx, SkScalar dy) {
414 addDrawCommand(new SkTranslateCommand(dx, dy)); 414 addDrawCommand(new SkTranslateCommand(dx, dy));
415 return true; 415 return true;
416 } 416 }
417 417
418 void SkDebugCanvas::toggleCommand(int index, bool toggle) { 418 void SkDebugCanvas::toggleCommand(int index, bool toggle) {
419 SkASSERT(index < fCommandVector.count()); 419 SkASSERT(index < fCommandVector.count());
420 fCommandVector[index]->setVisible(toggle); 420 fCommandVector[index]->setVisible(toggle);
421 } 421 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698