OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_CAIRO_H_ | 5 #ifndef SKIA_EXT_BITMAP_PLATFORM_DEVICE_CAIRO_H_ |
6 #define SKIA_EXT_BITMAP_PLATFORM_DEVICE_CAIRO_H_ | 6 #define SKIA_EXT_BITMAP_PLATFORM_DEVICE_CAIRO_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 // shared memory between the renderer and the main process at least. In this | 56 // shared memory between the renderer and the main process at least. In this |
57 // case we'll probably create the buffer from a precreated region of memory. | 57 // case we'll probably create the buffer from a precreated region of memory. |
58 // ----------------------------------------------------------------------------- | 58 // ----------------------------------------------------------------------------- |
59 class BitmapPlatformDevice : public SkBitmapDevice, public PlatformDevice { | 59 class BitmapPlatformDevice : public SkBitmapDevice, public PlatformDevice { |
60 public: | 60 public: |
61 // Create a BitmapPlatformDeviceLinux from an already constructed bitmap; | 61 // Create a BitmapPlatformDeviceLinux from an already constructed bitmap; |
62 // you should probably be using Create(). This may become private later if | 62 // you should probably be using Create(). This may become private later if |
63 // we ever have to share state between some native drawing UI and Skia, like | 63 // we ever have to share state between some native drawing UI and Skia, like |
64 // the Windows and Mac versions of this class do. | 64 // the Windows and Mac versions of this class do. |
65 // | 65 // |
66 // This object takes ownership of @data. | 66 // This object takes ownership of @cairo. |
67 BitmapPlatformDevice(const SkBitmap& other, cairo_surface_t* surface); | 67 BitmapPlatformDevice(const SkBitmap& other, cairo_t* cairo); |
68 virtual ~BitmapPlatformDevice(); | 68 virtual ~BitmapPlatformDevice(); |
69 | 69 |
70 // Constructs a device with size |width| * |height| with contents initialized | 70 // Constructs a device with size |width| * |height| with contents initialized |
71 // to zero. |is_opaque| should be set if the caller knows the bitmap will be | 71 // to zero. |is_opaque| should be set if the caller knows the bitmap will be |
72 // completely opaque and allows some optimizations. | 72 // completely opaque and allows some optimizations. |
73 static BitmapPlatformDevice* Create(int width, int height, bool is_opaque); | 73 static BitmapPlatformDevice* Create(int width, int height, bool is_opaque); |
74 | 74 |
75 // Performs the same construction as Create. | 75 // Performs the same construction as Create. |
76 // Other ports require a separate construction routine because Create does not | 76 // Other ports require a separate construction routine because Create does not |
77 // initialize the bitmap to 0. | 77 // initialize the bitmap to 0. |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 | 124 |
125 // The current clipping | 125 // The current clipping |
126 SkRegion clip_region_; | 126 SkRegion clip_region_; |
127 | 127 |
128 DISALLOW_COPY_AND_ASSIGN(BitmapPlatformDevice); | 128 DISALLOW_COPY_AND_ASSIGN(BitmapPlatformDevice); |
129 }; | 129 }; |
130 | 130 |
131 } // namespace skia | 131 } // namespace skia |
132 | 132 |
133 #endif // SKIA_EXT_BITMAP_PLATFORM_DEVICE_CAIRO_H_ | 133 #endif // SKIA_EXT_BITMAP_PLATFORM_DEVICE_CAIRO_H_ |
OLD | NEW |