Commit 0be6f95e authored by bfulgham@webkit.org's avatar bfulgham@webkit.org

Unreviewed build fix for Windows (Cairo).

Provide implementation of new BitmapImage::create that was
added in @r49060.

* platform/graphics/win/ImageCairoWin.cpp:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49260 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 40f54733
2009-10-07 Brent Fulgham <bfulgham@webkit.org>
Unreviewed build fix for Windows (Cairo).
Provide implementation of new BitmapImage::create that was
added in @r49060.
* platform/graphics/win/ImageCairoWin.cpp:
2009-10-07 Andrew Scherkus <scherkus@chromium.org>
Reviewed by Eric Carlson.
......@@ -28,12 +28,33 @@
#include "BitmapImage.h"
#include "GraphicsContext.h"
#include <cairo.h>
#include <cairo-win32.h>
#include <windows.h>
#include "PlatformString.h"
namespace WebCore {
PassRefPtr<BitmapImage> BitmapImage::create(HBITMAP hBitmap)
{
DIBSECTION dibSection;
if (!GetObject(hBitmap, sizeof(DIBSECTION), &dibSection))
return 0;
ASSERT(dibSection.dsBm.bmBitsPixel == 32);
if (dibSection.dsBm.bmBitsPixel != 32)
return 0;
ASSERT(dibSection.dsBm.bmBits);
if (!dibSection.dsBm.bmBits)
return 0;
cairo_surface_t* image = cairo_win32_surface_create_with_dib (CAIRO_FORMAT_ARGB32, dibSection.dsBm.bmWidth, dibSection.dsBm.bmHeight);
// The BitmapImage object takes over ownership of the cairo_surface_t*, so no need to destroy here.
return adoptRef(new BitmapImage(image));
}
bool BitmapImage::getHBITMAPOfSize(HBITMAP bmp, LPSIZE size)
{
ASSERT(bmp);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment