summaryrefslogtreecommitdiffstats
path: root/WebCore/rendering
diff options
context:
space:
mode:
authorCary Clark <cary@android.com>2009-08-31 11:54:03 -0400
committerCary Clark <cary@android.com>2009-08-31 11:54:03 -0400
commit5ddcc215704c2a08c2e34f6b1c778ea37639eb4e (patch)
tree3301eb9b0bcb7e3ecc7b3bd7541dce3484021cad /WebCore/rendering
parent194211f214e16956c937d03c2aff03936c22f928 (diff)
downloadexternal_webkit-5ddcc215704c2a08c2e34f6b1c778ea37639eb4e.zip
external_webkit-5ddcc215704c2a08c2e34f6b1c778ea37639eb4e.tar.gz
external_webkit-5ddcc215704c2a08c2e34f6b1c778ea37639eb4e.tar.bz2
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
Diffstat (limited to 'WebCore/rendering')
-rw-r--r--WebCore/rendering/RenderImage.cpp6
1 files changed, 6 insertions, 0 deletions
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;