Adding a comment I forgot to add before.
authorbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Sep 2011 22:41:36 +0000 (22:41 +0000)
committerbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Sep 2011 22:41:36 +0000 (22:41 +0000)
* rendering/RenderImage.cpp:
(WebCore::RenderImage::imageSizeForError):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95053 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderImage.cpp

index aa6e460..c9db804 100644 (file)
@@ -1,3 +1,10 @@
+2011-09-13  Beth Dakin  <bdakin@apple.com>
+
+        Adding a comment I forgot to add before.
+
+        * rendering/RenderImage.cpp:
+        (WebCore::RenderImage::imageSizeForError):
+
 2011-09-13  Antti Koivisto  <antti@apple.com>
 
         Move identifier filter from CSSStyleSelector to SelectorChecker
index e64d2e9..44ed844 100644 (file)
@@ -88,8 +88,15 @@ IntSize RenderImage::imageSizeForError(CachedImage* newImage) const
     if (newImage->willPaintBrokenImage()) {
         float deviceScaleFactor = Page::deviceScaleFactor(frame());
         imageSize = newImage->brokenImage(deviceScaleFactor)->size();
-        if (deviceScaleFactor >= 2)
-            imageSize.scale(0.5f);        
+        if (deviceScaleFactor >= 2) {
+            // It is important to scale by 0.5 instead of the deviceScaleFactor because the
+            // high resolution broken image artwork is actually a 2x image. We should 
+            // consider adding functionality to Image to ask about the image's resolution,
+            // and then we could scale by 1 / resolution. This is a solution that would
+            // scale better since this hardcoded number will have to change if we ever get
+            // artwork at other, higher resolutions. 
+            imageSize.scale(0.5f);
+        }
     } else
         imageSize = newImage->image()->size();