summaryrefslogtreecommitdiffstats
path: root/app/gfx/path.h
blob: 8062e34786d0a9473a701746461e6d6e7ff5fd62 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef APP_GFX_PATH_H_
#define APP_GFX_PATH_H_

#include "base/basictypes.h"

#if defined(OS_WIN)
#include <windows.h>
#elif defined(OS_LINUX)
typedef struct _GdkRegion GdkRegion;
#endif

#include "third_party/skia/include/core/SkPath.h"

namespace gfx {

class Path : public SkPath {
 public:
  Path() : SkPath() { moveTo(0, 0); }

#if defined(OS_WIN)
  // Creates a HRGN from the path. The caller is responsible for freeing
  // resources used by this region.  This only supports polygon paths.
  HRGN CreateHRGN() const;
#elif defined(OS_LINUX)
  // Creates a Gdkregion from the path. The caller is responsible for freeing
  // resources used by this region.  This only supports polygon paths.
  // WARNING: this returns NULL for an empty Path.
  GdkRegion* CreateGdkRegion() const;
#endif

 private:
  DISALLOW_COPY_AND_ASSIGN(Path);
};

}

#endif  // #ifndef APP_GFX_PATH_H_