From 86622c75a357b11cf664d2659b5a037b5caeb61b Mon Sep 17 00:00:00 2001 From: Martin Robinson Date: Mon, 21 Jun 2010 03:54:48 -0700 Subject: [PATCH] Fix an issue where textbox borders were not drawn correctly in transparency layers. This also fixes the issue where textboxes on windows in Titanium with a transparent background are insensitive to clicks. [#356 state:resolved] --- .../platform/graphics/win/GraphicsContextCairoWin.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/WebCore/platform/graphics/win/GraphicsContextCairoWin.cpp b/WebCore/platform/graphics/win/GraphicsContextCairoWin.cpp index d912cb550b7..5c93077c965 100644 --- a/WebCore/platform/graphics/win/GraphicsContextCairoWin.cpp +++ b/WebCore/platform/graphics/win/GraphicsContextCairoWin.cpp @@ -100,9 +100,18 @@ void GraphicsContext::releaseWindowsContext(HDC hdc, const IntRect& dstRect, boo GetObject(bitmap, sizeof(info), &info); ASSERT(info.bmBitsPixel == 32); + unsigned char* bytes = reinterpret_cast(info.bmBits); + + // If this context does not support alpha blending, then it may have + // been drawn with GDI functions which always set the alpha channel + // to zero. We need to manually set the bitmap to be fully opaque. + if (!supportAlphaBlend) + for (size_t i = 0; i < info.bmHeight * info.bmWidthBytes; i += 4) + bytes[i + 3] = 255; + // Need to make a cairo_surface_t out of the bitmap's pixel buffer and then draw // it into our context. - cairo_surface_t* image = cairo_image_surface_create_for_data((unsigned char*)info.bmBits, + cairo_surface_t* image = cairo_image_surface_create_for_data(bytes, CAIRO_FORMAT_ARGB32, info.bmWidth, info.bmHeight,