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

Unified Diff: skia/ext/bitmap_platform_device_linux.cc

Issue 7633040: CL removing inheritance of SkDevice from PlatformDevice. Flavours of PlatformDevice classes now ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Port to Linux. Created 9 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « skia/ext/bitmap_platform_device_linux.h ('k') | skia/ext/bitmap_platform_device_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/ext/bitmap_platform_device_linux.cc
===================================================================
--- skia/ext/bitmap_platform_device_linux.cc (revision 97366)
+++ skia/ext/bitmap_platform_device_linux.cc (working copy)
@@ -75,9 +75,8 @@
// that we can create the pixel data before calling the constructor. This is
// required so that we can call the base class' constructor with the pixel
// data.
-BitmapPlatformDevice* BitmapPlatformDevice::Create(int width, int height,
- bool is_opaque,
- cairo_surface_t* surface) {
+BitmapPlatformDevice* BitmapPlatformDevice::Create(int width, int height, bool is_opaque,
alokp 2011/08/19 03:01:41 indenting
Jeff Timanus 2011/08/20 02:31:04 Done.
+ cairo_surface_t* surface) {
SkBitmap bitmap;
bitmap.setConfig(SkBitmap::kARGB_8888_Config, width, height,
cairo_image_surface_get_stride(surface));
@@ -89,8 +88,7 @@
(bitmap, new BitmapPlatformDeviceData(surface));
}
-BitmapPlatformDevice* BitmapPlatformDevice::Create(int width, int height,
- bool is_opaque) {
+BitmapPlatformDevice* BitmapPlatformDevice::Create(int width, int height, bool is_opaque) {
cairo_surface_t* surface =
cairo_image_surface_create(CAIRO_FORMAT_ARGB32,
width, height);
@@ -105,8 +103,7 @@
return device;
}
-BitmapPlatformDevice* BitmapPlatformDevice::Create(int width, int height,
- bool is_opaque,
+BitmapPlatformDevice* BitmapPlatformDevice::Create(int width, int height, bool is_opaque,
uint8_t* data) {
cairo_surface_t* surface = cairo_image_surface_create_for_data(
data, CAIRO_FORMAT_ARGB32, width, height,
@@ -120,8 +117,14 @@
BitmapPlatformDevice::BitmapPlatformDevice(
const SkBitmap& bitmap,
BitmapPlatformDeviceData* data)
- : PlatformDevice(bitmap),
+ : PlatformDevice(this),
+ SkDevice(bitmap),
data_(data) {
+
+ // Pass false, because BitmapPlatformDevice inherits both SkDevice, and
+ // PlatformDevice, so there is no need to explicitly bind the lifetime of the
+ // two classes.
+ SetPlatformDevice(this, this, false);
}
BitmapPlatformDevice::~BitmapPlatformDevice() {
« no previous file with comments | « skia/ext/bitmap_platform_device_linux.h ('k') | skia/ext/bitmap_platform_device_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698