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 SKIA_EXT_PLATFORM_DEVICE_H_ | 5 #ifndef SKIA_EXT_PLATFORM_DEVICE_H_ |
6 #define SKIA_EXT_PLATFORM_DEVICE_H_ | 6 #define SKIA_EXT_PLATFORM_DEVICE_H_ |
7 | 7 |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 | 9 |
10 #if defined(OS_WIN) | 10 #if defined(OS_WIN) |
11 #include <windows.h> | 11 #include <windows.h> |
12 #include <vector> | 12 #include <vector> |
13 #endif | 13 #endif |
14 | 14 |
15 #include "third_party/skia/include/core/SkColor.h" | 15 #include "third_party/skia/include/core/SkColor.h" |
16 #include "third_party/skia/include/core/SkBitmapDevice.h" | 16 #include "third_party/skia/include/core/SkBitmapDevice.h" |
17 #include "third_party/skia/include/core/SkPreConfig.h" | 17 #include "third_party/skia/include/core/SkPreConfig.h" |
18 | 18 |
19 class SkMatrix; | 19 class SkMatrix; |
20 class SkMetaData; | 20 class SkMetaData; |
21 class SkPath; | 21 class SkPath; |
22 class SkRegion; | 22 class SkRegion; |
23 | 23 |
24 #if defined(OS_LINUX) || defined(OS_OPENBSD) || defined(OS_FREEBSD) \ | 24 #if defined(USE_CAIRO) |
25 || defined(OS_SOLARIS) | |
26 typedef struct _cairo cairo_t; | 25 typedef struct _cairo cairo_t; |
27 typedef struct _cairo_rectangle cairo_rectangle_t; | 26 typedef struct _cairo_rectangle cairo_rectangle_t; |
28 #elif defined(OS_MACOSX) | 27 #elif defined(OS_MACOSX) |
29 typedef struct CGContext* CGContextRef; | 28 typedef struct CGContext* CGContextRef; |
30 typedef struct CGRect CGRect; | 29 typedef struct CGRect CGRect; |
31 #endif | 30 #endif |
32 | 31 |
33 namespace skia { | 32 namespace skia { |
34 | 33 |
35 class PlatformDevice; | 34 class PlatformDevice; |
36 | 35 |
37 #if defined(OS_WIN) | 36 #if defined(OS_WIN) |
38 typedef HDC PlatformSurface; | 37 typedef HDC PlatformSurface; |
39 typedef RECT PlatformRect; | 38 typedef RECT PlatformRect; |
40 #elif defined(ANDROID) | 39 #elif defined(USE_CAIRO) |
41 typedef void* PlatformSurface; | |
42 typedef SkIRect* PlatformRect; | |
43 #elif defined(OS_LINUX) || defined(OS_OPENBSD) || defined(OS_FREEBSD) \ | |
44 || defined(OS_SOLARIS) | |
45 typedef cairo_t* PlatformSurface; | 40 typedef cairo_t* PlatformSurface; |
46 typedef cairo_rectangle_t PlatformRect; | 41 typedef cairo_rectangle_t PlatformRect; |
47 #elif defined(OS_MACOSX) | 42 #elif defined(OS_MACOSX) |
48 typedef CGContextRef PlatformSurface; | 43 typedef CGContextRef PlatformSurface; |
49 typedef CGRect PlatformRect; | 44 typedef CGRect PlatformRect; |
| 45 #else |
| 46 typedef void* PlatformSurface; |
| 47 typedef SkIRect* PlatformRect; |
50 #endif | 48 #endif |
51 | 49 |
52 // The following routines provide accessor points for the functionality | 50 // The following routines provide accessor points for the functionality |
53 // exported by the various PlatformDevice ports. | 51 // exported by the various PlatformDevice ports. |
54 // All calls to PlatformDevice::* should be routed through these | 52 // All calls to PlatformDevice::* should be routed through these |
55 // helper functions. | 53 // helper functions. |
56 | 54 |
57 // Bind a PlatformDevice instance, |platform_device| to |device|. Subsequent | 55 // Bind a PlatformDevice instance, |platform_device| to |device|. Subsequent |
58 // calls to the functions exported below will forward the request to the | 56 // calls to the functions exported below will forward the request to the |
59 // corresponding method on the bound PlatformDevice instance. If no | 57 // corresponding method on the bound PlatformDevice instance. If no |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 #elif defined(OS_MACOSX) | 164 #elif defined(OS_MACOSX) |
167 // Loads the specified Skia transform into the device context | 165 // Loads the specified Skia transform into the device context |
168 static void LoadTransformToCGContext(CGContextRef context, | 166 static void LoadTransformToCGContext(CGContextRef context, |
169 const SkMatrix& matrix); | 167 const SkMatrix& matrix); |
170 #endif | 168 #endif |
171 }; | 169 }; |
172 | 170 |
173 } // namespace skia | 171 } // namespace skia |
174 | 172 |
175 #endif // SKIA_EXT_PLATFORM_DEVICE_H_ | 173 #endif // SKIA_EXT_PLATFORM_DEVICE_H_ |
OLD | NEW |