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 "skia/ext/platform_device.h" |
9 #include "third_party/skia/include/core/SkDevice.h" | 10 #include "third_party/skia/include/core/SkDevice.h" |
10 | 11 |
11 typedef struct _cairo cairo_t; | |
12 | |
13 namespace skia { | 12 namespace skia { |
14 | 13 |
15 // Blindly copying the mac hierarchy. | 14 // Blindly copying the mac hierarchy. |
16 class PlatformDevice : public SkDevice { | 15 class PlatformDevice : public SkDevice { |
17 public: | 16 public: |
18 typedef cairo_t* PlatformSurface; | 17 typedef cairo_t* PlatformSurface; |
19 | 18 |
20 // Returns if the preferred rendering engine is vectorial or bitmap based. | 19 // Returns if the preferred rendering engine is vectorial or bitmap based. |
21 virtual bool IsVectorial() = 0; | 20 virtual bool IsVectorial() = 0; |
22 | 21 |
23 // Returns if native platform APIs are allowed to render text to this device. | 22 // Returns if native platform APIs are allowed to render text to this device. |
24 virtual bool IsNativeFontRenderingAllowed(); | 23 virtual bool IsNativeFontRenderingAllowed(); |
25 | 24 |
26 virtual PlatformSurface BeginPlatformPaint() = 0; | 25 virtual PlatformSurface BeginPlatformPaint() = 0; |
27 virtual void EndPlatformPaint(); | 26 virtual void EndPlatformPaint(); |
28 | 27 |
| 28 virtual void DrawToNativeContext(PlatformSurface surface, int x, int y, |
| 29 const PlatformRect* src_rect ); |
| 30 |
| 31 // Sets the opacity of each pixel in the specified region to be opaque. |
| 32 virtual void MakeOpaque(int x, int y, int width, int height) { } |
| 33 |
29 protected: | 34 protected: |
30 // Forwards |bitmap| to SkDevice's constructor. | 35 // Forwards |bitmap| to SkDevice's constructor. |
31 explicit PlatformDevice(const SkBitmap& bitmap); | 36 explicit PlatformDevice(const SkBitmap& bitmap); |
32 }; | 37 }; |
33 | 38 |
34 } // namespace skia | 39 } // namespace skia |
35 | 40 |
36 #endif // SKIA_EXT_PLATFORM_DEVICE_LINUX_H_ | 41 #endif // SKIA_EXT_PLATFORM_DEVICE_LINUX_H_ |
OLD | NEW |