summaryrefslogtreecommitdiffstats
path: root/skia
diff options
context:
space:
mode:
authorjbauman@chromium.org <jbauman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-10 17:11:10 +0000
committerjbauman@chromium.org <jbauman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-10 17:11:10 +0000
commit6dd65399f63298f3a0412dddaff21db6be565361 (patch)
tree67880f5857141387521b97534bdaffbdc3c73131 /skia
parent004fb919c626db551adef17a61933810d3f817ca (diff)
downloadchromium_src-6dd65399f63298f3a0412dddaff21db6be565361.zip
chromium_src-6dd65399f63298f3a0412dddaff21db6be565361.tar.gz
chromium_src-6dd65399f63298f3a0412dddaff21db6be565361.tar.bz2
Don't get screen dc when creating BitmapPlatformDevice
We were only using the screen dc for CreateDIBSection, which is unnecessary, and it was grabbing a lock preventing us from creating a BitmapPlatformDevice while something else was presenting to the screen. BUG=122103 TEST= Review URL: http://codereview.chromium.org/10009022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@131574 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia')
-rw-r--r--skia/ext/bitmap_platform_device_win.cc15
-rw-r--r--skia/ext/bitmap_platform_device_win.h11
2 files changed, 4 insertions, 22 deletions
diff --git a/skia/ext/bitmap_platform_device_win.cc b/skia/ext/bitmap_platform_device_win.cc
index 90fdf30..09140a1 100644
--- a/skia/ext/bitmap_platform_device_win.cc
+++ b/skia/ext/bitmap_platform_device_win.cc
@@ -88,7 +88,6 @@ void BitmapPlatformDevice::BitmapPlatformDeviceData::LoadConfig() {
// required so that we can call the base class' constructor with the pixel
// data.
BitmapPlatformDevice* BitmapPlatformDevice::Create(
- HDC screen_dc,
int width,
int height,
bool is_opaque,
@@ -116,7 +115,7 @@ BitmapPlatformDevice* BitmapPlatformDevice::Create(
hdr.biClrImportant = 0;
void* data = NULL;
- HBITMAP hbitmap = CreateDIBSection(screen_dc,
+ HBITMAP hbitmap = CreateDIBSection(NULL,
reinterpret_cast<BITMAPINFO*>(&hdr), 0,
&data,
shared_section, 0);
@@ -143,18 +142,6 @@ BitmapPlatformDevice* BitmapPlatformDevice::Create(
}
// static
-BitmapPlatformDevice* BitmapPlatformDevice::Create(int width,
- int height,
- bool is_opaque,
- HANDLE shared_section) {
- HDC screen_dc = GetDC(NULL);
- BitmapPlatformDevice* device = BitmapPlatformDevice::Create(
- screen_dc, width, height, is_opaque, shared_section);
- ReleaseDC(NULL, screen_dc);
- return device;
-}
-
-// static
BitmapPlatformDevice* BitmapPlatformDevice::Create(int width, int height,
bool is_opaque) {
return Create(width, height, is_opaque, NULL);
diff --git a/skia/ext/bitmap_platform_device_win.h b/skia/ext/bitmap_platform_device_win.h
index b824369..486141a 100644
--- a/skia/ext/bitmap_platform_device_win.h
+++ b/skia/ext/bitmap_platform_device_win.h
@@ -28,22 +28,17 @@ namespace skia {
// DEVICE'S PIXEL DATA TO ANOTHER BITMAP, make sure you copy instead.
class SK_API BitmapPlatformDevice : public SkDevice, public PlatformDevice {
public:
- // Factory function. The screen DC is used to create the bitmap, and will not
- // be stored beyond this function. is_opaque should be set if the caller
- // knows the bitmap will be completely opaque and allows some optimizations.
+ // Factory function. is_opaque should be set if the caller knows the bitmap
+ // will be completely opaque and allows some optimizations.
//
// The |shared_section| parameter is optional (pass NULL for default
// behavior). If |shared_section| is non-null, then it must be a handle to a
// file-mapping object returned by CreateFileMapping. See CreateDIBSection
// for details. If |shared_section| is null, the bitmap backing store is not
// initialized.
- static BitmapPlatformDevice* Create(HDC screen_dc, int width, int height,
+ static BitmapPlatformDevice* Create(int width, int height,
bool is_opaque, HANDLE shared_section);
- // This version is the same as above but will get the screen DC itself.
- static BitmapPlatformDevice* Create(int width, int height, bool is_opaque,
- HANDLE shared_section);
-
// Create a BitmapPlatformDevice with no shared section. The bitmap is not
// initialized to 0.
static BitmapPlatformDevice* Create(int width, int height, bool is_opaque);