Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / ui / gfx / path.h
blobb0f07279c7fd8816c50caf74a5b82b55be713b52
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
3 // found in the LICENSE file.
5 #ifndef UI_GFX_PATH_H_
6 #define UI_GFX_PATH_H_
8 #include "base/basictypes.h"
9 #include "third_party/skia/include/core/SkPath.h"
10 #include "ui/gfx/gfx_export.h"
11 #include "ui/gfx/native_widget_types.h"
13 namespace gfx {
15 class GFX_EXPORT Path : public SkPath {
16 public:
17 // Used by Path(Point,size_t) constructor.
18 struct Point {
19 int x;
20 int y;
22 struct PointF {
23 float x;
24 float y;
27 Path();
29 // Creates a path populated with the specified points.
30 Path(const Point* points, size_t count);
31 Path(const PointF* points, size_t count);
33 ~Path();
35 #if defined(USE_AURA) || defined(USE_X11)
36 // Creates a NativeRegion from the path. The caller is responsible for freeing
37 // resources used by this region. This only supports polygon paths.
38 NativeRegion CreateNativeRegion() const;
40 // Returns the intersection of the two regions. The caller owns the returned
41 // object.
42 static gfx::NativeRegion IntersectRegions(gfx::NativeRegion r1,
43 gfx::NativeRegion r2);
45 // Returns the union of the two regions. The caller owns the returned object.
46 static gfx::NativeRegion CombineRegions(gfx::NativeRegion r1,
47 gfx::NativeRegion r2);
49 // Returns the difference of the two regions. The caller owns the returned
50 // object.
51 static gfx::NativeRegion SubtractRegion(gfx::NativeRegion r1,
52 gfx::NativeRegion r2);
53 #endif
55 private:
56 DISALLOW_COPY_AND_ASSIGN(Path);
61 #endif // UI_GFX_PATH_H_