| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 UI_GFX_PATH_H_ | 5 #ifndef UI_GFX_PATH_H_ |
| 6 #define UI_GFX_PATH_H_ | 6 #define UI_GFX_PATH_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "third_party/skia/include/core/SkPath.h" | 10 #include "third_party/skia/include/core/SkPath.h" |
| 11 #include "ui/base/ui_export.h" | 11 #include "ui/base/ui_export.h" |
| 12 #include "ui/gfx/native_widget_types.h" | 12 #include "ui/gfx/native_widget_types.h" |
| 13 | 13 |
| 14 namespace gfx { | 14 namespace gfx { |
| 15 | 15 |
| 16 class UI_EXPORT Path : public SkPath { | 16 class UI_EXPORT Path : public SkPath { |
| 17 public: | 17 public: |
| 18 // Used by Path(Point,size_t) constructor. | 18 // Used by Path(Point,size_t) constructor. |
| 19 struct Point { | 19 struct Point { |
| 20 int x; | 20 int x; |
| 21 int y; | 21 int y; |
| 22 }; | 22 }; |
| 23 #if defined(ENABLE_DIP) | |
| 24 struct PointF { | 23 struct PointF { |
| 25 float x; | 24 float x; |
| 26 float y; | 25 float y; |
| 27 }; | 26 }; |
| 28 #endif | |
| 29 | 27 |
| 30 Path(); | 28 Path(); |
| 31 | 29 |
| 32 // Creates a path populated with the specified points. | 30 // Creates a path populated with the specified points. |
| 33 Path(const Point* points, size_t count); | 31 Path(const Point* points, size_t count); |
| 34 #if defined(ENABLE_DIP) | |
| 35 Path(const PointF* points, size_t count); | 32 Path(const PointF* points, size_t count); |
| 36 #endif | |
| 37 | 33 |
| 38 ~Path(); | 34 ~Path(); |
| 39 | 35 |
| 40 #if defined(USE_AURA) || defined(OS_WIN) || defined(USE_X11) | 36 #if defined(USE_AURA) || defined(OS_WIN) || defined(USE_X11) |
| 41 // Creates a NativeRegion from the path. The caller is responsible for freeing | 37 // Creates a NativeRegion from the path. The caller is responsible for freeing |
| 42 // resources used by this region. This only supports polygon paths. | 38 // resources used by this region. This only supports polygon paths. |
| 43 NativeRegion CreateNativeRegion() const; | 39 NativeRegion CreateNativeRegion() const; |
| 44 | 40 |
| 45 // Returns the intersection of the two regions. The caller owns the returned | 41 // Returns the intersection of the two regions. The caller owns the returned |
| 46 // object. | 42 // object. |
| (...skipping 10 matching lines...) Expand all Loading... |
| 57 gfx::NativeRegion r2); | 53 gfx::NativeRegion r2); |
| 58 #endif | 54 #endif |
| 59 | 55 |
| 60 private: | 56 private: |
| 61 DISALLOW_COPY_AND_ASSIGN(Path); | 57 DISALLOW_COPY_AND_ASSIGN(Path); |
| 62 }; | 58 }; |
| 63 | 59 |
| 64 } | 60 } |
| 65 | 61 |
| 66 #endif // UI_GFX_PATH_H_ | 62 #endif // UI_GFX_PATH_H_ |
| OLD | NEW |