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

Side by Side Diff: src/pathops/SkPathOpsTightBounds.cpp

Issue 1033803002: Revert of fix destructor order to fix build (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 9 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 | « src/pathops/SkPathOpsSimplify.cpp ('k') | tests/PathOpsAngleTest.cpp » ('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 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 #include "SkOpEdgeBuilder.h" 7 #include "SkOpEdgeBuilder.h"
8 #include "SkPathOpsCommon.h" 8 #include "SkPathOpsCommon.h"
9 9
10 bool TightBounds(const SkPath& path, SkRect* result) { 10 bool TightBounds(const SkPath& path, SkRect* result) {
11 SkChunkAlloc allocator(4096); // FIXME: constant-ize, tune
12 SkOpContour contour; 11 SkOpContour contour;
13 SkOpGlobalState globalState( NULL PATH_OPS_DEBUG_PARAMS(&contour)); 12 SkOpGlobalState globalState( NULL PATH_OPS_DEBUG_PARAMS(&contour));
14 // turn path into list of segments 13 // turn path into list of segments
14 SkChunkAlloc allocator(4096); // FIXME: constant-ize, tune
15 SkOpEdgeBuilder builder(path, &contour, &allocator, &globalState); 15 SkOpEdgeBuilder builder(path, &contour, &allocator, &globalState);
16 if (!builder.finish(&allocator)) { 16 if (!builder.finish(&allocator)) {
17 return false; 17 return false;
18 } 18 }
19 SkTDArray<SkOpContour* > contourList; 19 SkTDArray<SkOpContour* > contourList;
20 MakeContourList(&contour, contourList, false, false); 20 MakeContourList(&contour, contourList, false, false);
21 SkOpContour** currentPtr = contourList.begin(); 21 SkOpContour** currentPtr = contourList.begin();
22 result->setEmpty(); 22 result->setEmpty();
23 if (!currentPtr) { 23 if (!currentPtr) {
24 return true; 24 return true;
25 } 25 }
26 SkOpContour** listEnd = contourList.end(); 26 SkOpContour** listEnd = contourList.end();
27 SkOpContour* current = *currentPtr++; 27 SkOpContour* current = *currentPtr++;
28 SkPathOpsBounds bounds = current->bounds(); 28 SkPathOpsBounds bounds = current->bounds();
29 while (currentPtr != listEnd) { 29 while (currentPtr != listEnd) {
30 current = *currentPtr++; 30 current = *currentPtr++;
31 bounds.add(current->bounds()); 31 bounds.add(current->bounds());
32 } 32 }
33 *result = bounds; 33 *result = bounds;
34 return true; 34 return true;
35 } 35 }
OLDNEW
« no previous file with comments | « src/pathops/SkPathOpsSimplify.cpp ('k') | tests/PathOpsAngleTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698