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

Unified Diff: skia/ext/bitmap_platform_device_win.cc

Issue 1396613006: Remove skia::PlatformBitmap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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_win.h ('k') | skia/ext/platform_canvas.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/ext/bitmap_platform_device_win.cc
diff --git a/skia/ext/bitmap_platform_device_win.cc b/skia/ext/bitmap_platform_device_win.cc
index 5712df3eaea311f4a490a3ef9e16c694051ee50c..9cd3d70ca0fcb3171d01584b54eba0dbecfde48d 100644
--- a/skia/ext/bitmap_platform_device_win.cc
+++ b/skia/ext/bitmap_platform_device_win.cc
@@ -317,35 +317,4 @@ SkCanvas* CreatePlatformCanvas(int width,
return CreateCanvas(dev, failureType);
}
-// Port of PlatformBitmap to win
-
-PlatformBitmap::~PlatformBitmap() {
- if (surface_) {
- if (platform_extra_)
- SelectObject(surface_, reinterpret_cast<HGDIOBJ>(platform_extra_));
- DeleteDC(surface_);
- }
-}
-
-bool PlatformBitmap::Allocate(int width, int height, bool is_opaque) {
- void* data;
- HBITMAP hbitmap = CreateHBitmap(width, height, is_opaque, 0, &data);
- if (!hbitmap)
- return false;
-
- surface_ = CreateCompatibleDC(NULL);
- InitializeDC(surface_);
- // When the memory DC is created, its display surface is exactly one
- // monochrome pixel wide and one monochrome pixel high. Save this object
- // off, we'll restore it just before deleting the memory DC.
- HGDIOBJ stock_bitmap = SelectObject(surface_, hbitmap);
- platform_extra_ = reinterpret_cast<intptr_t>(stock_bitmap);
-
- if (!InstallHBitmapPixels(&bitmap_, width, height, is_opaque, data, hbitmap))
- return false;
- bitmap_.lockPixels();
-
- return true;
-}
-
} // namespace skia
« no previous file with comments | « skia/ext/bitmap_platform_device_win.h ('k') | skia/ext/platform_canvas.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698