| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #ifndef GFX_PATH_H_ | 5 #ifndef GFX_PATH_H_ |
| 6 #define GFX_PATH_H_ | 6 #define GFX_PATH_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "ui/gfx/path.h" |
| 10 #include "gfx/native_widget_types.h" | 10 // TODO(sail): remove this file once all includes have been updated. |
| 11 | |
| 12 #include "third_party/skia/include/core/SkPath.h" | |
| 13 | |
| 14 namespace gfx { | |
| 15 | |
| 16 class Path : public SkPath { | |
| 17 public: | |
| 18 // Used by Path(Point,size_t) constructor. | |
| 19 struct Point { | |
| 20 int x; | |
| 21 int y; | |
| 22 }; | |
| 23 | |
| 24 Path(); | |
| 25 | |
| 26 // Creates a path populated with the specified points. | |
| 27 Path(const Point* points, size_t count); | |
| 28 | |
| 29 ~Path(); | |
| 30 | |
| 31 #if defined(OS_WIN) || defined(USE_X11) | |
| 32 // Creates a NativeRegion from the path. The caller is responsible for freeing | |
| 33 // resources used by this region. This only supports polygon paths. | |
| 34 NativeRegion CreateNativeRegion() const; | |
| 35 | |
| 36 // Returns the intersection of the two regions. The caller owns the returned | |
| 37 // object. | |
| 38 static gfx::NativeRegion IntersectRegions(gfx::NativeRegion r1, | |
| 39 gfx::NativeRegion r2); | |
| 40 | |
| 41 // Returns the union of the two regions. The caller owns the returned object. | |
| 42 static gfx::NativeRegion CombineRegions(gfx::NativeRegion r1, | |
| 43 gfx::NativeRegion r2); | |
| 44 | |
| 45 // Returns the difference of the two regions. The caller owns the returned | |
| 46 // object. | |
| 47 static gfx::NativeRegion SubtractRegion(gfx::NativeRegion r1, | |
| 48 gfx::NativeRegion r2); | |
| 49 #endif | |
| 50 | |
| 51 private: | |
| 52 DISALLOW_COPY_AND_ASSIGN(Path); | |
| 53 }; | |
| 54 | |
| 55 } | |
| 56 | 11 |
| 57 #endif // GFX_PATH_H_ | 12 #endif // GFX_PATH_H_ |
| OLD | NEW |