| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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) |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 typedef struct CGRect CGRect; | 30 typedef struct CGRect CGRect; |
| 31 #endif | 31 #endif |
| 32 | 32 |
| 33 namespace skia { | 33 namespace skia { |
| 34 | 34 |
| 35 class PlatformDevice; | 35 class PlatformDevice; |
| 36 | 36 |
| 37 #if defined(OS_WIN) | 37 #if defined(OS_WIN) |
| 38 typedef HDC PlatformSurface; | 38 typedef HDC PlatformSurface; |
| 39 typedef RECT PlatformRect; | 39 typedef RECT PlatformRect; |
| 40 #elif defined(ANDROID) |
| 41 typedef void* PlatformSurface; |
| 42 typedef SkIRect* PlatformRect; |
| 40 #elif defined(OS_LINUX) || defined(OS_OPENBSD) || defined(OS_FREEBSD) \ | 43 #elif defined(OS_LINUX) || defined(OS_OPENBSD) || defined(OS_FREEBSD) \ |
| 41 || defined(OS_SUN) | 44 || defined(OS_SUN) |
| 42 typedef cairo_t* PlatformSurface; | 45 typedef cairo_t* PlatformSurface; |
| 43 typedef cairo_rectangle_t PlatformRect; | 46 typedef cairo_rectangle_t PlatformRect; |
| 44 #elif defined(OS_MACOSX) | 47 #elif defined(OS_MACOSX) |
| 45 typedef CGContextRef PlatformSurface; | 48 typedef CGContextRef PlatformSurface; |
| 46 typedef CGRect PlatformRect; | 49 typedef CGRect PlatformRect; |
| 47 #elif defined(ANDROID) | |
| 48 // TODO(tonyg): FIX TYPES! | |
| 49 typedef void* PlatformSurface; | |
| 50 typedef void* PlatformRect; | |
| 51 #endif | 50 #endif |
| 52 | 51 |
| 53 // The following routines provide accessor points for the functionality | 52 // The following routines provide accessor points for the functionality |
| 54 // exported by the various PlatformDevice ports. The PlatformDevice, and | 53 // exported by the various PlatformDevice ports. The PlatformDevice, and |
| 55 // BitmapPlatformDevice classes inherit directly from SkDevice, which is no | 54 // BitmapPlatformDevice classes inherit directly from SkDevice, which is no |
| 56 // longer a supported usage-pattern for skia. In preparation of the removal of | 55 // longer a supported usage-pattern for skia. In preparation of the removal of |
| 57 // these classes, all calls to PlatformDevice::* should be routed through these | 56 // these classes, all calls to PlatformDevice::* should be routed through these |
| 58 // helper functions. | 57 // helper functions. |
| 59 | 58 |
| 60 // Bind a PlatformDevice instance, |platform_device| to |device|. Subsequent | 59 // Bind a PlatformDevice instance, |platform_device| to |device|. Subsequent |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 #elif defined(OS_MACOSX) | 169 #elif defined(OS_MACOSX) |
| 171 // Loads the specified Skia transform into the device context | 170 // Loads the specified Skia transform into the device context |
| 172 static void LoadTransformToCGContext(CGContextRef context, | 171 static void LoadTransformToCGContext(CGContextRef context, |
| 173 const SkMatrix& matrix); | 172 const SkMatrix& matrix); |
| 174 #endif | 173 #endif |
| 175 }; | 174 }; |
| 176 | 175 |
| 177 } // namespace skia | 176 } // namespace skia |
| 178 | 177 |
| 179 #endif // SKIA_EXT_PLATFORM_DEVICE_H_ | 178 #endif // SKIA_EXT_PLATFORM_DEVICE_H_ |
| OLD | NEW |