diff options
Diffstat (limited to 'src/core/SkRegion_path.cpp')
-rw-r--r-- | src/core/SkRegion_path.cpp | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/src/core/SkRegion_path.cpp b/src/core/SkRegion_path.cpp index d00baf9..345ecf8 100644 --- a/src/core/SkRegion_path.cpp +++ b/src/core/SkRegion_path.cpp @@ -1,19 +1,11 @@ -/* libs/graphics/sgl/SkRegion_path.cpp -** -** Copyright 2006, The Android Open Source Project -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -*/ + +/* + * Copyright 2006 The Android Open Source Project + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + #include "SkRegionPriv.h" #include "SkBlitter.h" @@ -430,6 +422,10 @@ static int EdgeProc(const Edge* a, const Edge* b) { } bool SkRegion::getBoundaryPath(SkPath* path) const { + // path could safely be NULL if we're empty, but the caller shouldn't + // *know* that + SkASSERT(path); + if (this->isEmpty()) { return false; } @@ -451,7 +447,8 @@ bool SkRegion::getBoundaryPath(SkPath* path) const { edge[0].set(r.fLeft, r.fBottom, r.fTop); edge[1].set(r.fRight, r.fTop, r.fBottom); } - SkQSort(edges.begin(), edges.count(), sizeof(Edge), (SkQSortCompareProc)EdgeProc); + SkQSort(edges.begin(), edges.count(), sizeof(Edge), + (SkQSortCompareProc)EdgeProc); int count = edges.count(); Edge* start = edges.begin(); |