From 5ddcc215704c2a08c2e34f6b1c778ea37639eb4e Mon Sep 17 00:00:00 2001 From: Cary Clark Date: Mon, 31 Aug 2009 11:54:03 -0400 Subject: save and restore the transparent fill when drawing replaced images If an image node is incomplete, RenderImage::paintReplaced is triggered. A thin frame with a transparent center sets but does not restore the fill to transparent. Our graphics state draws transparent bitmaps until the state gets set back to opaque. I haven't figured out why Safari doesn't demonstrate this same bug, but in some webkit code, the state is saved and restored around making the fill transparent. Adding that save()/restore() pair fixes our bug as well. But, it may be that our platform should be setting the fill state before drawing the bitmap and is failing to do so. This fixes http://b/issue?id=2052757 --- WebCore/rendering/RenderImage.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'WebCore/rendering') diff --git a/WebCore/rendering/RenderImage.cpp b/WebCore/rendering/RenderImage.cpp index 5c11e41..91200bc 100644 --- a/WebCore/rendering/RenderImage.cpp +++ b/WebCore/rendering/RenderImage.cpp @@ -367,10 +367,16 @@ void RenderImage::paintReplaced(PaintInfo& paintInfo, int tx, int ty) if (cWidth > 2 && cHeight > 2) { // Draw an outline rect where the image should be. +#ifdef ANDROID_FIX // see http://b/issue?id=2052757 + context->save(); +#endif context->setStrokeStyle(SolidStroke); context->setStrokeColor(Color::lightGray); context->setFillColor(Color::transparent); context->drawRect(IntRect(tx + leftBorder + leftPad, ty + topBorder + topPad, cWidth, cHeight)); +#ifdef ANDROID_FIX // see http://b/issue?id=2052757 + context->restore(); +#endif bool errorPictureDrawn = false; int imageX = 0; -- cgit v1.1