summaryrefslogtreecommitdiffstats
path: root/WebCore
diff options
context:
space:
mode:
authorAndroid (Google) Code Review <android-gerrit@google.com>2009-10-16 10:51:57 -0400
committerAndroid (Google) Code Review <android-gerrit@google.com>2009-10-16 10:51:57 -0400
commit9104ab4da69bc2d57dd2fa47c9d6f5b05b303f6e (patch)
tree7c17a4cc719bfe9f297a69997beb0e60866ec441 /WebCore
parent137af63dd6c9f4f2d009977bc4828a2d7935cafd (diff)
parent6623a2fa4116b5764908c6a168e4460b527edad1 (diff)
downloadexternal_webkit-9104ab4da69bc2d57dd2fa47c9d6f5b05b303f6e.zip
external_webkit-9104ab4da69bc2d57dd2fa47c9d6f5b05b303f6e.tar.gz
external_webkit-9104ab4da69bc2d57dd2fa47c9d6f5b05b303f6e.tar.bz2
Merge change I6623a2fa into eclair-mr2
* changes: don't pre-round rects, since we will zoom (arbitrarily) after we record the geometry.
Diffstat (limited to 'WebCore')
-rw-r--r--WebCore/platform/graphics/android/GraphicsContextAndroid.cpp21
1 files changed, 13 insertions, 8 deletions
diff --git a/WebCore/platform/graphics/android/GraphicsContextAndroid.cpp b/WebCore/platform/graphics/android/GraphicsContextAndroid.cpp
index 46ac9da..a78c155 100644
--- a/WebCore/platform/graphics/android/GraphicsContextAndroid.cpp
+++ b/WebCore/platform/graphics/android/GraphicsContextAndroid.cpp
@@ -1049,16 +1049,21 @@ void GraphicsContext::concatCTM(const TransformationMatrix& xform)
GC2Canvas(this)->concat((SkMatrix) xform);
}
+/* This is intended to round the rect to device pixels (through the CTM)
+ and then invert the result back into source space, with the hope that when
+ it is drawn (through the matrix), it will land in the "right" place (i.e.
+ on pixel boundaries).
+
+ For android, we record this geometry once and then draw it though various
+ scale factors as the user zooms, without re-recording. Thus this routine
+ should just leave the original geometry alone.
+
+ If we instead draw into bitmap tiles, we should then perform this
+ transform -> round -> inverse step.
+ */
FloatRect GraphicsContext::roundToDevicePixels(const FloatRect& rect)
{
- if (paintingDisabled())
- return FloatRect();
-
- const SkMatrix& matrix = GC2Canvas(this)->getTotalMatrix();
- SkRect r(rect);
- matrix.mapRect(&r);
- FloatRect result(SkScalarToFloat(r.fLeft), SkScalarToFloat(r.fTop), SkScalarToFloat(r.width()), SkScalarToFloat(r.height()));
- return result;
+ return rect;
}
//////////////////////////////////////////////////////////////////////////////////////////////////