summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/graphics/android
diff options
context:
space:
mode:
authorMike Reed <reed@google.com>2009-09-25 14:45:42 -0400
committerMike Reed <reed@google.com>2009-09-25 15:47:14 -0400
commit01eae5621621a976f228f5f41c49967a356209cd (patch)
tree38fa6a2e6c7674d9873e36fb75eeb39e66d2d644 /WebCore/platform/graphics/android
parent6f855d88ef8d1b401944d290772a26222b61a505 (diff)
downloadexternal_webkit-01eae5621621a976f228f5f41c49967a356209cd.zip
external_webkit-01eae5621621a976f228f5f41c49967a356209cd.tar.gz
external_webkit-01eae5621621a976f228f5f41c49967a356209cd.tar.bz2
fix cracks when we draw the page in portions (i.e. a picture set)
When we record/draw the DOM N times (for speed), webkit sees what we're doing in certain places, and sends us different rectangle coordinates. These were all being antialiased (by default). However, when we are also zoomed, the rects now fall on fractional coordinates, and with aa, we will double-draw the edges where those rects should have seamed. The fix is to disable antialiasing for a class of rects that we record from webkit. We are probably disabling for more cases than is necessary for the current bug, but knowing which ones are "required" is tricky, and there (as yet) seems to be no down-side, since we never draw the page rotated at a funny angle (where the rect edge would look jaggie). http://b/issue?id=2132971&cookieId=2009268114917835 http://b/issue?id=2127763&cookieId=2009268114931860
Diffstat (limited to 'WebCore/platform/graphics/android')
-rw-r--r--WebCore/platform/graphics/android/GraphicsContextAndroid.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/WebCore/platform/graphics/android/GraphicsContextAndroid.cpp b/WebCore/platform/graphics/android/GraphicsContextAndroid.cpp
index c1a94b9..34b709b 100644
--- a/WebCore/platform/graphics/android/GraphicsContextAndroid.cpp
+++ b/WebCore/platform/graphics/android/GraphicsContextAndroid.cpp
@@ -686,6 +686,30 @@ void GraphicsContext::fillRect(const FloatRect& rect, const Color& color)
m_data->setup_paint_common(&paint);
paint.setColor(color.rgb()); // punch in the specified color
paint.setShader(NULL); // in case we had one set
+
+ /* Sometimes we record and draw portions of the page, using clips
+ for each portion. The problem with this is that webkit, sometimes,
+ sees that we're only recording a portion, and they adjust some of
+ their rectangle coordinates accordingly (e.g.
+ RenderBoxModelObject::paintFillLayerExtended() which calls
+ rect.intersect(paintInfo.rect) and then draws the bg with that
+ rect. The result is that we end up drawing rects that are meant to
+ seam together (one for each portion), but if the rects have
+ fractional coordinates (e.g. we are zoomed by a fractional amount)
+ we will double-draw those edges, resulting in visual cracks or
+ artifacts.
+
+ The fix seems to be to just turn off antialasing for rects (this
+ entry-point in GraphicsContext seems to have been sufficient,
+ though perhaps we'll find we need to do this as well in fillRect(r)
+ as well.) Currently setup_paint_common() enables antialiasing.
+
+ Since we never show the page rotated at a funny angle, disabling
+ antialiasing seems to have no real down-side, and it does fix the
+ bug when we're zoomed (and drawing portions that need to seam).
+ */
+ paint.setAntiAlias(false);
+
GC2Canvas(this)->drawRect(rect, paint);
}
}