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

Unified Diff: skia/ext/bitmap_platform_device_win.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: Add mac changes. 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
Index: skia/ext/bitmap_platform_device_win.cc
===================================================================
--- skia/ext/bitmap_platform_device_win.cc (revision 97282)
+++ skia/ext/bitmap_platform_device_win.cc (working copy)
@@ -8,6 +8,7 @@
#include "skia/ext/bitmap_platform_device_win.h"
#include "skia/ext/bitmap_platform_device_data.h"
+#include "skia/ext/platform_device.h"
#include "third_party/skia/include/core/SkMatrix.h"
#include "third_party/skia/include/core/SkRefCnt.h"
#include "third_party/skia/include/core/SkRegion.h"
@@ -144,18 +145,20 @@
// The device object will take ownership of the HBITMAP. The initial refcount
// of the data object will be 1, which is what the constructor expects.
- return new BitmapPlatformDevice(new BitmapPlatformDeviceData(hbitmap),
- bitmap);
+ BitmapPlatformDevice* bitmap_platform_device =
+ new BitmapPlatformDevice(new BitmapPlatformDeviceData(hbitmap),
+ bitmap);
+ return bitmap_platform_device;
}
// static
BitmapPlatformDevice* BitmapPlatformDevice::create(int width,
- int height,
- bool is_opaque,
- HANDLE shared_section) {
+ int height,
vandebo (ex-Chrome) 2011/08/19 21:54:22 nit: indent
Jeff Timanus 2011/08/20 02:31:04 Done.
+ bool is_opaque,
+ HANDLE shared_section) {
HDC screen_dc = GetDC(NULL);
- BitmapPlatformDevice* device = BitmapPlatformDevice::create(
- screen_dc, width, height, is_opaque, shared_section);
+ SkDevice* device = BitmapPlatformDevice::create(screen_dc, width, height,
+ is_opaque, shared_section);
ReleaseDC(NULL, screen_dc);
return device;
}
@@ -165,10 +168,16 @@
BitmapPlatformDevice::BitmapPlatformDevice(
BitmapPlatformDeviceData* data,
const SkBitmap& bitmap)
- : PlatformDevice(bitmap),
+ : PlatformDevice(this),
+ SkDevice(bitmap),
data_(data) {
// The data object is already ref'ed for us by create().
SkDEBUGCODE(begin_paint_count_ = 0);
+
+ // 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);
vandebo (ex-Chrome) 2011/08/19 21:54:22 This generally seems pretty fragile, is there any
Jeff Timanus 2011/08/20 02:31:04 Yes, I was also worried about the fragile requirem
}
BitmapPlatformDevice::~BitmapPlatformDevice() {
@@ -262,4 +271,3 @@
}
} // namespace skia
-

Powered by Google App Engine
This is Rietveld 408576698