OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_BITMAP_PLATFORM_DEVICE_LINUX_H_ | 5 #ifndef SKIA_EXT_BITMAP_PLATFORM_DEVICE_LINUX_H_ |
6 #define SKIA_EXT_BITMAP_PLATFORM_DEVICE_LINUX_H_ | 6 #define SKIA_EXT_BITMAP_PLATFORM_DEVICE_LINUX_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/ref_counted.h" | 9 #include "base/ref_counted.h" |
10 #include "skia/ext/platform_device_linux.h" | 10 #include "skia/ext/platform_device_linux.h" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 // the Windows and Mac versions of this class do. | 78 // the Windows and Mac versions of this class do. |
79 // | 79 // |
80 // This object takes ownership of @data. | 80 // This object takes ownership of @data. |
81 BitmapPlatformDevice(const SkBitmap& other, BitmapPlatformDeviceData* data); | 81 BitmapPlatformDevice(const SkBitmap& other, BitmapPlatformDeviceData* data); |
82 virtual ~BitmapPlatformDevice(); | 82 virtual ~BitmapPlatformDevice(); |
83 BitmapPlatformDevice& operator=(const BitmapPlatformDevice& other); | 83 BitmapPlatformDevice& operator=(const BitmapPlatformDevice& other); |
84 | 84 |
85 // A stub copy constructor. Needs to be properly implemented. | 85 // A stub copy constructor. Needs to be properly implemented. |
86 BitmapPlatformDevice(const BitmapPlatformDevice& other); | 86 BitmapPlatformDevice(const BitmapPlatformDevice& other); |
87 | 87 |
88 virtual SkDeviceFactory* getDeviceFactory() { | 88 virtual SkDeviceFactory* getDeviceFactory(); |
89 return SkNEW(BitmapPlatformDeviceFactory); | |
90 } | |
91 | 89 |
92 virtual void makeOpaque(int x, int y, int width, int height); | 90 virtual void makeOpaque(int x, int y, int width, int height); |
93 | 91 |
94 // Bitmaps aren't vector graphics. | 92 // Bitmaps aren't vector graphics. |
95 virtual bool IsVectorial() { return false; } | 93 virtual bool IsVectorial(); |
96 | 94 |
97 // If someone wants to paint on a Cairo surface version of our | 95 // If someone wants to paint on a Cairo surface version of our |
98 // buffer, then give them the surface we're already using. | 96 // buffer, then give them the surface we're already using. |
99 virtual cairo_t* beginPlatformPaint(); | 97 virtual cairo_t* beginPlatformPaint(); |
100 | 98 |
101 // Loads the given transform and clipping region into the HDC. This is | 99 // Loads the given transform and clipping region into the HDC. This is |
102 // overridden from SkDevice. | 100 // overridden from SkDevice. |
103 virtual void setMatrixClip(const SkMatrix& transform, const SkRegion& region); | 101 virtual void setMatrixClip(const SkMatrix& transform, const SkRegion& region); |
104 | 102 |
105 private: | 103 private: |
106 static BitmapPlatformDevice* Create(int width, int height, bool is_opaque, | 104 static BitmapPlatformDevice* Create(int width, int height, bool is_opaque, |
107 cairo_surface_t* surface); | 105 cairo_surface_t* surface); |
108 | 106 |
109 scoped_refptr<BitmapPlatformDeviceData> data_; | 107 scoped_refptr<BitmapPlatformDeviceData> data_; |
110 }; | 108 }; |
111 | 109 |
112 } // namespace skia | 110 } // namespace skia |
113 | 111 |
114 #endif // SKIA_EXT_BITMAP_PLATFORM_DEVICE_LINUX_H_ | 112 #endif // SKIA_EXT_BITMAP_PLATFORM_DEVICE_LINUX_H_ |
OLD | NEW |