| 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 24 matching lines...) Expand all Loading... |
| 35 // circumvent this we create a wide open clip here (an empty clip rect | 35 // circumvent this we create a wide open clip here (an empty clip rect |
| 36 // is not sufficient). | 36 // is not sufficient). |
| 37 // Internally, the SkRect passed to clipRect is converted to an SkIRect and | 37 // Internally, the SkRect passed to clipRect is converted to an SkIRect and |
| 38 // rounded out. The following code creates a nearly maximal rect that will | 38 // rounded out. The following code creates a nearly maximal rect that will |
| 39 // not get collapsed by the coming conversions (Due to precision loss the | 39 // not get collapsed by the coming conversions (Due to precision loss the |
| 40 // inset has to be surprisingly large). | 40 // inset has to be surprisingly large). |
| 41 SkIRect largeIRect = SkIRect::MakeLargest(); | 41 SkIRect largeIRect = SkIRect::MakeLargest(); |
| 42 largeIRect.inset(1024, 1024); | 42 largeIRect.inset(1024, 1024); |
| 43 SkRect large = SkRect::Make(largeIRect); | 43 SkRect large = SkRect::Make(largeIRect); |
| 44 #ifdef SK_DEBUG | 44 #ifdef SK_DEBUG |
| 45 large.roundOut(&largeIRect); | 45 SkASSERT(!large.roundOut().isEmpty()); |
| 46 SkASSERT(!largeIRect.isEmpty()); | |
| 47 #endif | 46 #endif |
| 48 // call the base class' version to avoid adding a draw command | 47 // call the base class' version to avoid adding a draw command |
| 49 this->INHERITED::onClipRect(large, SkRegion::kReplace_Op, kHard_ClipEdgeStyl
e); | 48 this->INHERITED::onClipRect(large, SkRegion::kReplace_Op, kHard_ClipEdgeStyl
e); |
| 50 } | 49 } |
| 51 | 50 |
| 52 SkDebugCanvas::~SkDebugCanvas() { | 51 SkDebugCanvas::~SkDebugCanvas() { |
| 53 fCommandVector.deleteAll(); | 52 fCommandVector.deleteAll(); |
| 54 SkSafeUnref(fOverdrawFilter); | 53 SkSafeUnref(fOverdrawFilter); |
| 55 SkSafeUnref(fTexOverrideFilter); | 54 SkSafeUnref(fTexOverrideFilter); |
| 56 } | 55 } |
| (...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 733 } | 732 } |
| 734 | 733 |
| 735 bool SkDebugCanvas::lastClipStackData(const SkPath& devPath) { | 734 bool SkDebugCanvas::lastClipStackData(const SkPath& devPath) { |
| 736 if (fCalledAddStackData) { | 735 if (fCalledAddStackData) { |
| 737 fClipStackData.appendf("<br>"); | 736 fClipStackData.appendf("<br>"); |
| 738 addPathData(devPath, "pathOut"); | 737 addPathData(devPath, "pathOut"); |
| 739 return true; | 738 return true; |
| 740 } | 739 } |
| 741 return false; | 740 return false; |
| 742 } | 741 } |
| OLD | NEW |