Skip to content

Commit

Permalink
Fix an issue where textbox borders were not drawn correctly in transp…
Browse files Browse the repository at this point in the history
…arency layers.

This also fixes the issue where textboxes on windows in Titanium with
a transparent background are insensitive to clicks.
[#356 state:resolved]
  • Loading branch information
mrobinson committed Jun 21, 2010
1 parent 02fca0a commit 86622c7
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion WebCore/platform/graphics/win/GraphicsContextCairoWin.cpp
Expand Up @@ -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<unsigned char*>(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,
Expand Down

0 comments on commit 86622c7

Please sign in to comment.