summaryrefslogtreecommitdiffstats
path: root/WebCore/html/HTMLCanvasElement.cpp
diff options
context:
space:
mode:
authorGrace Kloba <klobag@google.com>2009-12-11 14:25:42 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2009-12-11 14:25:42 -0800
commit1d17336b0bcbfbe84a83b2ff144b2b5b200fb784 (patch)
tree707d7496ed58712add9c802fc055fb62a569f9af /WebCore/html/HTMLCanvasElement.cpp
parentda8d42def98a28bfef84ce5809d13ae1710a342c (diff)
parent9652d6b88e01f27d69c804ac6bc56b527b33c219 (diff)
downloadexternal_webkit-1d17336b0bcbfbe84a83b2ff144b2b5b200fb784.zip
external_webkit-1d17336b0bcbfbe84a83b2ff144b2b5b200fb784.tar.gz
external_webkit-1d17336b0bcbfbe84a83b2ff144b2b5b200fb784.tar.bz2
am 9652d6b8: Rollback to return density for scaleFactor.
Merge commit '9652d6b88e01f27d69c804ac6bc56b527b33c219' into eclair-mr2-plus-aosp * commit '9652d6b88e01f27d69c804ac6bc56b527b33c219': Rollback to return density for scaleFactor.
Diffstat (limited to 'WebCore/html/HTMLCanvasElement.cpp')
-rw-r--r--WebCore/html/HTMLCanvasElement.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/WebCore/html/HTMLCanvasElement.cpp b/WebCore/html/HTMLCanvasElement.cpp
index 7bae6e3..0405669 100644
--- a/WebCore/html/HTMLCanvasElement.cpp
+++ b/WebCore/html/HTMLCanvasElement.cpp
@@ -277,7 +277,19 @@ IntRect HTMLCanvasElement::convertLogicalToDevice(const FloatRect& logicalRect)
IntSize HTMLCanvasElement::convertLogicalToDevice(const FloatSize& logicalSize) const
{
+#if PLATFORM(ANDROID)
+ /* In Android we capture the drawing into a displayList, and then
+ replay that list at various scale factors (sometimes zoomed out, other
+ times zoomed in for "normal" reading, yet other times at arbitrary
+ zoom values based on the user's choice). In all of these cases, we do
+ not re-record the displayList, hence it is usually harmful to perform
+ any pre-rounding, since we just don't know the actual drawing resolution
+ at record time.
+ */
+ float pageScaleFactor = 1.0f;
+#else
float pageScaleFactor = document()->frame() ? document()->frame()->page()->chrome()->scaleFactor() : 1.0f;
+#endif
float wf = ceilf(logicalSize.width() * pageScaleFactor);
float hf = ceilf(logicalSize.height() * pageScaleFactor);
@@ -289,7 +301,19 @@ IntSize HTMLCanvasElement::convertLogicalToDevice(const FloatSize& logicalSize)
IntPoint HTMLCanvasElement::convertLogicalToDevice(const FloatPoint& logicalPos) const
{
+#if PLATFORM(ANDROID)
+ /* In Android we capture the drawing into a displayList, and then
+ replay that list at various scale factors (sometimes zoomed out, other
+ times zoomed in for "normal" reading, yet other times at arbitrary
+ zoom values based on the user's choice). In all of these cases, we do
+ not re-record the displayList, hence it is usually harmful to perform
+ any pre-rounding, since we just don't know the actual drawing resolution
+ at record time.
+ */
+ float pageScaleFactor = 1.0f;
+#else
float pageScaleFactor = document()->frame() ? document()->frame()->page()->chrome()->scaleFactor() : 1.0f;
+#endif
float xf = logicalPos.x() * pageScaleFactor;
float yf = logicalPos.y() * pageScaleFactor;