| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/gfx/path.h" | 5 #include "ui/gfx/path.h" |
| 6 | 6 |
| 7 #include "base/memory/scoped_ptr.h" |
| 7 #include "third_party/skia/include/core/SkRegion.h" | 8 #include "third_party/skia/include/core/SkRegion.h" |
| 8 | 9 |
| 9 namespace gfx { | 10 namespace gfx { |
| 10 | 11 |
| 11 SkRegion* Path::CreateNativeRegion() const { | 12 SkRegion* Path::CreateNativeRegion() const { |
| 12 return new SkRegion; | 13 SkRegion* region = new SkRegion; |
| 14 region->setPath(*this, *region); |
| 15 return region; |
| 13 } | 16 } |
| 14 | 17 |
| 15 // static | 18 // static |
| 16 NativeRegion Path::IntersectRegions(NativeRegion r1, NativeRegion r2) { | 19 NativeRegion Path::IntersectRegions(NativeRegion r1, NativeRegion r2) { |
| 17 SkRegion* new_region = new SkRegion; | 20 SkRegion* new_region = new SkRegion; |
| 18 new_region->op(*r1, *r2, SkRegion::kIntersect_Op); | 21 new_region->op(*r1, *r2, SkRegion::kIntersect_Op); |
| 19 return new_region; | 22 return new_region; |
| 20 } | 23 } |
| 21 | 24 |
| 22 // static | 25 // static |
| 23 NativeRegion Path::CombineRegions(NativeRegion r1, NativeRegion r2) { | 26 NativeRegion Path::CombineRegions(NativeRegion r1, NativeRegion r2) { |
| 24 SkRegion* new_region = new SkRegion; | 27 SkRegion* new_region = new SkRegion; |
| 25 new_region->op(*r1, *r2, SkRegion::kUnion_Op); | 28 new_region->op(*r1, *r2, SkRegion::kUnion_Op); |
| 26 return new_region; | 29 return new_region; |
| 27 } | 30 } |
| 28 | 31 |
| 29 // static | 32 // static |
| 30 NativeRegion Path::SubtractRegion(NativeRegion r1, NativeRegion r2) { | 33 NativeRegion Path::SubtractRegion(NativeRegion r1, NativeRegion r2) { |
| 31 SkRegion* new_region = new SkRegion; | 34 SkRegion* new_region = new SkRegion; |
| 32 new_region->op(*r1, *r2, SkRegion::kDifference_Op); | 35 new_region->op(*r1, *r2, SkRegion::kDifference_Op); |
| 33 return new_region; | 36 return new_region; |
| 34 } | 37 } |
| 35 | 38 |
| 36 } // namespace gfx | 39 } // namespace gfx |
| OLD | NEW |