Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(646)

Side by Side Diff: skia/ext/bitmap_platform_device_linux.h

Issue 18678: Linux Skia: add an option to build a canvas from a provided memory buffer (Closed)
Patch Set: ... Created 11 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | skia/ext/bitmap_platform_device_linux.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_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 7
8 #include "base/ref_counted.h" 8 #include "base/ref_counted.h"
9 #include "skia/ext/platform_device_linux.h" 9 #include "skia/ext/platform_device_linux.h"
10 10
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 // case we'll probably create the buffer from a precreated region of memory. 55 // case we'll probably create the buffer from a precreated region of memory.
56 // ----------------------------------------------------------------------------- 56 // -----------------------------------------------------------------------------
57 class BitmapPlatformDeviceLinux : public PlatformDeviceLinux { 57 class BitmapPlatformDeviceLinux : public PlatformDeviceLinux {
58 // A reference counted cairo surface 58 // A reference counted cairo surface
59 class BitmapPlatformDeviceLinuxData; 59 class BitmapPlatformDeviceLinuxData;
60 60
61 public: 61 public:
62 /// Static constructor. I don't understand this, it's just a copy of the mac 62 /// Static constructor. I don't understand this, it's just a copy of the mac
63 static BitmapPlatformDeviceLinux* Create(int width, int height, 63 static BitmapPlatformDeviceLinux* Create(int width, int height,
64 bool is_opaque); 64 bool is_opaque);
65 static BitmapPlatformDeviceLinux* Create(int width, int height,
66 bool is_opaque, uint8_t* data);
67 static BitmapPlatformDeviceLinux* Create(int width, int height,
68 bool is_opaque,
69 cairo_surface_t* surface);
65 70
66 // Create a BitmapPlatformDeviceLinux from an already constructed bitmap; 71 // Create a BitmapPlatformDeviceLinux from an already constructed bitmap;
67 // you should probably be using Create(). This may become private later if 72 // you should probably be using Create(). This may become private later if
68 // we ever have to share state between some native drawing UI and Skia, like 73 // we ever have to share state between some native drawing UI and Skia, like
69 // the Windows and Mac versions of this class do. 74 // the Windows and Mac versions of this class do.
70 // 75 //
71 // This object takes ownership of @data. 76 // This object takes ownership of @data.
72 BitmapPlatformDeviceLinux(const SkBitmap& other, 77 BitmapPlatformDeviceLinux(const SkBitmap& other,
73 BitmapPlatformDeviceLinuxData* data); 78 BitmapPlatformDeviceLinuxData* data);
74 virtual ~BitmapPlatformDeviceLinux(); 79 virtual ~BitmapPlatformDeviceLinux();
75 BitmapPlatformDeviceLinux& operator=(const BitmapPlatformDeviceLinux& other); 80 BitmapPlatformDeviceLinux& operator=(const BitmapPlatformDeviceLinux& other);
76 81
77 // A stub copy constructor. Needs to be properly implemented. 82 // A stub copy constructor. Needs to be properly implemented.
78 BitmapPlatformDeviceLinux(const BitmapPlatformDeviceLinux& other); 83 BitmapPlatformDeviceLinux(const BitmapPlatformDeviceLinux& other);
79 84
80 // Bitmaps aren't vector graphics. 85 // Bitmaps aren't vector graphics.
81 virtual bool IsVectorial() { return false; } 86 virtual bool IsVectorial() { return false; }
82 87
83 cairo_surface_t* surface() const; 88 cairo_surface_t* surface() const;
84 89
85 private: 90 private:
86 scoped_refptr<BitmapPlatformDeviceLinuxData> data_; 91 scoped_refptr<BitmapPlatformDeviceLinuxData> data_;
87 }; 92 };
88 93
89 } // namespace skia 94 } // namespace skia
90 95
91 #endif // SKIA_EXT_BITMAP_PLATFORM_DEVICE_LINUX_H_ 96 #endif // SKIA_EXT_BITMAP_PLATFORM_DEVICE_LINUX_H_
OLDNEW
« no previous file with comments | « no previous file | skia/ext/bitmap_platform_device_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698