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

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

Issue 742663002: add roundOut that returns its result (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 1 month 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 | « src/effects/SkTileImageFilter.cpp ('k') | 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 24 matching lines...) Expand all
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
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 }
OLDNEW
« no previous file with comments | « src/effects/SkTileImageFilter.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698