Chromium Code Reviews| 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 | 9 |
| 10 #include "SkColorPriv.h" | 10 #include "SkColorPriv.h" |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 28 , fTexOverrideFilter(NULL) | 28 , fTexOverrideFilter(NULL) |
| 29 , fOutstandingSaveCount(0) { | 29 , fOutstandingSaveCount(0) { |
| 30 // TODO(chudy): Free up memory from all draw commands in destructor. | 30 // TODO(chudy): Free up memory from all draw commands in destructor. |
| 31 fWidth = width; | 31 fWidth = width; |
| 32 fHeight = height; | 32 fHeight = height; |
| 33 // do we need fBm anywhere? | 33 // do we need fBm anywhere? |
| 34 fBm.setConfig(SkBitmap::kNo_Config, fWidth, fHeight); | 34 fBm.setConfig(SkBitmap::kNo_Config, fWidth, fHeight); |
| 35 fFilter = false; | 35 fFilter = false; |
| 36 fIndex = 0; | 36 fIndex = 0; |
| 37 fUserMatrix.reset(); | 37 fUserMatrix.reset(); |
| 38 | |
| 39 // SkPicturePlayback uses the base-class' quickReject calls to cull clipped | |
| 40 // operations. This can lead to problems in the debugger which expects all | |
| 41 // the operations in the captured skp to appear in the debug canvas. To | |
| 42 // circumvent this we create a wide open clip here (an empty clip rect | |
| 43 // is not sufficient). | |
| 44 SkIRect largeIRect = SkIRect::MakeLargest(); | |
| 45 largeIRect.inset(100, 100); | |
|
Justin Novosad
2013/11/06 18:01:55
Why the inset?
robertphillips
2013/11/06 18:59:15
The SkRect is converted to an SkIRect internally a
| |
| 46 SkRect large = SkRect::MakeFromIRect(largeIRect); | |
| 47 INHERITED::clipRect(large, SkRegion::kReplace_Op, false); | |
| 38 } | 48 } |
| 39 | 49 |
| 40 SkDebugCanvas::~SkDebugCanvas() { | 50 SkDebugCanvas::~SkDebugCanvas() { |
| 41 fCommandVector.deleteAll(); | 51 fCommandVector.deleteAll(); |
| 42 SkSafeUnref(fOverdrawFilter); | 52 SkSafeUnref(fOverdrawFilter); |
| 43 } | 53 } |
| 44 | 54 |
| 45 void SkDebugCanvas::addDrawCommand(SkDrawCommand* command) { | 55 void SkDebugCanvas::addDrawCommand(SkDrawCommand* command) { |
| 46 fCommandVector.push(command); | 56 fCommandVector.push(command); |
| 47 } | 57 } |
| (...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 456 | 466 |
| 457 bool SkDebugCanvas::translate(SkScalar dx, SkScalar dy) { | 467 bool SkDebugCanvas::translate(SkScalar dx, SkScalar dy) { |
| 458 addDrawCommand(new SkTranslateCommand(dx, dy)); | 468 addDrawCommand(new SkTranslateCommand(dx, dy)); |
| 459 return true; | 469 return true; |
| 460 } | 470 } |
| 461 | 471 |
| 462 void SkDebugCanvas::toggleCommand(int index, bool toggle) { | 472 void SkDebugCanvas::toggleCommand(int index, bool toggle) { |
| 463 SkASSERT(index < fCommandVector.count()); | 473 SkASSERT(index < fCommandVector.count()); |
| 464 fCommandVector[index]->setVisible(toggle); | 474 fCommandVector[index]->setVisible(toggle); |
| 465 } | 475 } |
| OLD | NEW |