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_LINUX_H_ | 5 #ifndef SKIA_EXT_PLATFORM_DEVICE_LINUX_H_ |
6 #define SKIA_EXT_PLATFORM_DEVICE_LINUX_H_ | 6 #define SKIA_EXT_PLATFORM_DEVICE_LINUX_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 _cairo cairo_t; | 11 typedef struct _cairo cairo_t; |
12 | 12 |
13 namespace skia { | 13 namespace skia { |
14 | 14 |
15 // Blindly copying the mac hierarchy. | 15 // Blindly copying the mac hierarchy. |
16 class PlatformDevice : public SkDevice { | 16 class PlatformDevice : public SkDevice { |
17 public: | 17 public: |
18 typedef cairo_t* PlatformSurface; | 18 typedef cairo_t* PlatformSurface; |
19 | 19 |
20 // Returns if the preferred rendering engine is vectorial or bitmap based. | 20 // Returns if the preferred rendering engine is vectorial or bitmap based. |
21 virtual bool IsVectorial() = 0; | 21 virtual bool IsVectorial() = 0; |
22 | 22 |
23 // Returns if native platform APIs are allowed to render text to this device. | 23 // Returns if native platform APIs are allowed to render text to this device. |
24 virtual bool IsNativeFontRenderingAllowed(); | 24 virtual bool IsNativeFontRenderingAllowed(); |
25 | 25 |
26 virtual PlatformSurface beginPlatformPaint() = 0; | 26 virtual PlatformSurface BeginPlatformPaint() = 0; |
| 27 virtual void EndPlatformPaint(); |
27 | 28 |
28 protected: | 29 protected: |
29 // Forwards |bitmap| to SkDevice's constructor. | 30 // Forwards |bitmap| to SkDevice's constructor. |
30 explicit PlatformDevice(const SkBitmap& bitmap); | 31 explicit PlatformDevice(const SkBitmap& bitmap); |
31 }; | 32 }; |
32 | 33 |
33 } // namespace skia | 34 } // namespace skia |
34 | 35 |
35 #endif // SKIA_EXT_PLATFORM_DEVICE_LINUX_H_ | 36 #endif // SKIA_EXT_PLATFORM_DEVICE_LINUX_H_ |
OLD | NEW |