| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_MAC_H_ | 5 #ifndef SKIA_EXT_PLATFORM_DEVICE_MAC_H_ |
| 6 #define SKIA_EXT_PLATFORM_DEVICE_MAC_H_ | 6 #define SKIA_EXT_PLATFORM_DEVICE_MAC_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "third_party/skia/include/core/SkDevice.h" | 9 #include "third_party/skia/include/core/SkDevice.h" |
| 10 | 10 |
| 11 typedef struct CGContext* CGContextRef; | 11 typedef struct CGContext* CGContextRef; |
| 12 typedef struct CGRect CGRect; | 12 typedef struct CGRect CGRect; |
| 13 | 13 |
| 14 class SkMatrix; | 14 class SkMatrix; |
| 15 class SkPath; | 15 class SkPath; |
| 16 class SkRegion; | 16 class SkRegion; |
| 17 | 17 |
| 18 namespace skia { | 18 namespace skia { |
| 19 | 19 |
| 20 // Returns the CGContext that backing the SkDevice. Forwards to the bound | 20 // Returns the CGContext that backing the SkDevice. Forwards to the bound |
| 21 // PlatformDevice. Returns NULL if no PlatformDevice is bound. | 21 // PlatformDevice. Returns NULL if no PlatformDevice is bound. |
| 22 CGContextRef GetBitmapContext(SkDevice* device); | 22 SK_API CGContextRef GetBitmapContext(SkDevice* device); |
| 23 | 23 |
| 24 // A device is basically a wrapper around SkBitmap that provides a surface for | 24 // A device is basically a wrapper around SkBitmap that provides a surface for |
| 25 // SkCanvas to draw into. Our device provides a surface CoreGraphics can also | 25 // SkCanvas to draw into. Our device provides a surface CoreGraphics can also |
| 26 // write to. It also provides functionality to play well with CG drawing | 26 // write to. It also provides functionality to play well with CG drawing |
| 27 // functions. | 27 // functions. |
| 28 // This class is abstract and must be subclassed. It provides the basic | 28 // This class is abstract and must be subclassed. It provides the basic |
| 29 // interface to implement it either with or without a bitmap backend. | 29 // interface to implement it either with or without a bitmap backend. |
| 30 class PlatformDevice : public SkDevice { | 30 class PlatformDevice : public SkDevice { |
| 31 public: | 31 public: |
| 32 typedef CGContextRef PlatformSurface; | 32 typedef CGContextRef PlatformSurface; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 | 71 |
| 72 // Loads the specified Skia transform into the device context | 72 // Loads the specified Skia transform into the device context |
| 73 static void LoadTransformToCGContext(CGContextRef context, | 73 static void LoadTransformToCGContext(CGContextRef context, |
| 74 const SkMatrix& matrix); | 74 const SkMatrix& matrix); |
| 75 }; | 75 }; |
| 76 | 76 |
| 77 } // namespace skia | 77 } // namespace skia |
| 78 | 78 |
| 79 #endif // SKIA_EXT_PLATFORM_DEVICE_MAC_H_ | 79 #endif // SKIA_EXT_PLATFORM_DEVICE_MAC_H_ |
| 80 | 80 |
| OLD | NEW |