Fix for https://bugs.webkit.org/show_bug.cgi?id=67819
authorbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 10 Sep 2011 06:28:00 +0000 (06:28 +0000)
committerbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 10 Sep 2011 06:28:00 +0000 (06:28 +0000)
Use high resolution platform images when the deviceScaleFactor > 1
-and corresponding-
<rdar://problem/10003098>

Reviewed by Darin Adler.

Add all of the new high resolution images. I also removed some tiffs from the
project and replaced them with png equivalents (that are already checked into
WebCore anyway). Since the high resolution images are pngs, it makes sense to use
pngs for all of the images that load through Image::loadPlatformResource()
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/mac/ImageMac.mm:
(WebCore::Image::loadPlatformResource):

Load the @2x resource for deviceScaleFactors >= 2.
* editing/DeleteButtonController.cpp:
(WebCore::DeleteButtonController::createDeletionUI):

CachedImage::brokenImage() is no longer a static helper function, but a real
member function. It also now loads the @2x resource for deviceScaleFactors >= 2
and takes a parameter for the deviceScaleFactor. When CachedImage::image() returns
the brokenImage(), it just returns the 1x version. brokenImage() has to be called
directly to reliably return the deviceScaleFactor-appropriate resource.
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::brokenImage):
(WebCore::CachedImage::image):
* loader/cache/CachedImage.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::drawPlatformResizerImage):
(WebCore::RenderLayer::paintResizer):
* rendering/RenderLayer.h:

New static function to retrieve the deviceScaleFactor for callers that do not have
direct access to a Page.
* page/Page.cpp:
(WebCore::Page::deviceScaleFactor):
* page/Page.h:

Call CachedImage::brokenImage() for the broken-image image at an accurate
resolution.
* rendering/RenderImage.cpp:
(WebCore::RenderImage::imageSizeForError):
(WebCore::RenderImage::paintReplaced):

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

16 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Resources/deleteButton@2x.png [new file with mode: 0644]
Source/WebCore/Resources/deleteButtonPressed@2x.png [new file with mode: 0644]
Source/WebCore/Resources/missingImage@2x.png [new file with mode: 0644]
Source/WebCore/Resources/nullPlugin@2x.png [new file with mode: 0644]
Source/WebCore/Resources/textAreaResizeCorner@2x.png [new file with mode: 0644]
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/editing/DeleteButtonController.cpp
Source/WebCore/loader/cache/CachedImage.cpp
Source/WebCore/loader/cache/CachedImage.h
Source/WebCore/page/Page.cpp
Source/WebCore/page/Page.h
Source/WebCore/platform/graphics/mac/ImageMac.mm
Source/WebCore/rendering/RenderImage.cpp
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderLayer.h

index 8b18a9d..de1fe37 100644 (file)
@@ -1,3 +1,50 @@
+2011-09-09  Beth Dakin  <bdakin@apple.com>
+
+        Fix for https://bugs.webkit.org/show_bug.cgi?id=67819
+        Use high resolution platform images when the deviceScaleFactor > 1
+        -and corresponding-
+        <rdar://problem/10003098>
+
+        Reviewed by Darin Adler.
+
+        Add all of the new high resolution images. I also removed some tiffs from the 
+        project and replaced them with png equivalents (that are already checked into 
+        WebCore anyway). Since the high resolution images are pngs, it makes sense to use 
+        pngs for all of the images that load through Image::loadPlatformResource()
+        * WebCore.xcodeproj/project.pbxproj:
+        * platform/graphics/mac/ImageMac.mm:
+        (WebCore::Image::loadPlatformResource):
+
+        Load the @2x resource for deviceScaleFactors >= 2.
+        * editing/DeleteButtonController.cpp:
+        (WebCore::DeleteButtonController::createDeletionUI):
+
+        CachedImage::brokenImage() is no longer a static helper function, but a real 
+        member function. It also now loads the @2x resource for deviceScaleFactors >= 2 
+        and takes a parameter for the deviceScaleFactor. When CachedImage::image() returns 
+        the brokenImage(), it just returns the 1x version. brokenImage() has to be called 
+        directly to reliably return the deviceScaleFactor-appropriate resource.
+        * loader/cache/CachedImage.cpp:
+        (WebCore::CachedImage::brokenImage):
+        (WebCore::CachedImage::image):
+        * loader/cache/CachedImage.h:
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::drawPlatformResizerImage):
+        (WebCore::RenderLayer::paintResizer):
+        * rendering/RenderLayer.h:
+
+        New static function to retrieve the deviceScaleFactor for callers that do not have 
+        direct access to a Page.
+        * page/Page.cpp:
+        (WebCore::Page::deviceScaleFactor):
+        * page/Page.h:
+
+        Call CachedImage::brokenImage() for the broken-image image at an accurate 
+        resolution.
+        * rendering/RenderImage.cpp:
+        (WebCore::RenderImage::imageSizeForError):
+        (WebCore::RenderImage::paintReplaced):
+
 2011-09-09  Erik Arvidsson  <arv@chromium.org>
 
         Move Element.contains to Node
diff --git a/Source/WebCore/Resources/deleteButton@2x.png b/Source/WebCore/Resources/deleteButton@2x.png
new file mode 100644 (file)
index 0000000..e6046d4
Binary files /dev/null and b/Source/WebCore/Resources/deleteButton@2x.png differ
diff --git a/Source/WebCore/Resources/deleteButtonPressed@2x.png b/Source/WebCore/Resources/deleteButtonPressed@2x.png
new file mode 100644 (file)
index 0000000..3c999a7
Binary files /dev/null and b/Source/WebCore/Resources/deleteButtonPressed@2x.png differ
diff --git a/Source/WebCore/Resources/missingImage@2x.png b/Source/WebCore/Resources/missingImage@2x.png
new file mode 100644 (file)
index 0000000..6573d17
Binary files /dev/null and b/Source/WebCore/Resources/missingImage@2x.png differ
diff --git a/Source/WebCore/Resources/nullPlugin@2x.png b/Source/WebCore/Resources/nullPlugin@2x.png
new file mode 100644 (file)
index 0000000..ccc4018
Binary files /dev/null and b/Source/WebCore/Resources/nullPlugin@2x.png differ
diff --git a/Source/WebCore/Resources/textAreaResizeCorner@2x.png b/Source/WebCore/Resources/textAreaResizeCorner@2x.png
new file mode 100644 (file)
index 0000000..7d26fbc
Binary files /dev/null and b/Source/WebCore/Resources/textAreaResizeCorner@2x.png differ
index b15bcd7..8eeb590 100644 (file)
                1C11CCC60AA6093700DADB20 /* DOMDocumentFragment.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 85089CD30A98C42800A275AA /* DOMDocumentFragment.h */; };
                1C11CCC70AA6093700DADB20 /* DOMCDATASection.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 85089CCF0A98C42700A275AA /* DOMCDATASection.h */; };
                1C11CCC80AA6093700DADB20 /* DOMHTMLElement.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 85DF2EEB0AA387CB00AD64C5 /* DOMHTMLElement.h */; };
-               1C14E76B0AD8C81C00B6158B /* deleteButtonPressed.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 1C14E7690AD8C81C00B6158B /* deleteButtonPressed.tiff */; };
-               1C14E76C0AD8C81C00B6158B /* deleteButton.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 1C14E76A0AD8C81C00B6158B /* deleteButton.tiff */; };
                1C26497A0D7E248A00BD10F2 /* DocumentLoaderMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C2649790D7E248A00BD10F2 /* DocumentLoaderMac.cpp */; };
                1C26497C0D7E24EC00BD10F2 /* PageMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C26497B0D7E24EC00BD10F2 /* PageMac.cpp */; };
                1C4C8F020AD85D87009475CE /* DeleteButtonController.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C4C8F000AD85D87009475CE /* DeleteButtonController.h */; };
                72626E020EF022FE00A07E20 /* FontFastPath.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 72626E010EF022FE00A07E20 /* FontFastPath.cpp */; };
                750D029311D0E7F300BD1B27 /* RenderInputSpeech.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 750D029111D0E7F300BD1B27 /* RenderInputSpeech.cpp */; };
                750D029411D0E7F300BD1B27 /* RenderInputSpeech.h in Headers */ = {isa = PBXBuildFile; fileRef = 750D029211D0E7F300BD1B27 /* RenderInputSpeech.h */; };
-               750D02C111D0EE7D00BD1B27 /* inputSpeech.tiff in Resources */ = {isa = PBXBuildFile; fileRef = 750D02C011D0EE7D00BD1B27 /* inputSpeech.tiff */; };
                7535BC9412020CFF0037EC45 /* SpeechInputClientMock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7535BC9212020CFF0037EC45 /* SpeechInputClientMock.cpp */; };
                7535BC9512020CFF0037EC45 /* SpeechInputClientMock.h in Headers */ = {isa = PBXBuildFile; fileRef = 7535BC9312020CFF0037EC45 /* SpeechInputClientMock.h */; };
                754133A8102E00E800075D00 /* InspectorTimelineAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 754133A7102E00E800075D00 /* InspectorTimelineAgent.h */; };
                9307F1D80AF2D59000DBA31A /* HitTestResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 9307F1D60AF2D59000DBA31A /* HitTestResult.h */; settings = {ATTRIBUTES = (Private, ); }; };
                930908910AF7EDE40081DF01 /* HitTestRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 930908900AF7EDE40081DF01 /* HitTestRequest.h */; settings = {ATTRIBUTES = (Private, ); }; };
                930FC68A1072B9280045293E /* TextRenderingMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 930FC6891072B9280045293E /* TextRenderingMode.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               93153BCD1417FBBF00FCF5BE /* deleteButton@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 93153BCC1417FBBF00FCF5BE /* deleteButton@2x.png */; };
+               93153BCF1417FBDB00FCF5BE /* deleteButtonPressed@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 93153BCE1417FBDB00FCF5BE /* deleteButtonPressed@2x.png */; };
+               93153BDA14181F7A00FCF5BE /* missingImage@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 93153BD914181F7A00FCF5BE /* missingImage@2x.png */; };
+               93153BDC141959BC00FCF5BE /* textAreaResizeCorner.png in Resources */ = {isa = PBXBuildFile; fileRef = 93153BDB141959BB00FCF5BE /* textAreaResizeCorner.png */; };
+               93153BDE141959F400FCF5BE /* deleteButton.png in Resources */ = {isa = PBXBuildFile; fileRef = 93153BDD141959F400FCF5BE /* deleteButton.png */; };
+               93153BE014195A2800FCF5BE /* deleteButtonPressed.png in Resources */ = {isa = PBXBuildFile; fileRef = 93153BDF14195A2800FCF5BE /* deleteButtonPressed.png */; };
+               93153BE214195A5700FCF5BE /* missingImage.png in Resources */ = {isa = PBXBuildFile; fileRef = 93153BE114195A5700FCF5BE /* missingImage.png */; };
+               93153BE414195B2A00FCF5BE /* inputSpeech.png in Resources */ = {isa = PBXBuildFile; fileRef = 93153BE314195B2900FCF5BE /* inputSpeech.png */; };
                931BCC611124DFCB00BE70DD /* MediaCanStartListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 931BCC601124DFCB00BE70DD /* MediaCanStartListener.h */; settings = {ATTRIBUTES = (Private, ); }; };
                9326DC0C09DAD5D600AFC847 /* CharsetData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 656581AC09D14EE6000E61D7 /* CharsetData.cpp */; };
                9327A94209968D1A0068A546 /* HTMLOptionsCollection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9327A94109968D1A0068A546 /* HTMLOptionsCollection.cpp */; };
                9362640B0DE1137D009D5A00 /* CSSReflectionDirection.h in Headers */ = {isa = PBXBuildFile; fileRef = 9362640A0DE1137D009D5A00 /* CSSReflectionDirection.h */; settings = {ATTRIBUTES = (Private, ); }; };
                9363B62C0F8E8FE000803810 /* HistoryPropertyList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9363B62A0F8E8FE000803810 /* HistoryPropertyList.cpp */; };
                9363B62D0F8E8FE000803810 /* HistoryPropertyList.h in Headers */ = {isa = PBXBuildFile; fileRef = 9363B62B0F8E8FE000803810 /* HistoryPropertyList.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               9370918D1416D86B00477333 /* textAreaResizeCorner@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 9370918C1416D86B00477333 /* textAreaResizeCorner@2x.png */; };
                93799EF80BF2743600D0F230 /* RenderWordBreak.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93799EF60BF2743600D0F230 /* RenderWordBreak.cpp */; };
                93799EF90BF2743600D0F230 /* RenderWordBreak.h in Headers */ = {isa = PBXBuildFile; fileRef = 93799EF70BF2743600D0F230 /* RenderWordBreak.h */; };
                9380F47309A11AB4001FDB34 /* Widget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9380F47109A11AB4001FDB34 /* Widget.cpp */; };
                AB247A6C0AFD6383003FA5FD /* RenderSlider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB247A6A0AFD6383003FA5FD /* RenderSlider.cpp */; };
                AB247A6D0AFD6383003FA5FD /* RenderSlider.h in Headers */ = {isa = PBXBuildFile; fileRef = AB247A6B0AFD6383003FA5FD /* RenderSlider.h */; };
                AB31C91E10AE1B8E000C7B92 /* LineClampValue.h in Headers */ = {isa = PBXBuildFile; fileRef = AB31C91D10AE1B8E000C7B92 /* LineClampValue.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               AB4261D80A2F6C9700BDD17D /* missingImage.tiff in Resources */ = {isa = PBXBuildFile; fileRef = AB4261D70A2F6C9700BDD17D /* missingImage.tiff */; };
                AB4CB4EB0B8BDA3D009F40B0 /* JSHTMLSelectElementCustom.h in Headers */ = {isa = PBXBuildFile; fileRef = AB4CB4EA0B8BDA3D009F40B0 /* JSHTMLSelectElementCustom.h */; };
                AB67D1A8097F3AE300F9392E /* RenderTextControl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AB67D1A6097F3AE300F9392E /* RenderTextControl.cpp */; };
                AB67D1A9097F3AE300F9392E /* RenderTextControl.h in Headers */ = {isa = PBXBuildFile; fileRef = AB67D1A7097F3AE300F9392E /* RenderTextControl.h */; };
                E4D687790ED7AE4F006EA978 /* PurgeableBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = E4D687780ED7AE4F006EA978 /* PurgeableBuffer.h */; };
                E4EEFFC80D34550C00469A58 /* JSAudioConstructor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4EEFFC60D34550C00469A58 /* JSAudioConstructor.cpp */; };
                E4EEFFC90D34550C00469A58 /* JSAudioConstructor.h in Headers */ = {isa = PBXBuildFile; fileRef = E4EEFFC70D34550C00469A58 /* JSAudioConstructor.h */; };
-               ED048ABC0833F132006E1E67 /* textAreaResizeCorner.tiff in Resources */ = {isa = PBXBuildFile; fileRef = ED048ABB0833F132006E1E67 /* textAreaResizeCorner.tiff */; };
                ED2BA83C09A24B91006C0AC4 /* DocumentMarker.h in Headers */ = {isa = PBXBuildFile; fileRef = ED2BA83B09A24B91006C0AC4 /* DocumentMarker.h */; settings = {ATTRIBUTES = (Private, ); }; };
                ED501DC60B249F2900AE18D9 /* EditorMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = ED501DC50B249F2900AE18D9 /* EditorMac.mm */; };
                EDE3A5000C7A430600956A37 /* ColorMac.h in Headers */ = {isa = PBXBuildFile; fileRef = EDE3A4FF0C7A430600956A37 /* ColorMac.h */; settings = {ATTRIBUTES = (Private, ); }; };
                1AFE118C0CBFFC4E003017FA /* SQLResultSetRowList.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = SQLResultSetRowList.idl; sourceTree = "<group>"; };
                1AFE11970CBFFCC4003017FA /* JSSQLResultSetRowList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSQLResultSetRowList.cpp; sourceTree = "<group>"; };
                1AFE11980CBFFCC4003017FA /* JSSQLResultSetRowList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSQLResultSetRowList.h; sourceTree = "<group>"; };
-               1C14E7690AD8C81C00B6158B /* deleteButtonPressed.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = deleteButtonPressed.tiff; sourceTree = "<group>"; };
-               1C14E76A0AD8C81C00B6158B /* deleteButton.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = deleteButton.tiff; sourceTree = "<group>"; };
                1C2649790D7E248A00BD10F2 /* DocumentLoaderMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DocumentLoaderMac.cpp; sourceTree = "<group>"; };
                1C26497B0D7E24EC00BD10F2 /* PageMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PageMac.cpp; sourceTree = "<group>"; };
                1C4C8EFF0AD85D87009475CE /* DeleteButtonController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DeleteButtonController.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                72626E010EF022FE00A07E20 /* FontFastPath.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FontFastPath.cpp; sourceTree = "<group>"; };
                750D029111D0E7F300BD1B27 /* RenderInputSpeech.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderInputSpeech.cpp; sourceTree = "<group>"; };
                750D029211D0E7F300BD1B27 /* RenderInputSpeech.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderInputSpeech.h; sourceTree = "<group>"; };
-               750D02C011D0EE7D00BD1B27 /* inputSpeech.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = inputSpeech.tiff; sourceTree = "<group>"; };
                7535BC9212020CFF0037EC45 /* SpeechInputClientMock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SpeechInputClientMock.cpp; path = mock/SpeechInputClientMock.cpp; sourceTree = "<group>"; };
                7535BC9312020CFF0037EC45 /* SpeechInputClientMock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SpeechInputClientMock.h; path = mock/SpeechInputClientMock.h; sourceTree = "<group>"; };
                754133A7102E00E800075D00 /* InspectorTimelineAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorTimelineAgent.h; sourceTree = "<group>"; };
                9307F1D60AF2D59000DBA31A /* HitTestResult.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HitTestResult.h; sourceTree = "<group>"; };
                930908900AF7EDE40081DF01 /* HitTestRequest.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HitTestRequest.h; sourceTree = "<group>"; };
                930FC6891072B9280045293E /* TextRenderingMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextRenderingMode.h; sourceTree = "<group>"; };
+               93153BCC1417FBBF00FCF5BE /* deleteButton@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "deleteButton@2x.png"; sourceTree = "<group>"; };
+               93153BCE1417FBDB00FCF5BE /* deleteButtonPressed@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "deleteButtonPressed@2x.png"; sourceTree = "<group>"; };
+               93153BD914181F7A00FCF5BE /* missingImage@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "missingImage@2x.png"; sourceTree = "<group>"; };
+               93153BDB141959BB00FCF5BE /* textAreaResizeCorner.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = textAreaResizeCorner.png; sourceTree = "<group>"; };
+               93153BDD141959F400FCF5BE /* deleteButton.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = deleteButton.png; sourceTree = "<group>"; };
+               93153BDF14195A2800FCF5BE /* deleteButtonPressed.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = deleteButtonPressed.png; sourceTree = "<group>"; };
+               93153BE114195A5700FCF5BE /* missingImage.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = missingImage.png; sourceTree = "<group>"; };
+               93153BE314195B2900FCF5BE /* inputSpeech.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = inputSpeech.png; sourceTree = "<group>"; };
                931BCC601124DFCB00BE70DD /* MediaCanStartListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaCanStartListener.h; sourceTree = "<group>"; };
                9327A94109968D1A0068A546 /* HTMLOptionsCollection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLOptionsCollection.cpp; sourceTree = "<group>"; };
                932871BF0B20DEB70049035A /* PlatformMenuDescription.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PlatformMenuDescription.h; sourceTree = "<group>"; };
                9363B62A0F8E8FE000803810 /* HistoryPropertyList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HistoryPropertyList.cpp; sourceTree = "<group>"; };
                9363B62B0F8E8FE000803810 /* HistoryPropertyList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HistoryPropertyList.h; sourceTree = "<group>"; };
                936DD03A09CEAC270056AE8C /* Range.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Range.idl; sourceTree = "<group>"; };
+               9370918C1416D86B00477333 /* textAreaResizeCorner@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "textAreaResizeCorner@2x.png"; sourceTree = "<group>"; };
                93799EF60BF2743600D0F230 /* RenderWordBreak.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderWordBreak.cpp; sourceTree = "<group>"; };
                93799EF70BF2743600D0F230 /* RenderWordBreak.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderWordBreak.h; sourceTree = "<group>"; };
                9380F47109A11AB4001FDB34 /* Widget.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Widget.cpp; sourceTree = "<group>"; };
                AB247A6A0AFD6383003FA5FD /* RenderSlider.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSlider.cpp; sourceTree = "<group>"; };
                AB247A6B0AFD6383003FA5FD /* RenderSlider.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RenderSlider.h; sourceTree = "<group>"; };
                AB31C91D10AE1B8E000C7B92 /* LineClampValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LineClampValue.h; path = style/LineClampValue.h; sourceTree = "<group>"; };
-               AB4261D70A2F6C9700BDD17D /* missingImage.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = missingImage.tiff; sourceTree = "<group>"; };
                AB4CB4EA0B8BDA3D009F40B0 /* JSHTMLSelectElementCustom.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSHTMLSelectElementCustom.h; sourceTree = "<group>"; };
                AB67D1A6097F3AE300F9392E /* RenderTextControl.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = RenderTextControl.cpp; sourceTree = "<group>"; };
                AB67D1A7097F3AE300F9392E /* RenderTextControl.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RenderTextControl.h; sourceTree = "<group>"; };
                E4D687780ED7AE4F006EA978 /* PurgeableBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PurgeableBuffer.h; sourceTree = "<group>"; };
                E4EEFFC60D34550C00469A58 /* JSAudioConstructor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSAudioConstructor.cpp; sourceTree = "<group>"; };
                E4EEFFC70D34550C00469A58 /* JSAudioConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSAudioConstructor.h; sourceTree = "<group>"; };
-               ED048ABB0833F132006E1E67 /* textAreaResizeCorner.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = textAreaResizeCorner.tiff; sourceTree = "<group>"; };
                ED2BA83B09A24B91006C0AC4 /* DocumentMarker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DocumentMarker.h; sourceTree = "<group>"; };
                ED501DC50B249F2900AE18D9 /* EditorMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; name = EditorMac.mm; path = mac/EditorMac.mm; sourceTree = "<group>"; };
                EDE3A4FF0C7A430600956A37 /* ColorMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ColorMac.h; sourceTree = "<group>"; };
                                46D4F2460AF97E810035385A /* cellCursor.png */,
                                46D4F2470AF97E810035385A /* contextMenuCursor.png */,
                                4614A1FD0B23A8D600446E1C /* copyCursor.png */,
-                               1C14E76A0AD8C81C00B6158B /* deleteButton.tiff */,
-                               1C14E7690AD8C81C00B6158B /* deleteButtonPressed.tiff */,
+                               93153BDD141959F400FCF5BE /* deleteButton.png */,
+                               93153BCC1417FBBF00FCF5BE /* deleteButton@2x.png */,
+                               93153BDF14195A2800FCF5BE /* deleteButtonPressed.png */,
+                               93153BCE1417FBDB00FCF5BE /* deleteButtonPressed@2x.png */,
                                85136C890AED665800F90A3D /* eastResizeCursor.png */,
                                85136C8A0AED665800F90A3D /* eastWestResizeCursor.png */,
                                85136C8B0AED665800F90A3D /* helpCursor.png */,
-                               750D02C011D0EE7D00BD1B27 /* inputSpeech.tiff */,
+                               93153BE314195B2900FCF5BE /* inputSpeech.png */,
                                85136C8C0AED665800F90A3D /* linkCursor.png */,
                                BCAD1808131C7A0D00990406 /* Localizable.strings */,
-                               AB4261D70A2F6C9700BDD17D /* missingImage.tiff */,
+                               93153BE114195A5700FCF5BE /* missingImage.png */,
+                               93153BD914181F7A00FCF5BE /* missingImage@2x.png */,
                                85136C8D0AED665800F90A3D /* moveCursor.png */,
                                46F9D5DB0B0D60170028EE36 /* noDropCursor.png */,
                                46BD16E20B279473001F0839 /* noneCursor.png */,
                                85136C940AED665900F90A3D /* southEastResizeCursor.png */,
                                85136C950AED665900F90A3D /* southResizeCursor.png */,
                                85136C960AED665900F90A3D /* southWestResizeCursor.png */,
-                               ED048ABB0833F132006E1E67 /* textAreaResizeCorner.tiff */,
+                               93153BDB141959BB00FCF5BE /* textAreaResizeCorner.png */,
+                               9370918C1416D86B00477333 /* textAreaResizeCorner@2x.png */,
                                46D4F2480AF97E810035385A /* verticalTextCursor.png */,
                                85136C970AED665900F90A3D /* waitCursor.png */,
                                85136C980AED665900F90A3D /* westResizeCursor.png */,
                                46D4F2490AF97E810035385A /* cellCursor.png in Resources */,
                                46D4F24A0AF97E810035385A /* contextMenuCursor.png in Resources */,
                                4614A1FE0B23A8D600446E1C /* copyCursor.png in Resources */,
-                               1C14E76C0AD8C81C00B6158B /* deleteButton.tiff in Resources */,
-                               1C14E76B0AD8C81C00B6158B /* deleteButtonPressed.tiff in Resources */,
                                85136C990AED665900F90A3D /* eastResizeCursor.png in Resources */,
                                85136C9A0AED665900F90A3D /* eastWestResizeCursor.png in Resources */,
                                85136C9B0AED665900F90A3D /* helpCursor.png in Resources */,
-                               750D02C111D0EE7D00BD1B27 /* inputSpeech.tiff in Resources */,
                                85136C9C0AED665900F90A3D /* linkCursor.png in Resources */,
                                BCAD180A131C7A0D00990406 /* Localizable.strings in Resources */,
                                1CDC14050DD3934C006EACD3 /* localizedStrings.js in Resources */,
-                               AB4261D80A2F6C9700BDD17D /* missingImage.tiff in Resources */,
                                85136C9D0AED665900F90A3D /* moveCursor.png in Resources */,
                                46F9D5DE0B0D60170028EE36 /* noDropCursor.png in Resources */,
                                46BD16E30B279473001F0839 /* noneCursor.png in Resources */,
                                85136CA40AED665900F90A3D /* southEastResizeCursor.png in Resources */,
                                85136CA50AED665900F90A3D /* southResizeCursor.png in Resources */,
                                85136CA60AED665900F90A3D /* southWestResizeCursor.png in Resources */,
-                               ED048ABC0833F132006E1E67 /* textAreaResizeCorner.tiff in Resources */,
                                46D4F24B0AF97E810035385A /* verticalTextCursor.png in Resources */,
                                85136CA70AED665900F90A3D /* waitCursor.png in Resources */,
                                85136CA80AED665900F90A3D /* westResizeCursor.png in Resources */,
                                1AB1AE7A0C051FDE00139F4F /* zoomInCursor.png in Resources */,
                                1AB1AE7B0C051FDE00139F4F /* zoomOutCursor.png in Resources */,
+                               9370918D1416D86B00477333 /* textAreaResizeCorner@2x.png in Resources */,
+                               93153BCD1417FBBF00FCF5BE /* deleteButton@2x.png in Resources */,
+                               93153BCF1417FBDB00FCF5BE /* deleteButtonPressed@2x.png in Resources */,
+                               93153BDA14181F7A00FCF5BE /* missingImage@2x.png in Resources */,
+                               93153BDC141959BC00FCF5BE /* textAreaResizeCorner.png in Resources */,
+                               93153BDE141959F400FCF5BE /* deleteButton.png in Resources */,
+                               93153BE014195A2800FCF5BE /* deleteButtonPressed.png in Resources */,
+                               93153BE214195A5700FCF5BE /* missingImage.png in Resources */,
+                               93153BE414195B2A00FCF5BE /* inputSpeech.png in Resources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
index aeacee2..f700684 100644 (file)
@@ -41,6 +41,7 @@
 #include "HTMLNames.h"
 #include "Image.h"
 #include "Node.h"
+#include "Page.h"
 #include "Range.h"
 #include "RemoveNodeCommand.h"
 #include "RenderBox.h"
@@ -240,7 +241,13 @@ void DeleteButtonController::createDeletionUI()
     style->setProperty(CSSPropertyHeight, String::number(buttonHeight) + "px");
     style->setProperty(CSSPropertyVisibility, CSSValueVisible);
 
-    RefPtr<Image> buttonImage = Image::loadPlatformResource("deleteButton");
+    float deviceScaleFactor = Page::deviceScaleFactor(m_frame);
+    RefPtr<Image> buttonImage;
+    if (deviceScaleFactor >= 2)
+        buttonImage = Image::loadPlatformResource("deleteButton@2x");
+    else
+        buttonImage = Image::loadPlatformResource("deleteButton");
+
     if (buttonImage->isNull())
         return;
 
index e122792..d4a834f 100644 (file)
@@ -113,18 +113,27 @@ void CachedImage::allClientsRemoved()
         m_decodedDataDeletionTimer.startOneShot(interval);
 }
 
-static Image* brokenImage()
+Image* CachedImage::brokenImage(float deviceScaleFactor) const
 {
-    DEFINE_STATIC_LOCAL(RefPtr<Image>, brokenImage, (Image::loadPlatformResource("missingImage")));
-    return brokenImage.get();
+    if (deviceScaleFactor >= 2) {
+        DEFINE_STATIC_LOCAL(Image*, brokenImageHiRes, (Image::loadPlatformResource("missingImage@2x").leakRef()));
+        return brokenImageHiRes;
+    }
+
+    DEFINE_STATIC_LOCAL(Image*, brokenImageLoRes, (Image::loadPlatformResource("missingImage").leakRef()));
+    return brokenImageLoRes;
 }
 
 Image* CachedImage::image() const
 {
     ASSERT(!isPurgeable());
 
-    if (errorOccurred() && m_shouldPaintBrokenImage)
-        return brokenImage();
+    if (errorOccurred() && m_shouldPaintBrokenImage) {
+        // Returning the 1x broken image is non-ideal, but we cannot reliably access the appropriate
+        // deviceScaleFactor from here. It is critical that callers use CachedImage::brokenImage() 
+        // when they need the real, deviceScaleFactor-appropriate broken image icon. 
+        return brokenImage(1);
+    }
 
     if (m_image)
         return m_image.get();
index 291c24e..29d4214 100644 (file)
@@ -47,6 +47,8 @@ public:
     Image* image() const; // Returns the nullImage() if the image is not available yet.
     bool hasImage() const { return m_image.get(); }
 
+    Image* brokenImage(float deviceScaleFactor) const;
+
     bool canRender(float multiplier) const { return !errorOccurred() && !imageSize(multiplier).isEmpty(); }
 
     // These are only used for SVGImage right now
index 4072c90..96d75db 100644 (file)
@@ -652,6 +652,16 @@ void Page::setDeviceScaleFactor(float scaleFactor)
     backForward()->markPagesForFullStyleRecalc();
 }
 
+float Page::deviceScaleFactor(Frame* frame)
+{
+    if (!frame)
+        return 1;
+    Page* page = frame->page();
+    if (!page)
+        return 1;
+    return page->deviceScaleFactor();
+}
+
 void Page::didMoveOnscreen()
 {
     for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNext()) {
index d5c2397..48512e0 100644 (file)
@@ -249,6 +249,7 @@ namespace WebCore {
 
         float deviceScaleFactor() const { return m_deviceScaleFactor; }
         void setDeviceScaleFactor(float);
+        static float deviceScaleFactor(Frame*);
 
         // Notifications when the Page starts and stops being presented via a native window.
         void didMoveOnscreen();
index 6ad3080..6dc7b93 100644 (file)
@@ -55,7 +55,7 @@ void BitmapImage::invalidatePlatformData()
 PassRefPtr<Image> Image::loadPlatformResource(const char *name)
 {
     NSBundle *bundle = [NSBundle bundleForClass:[WebCoreBundleFinder class]];
-    NSString *imagePath = [bundle pathForResource:[NSString stringWithUTF8String:name] ofType:@"tiff"];
+    NSString *imagePath = [bundle pathForResource:[NSString stringWithUTF8String:name] ofType:@"png"];
     NSData *namedImageData = [NSData dataWithContentsOfFile:imagePath];
     if (namedImageData) {
         RefPtr<Image> image = BitmapImage::create();
index 7ec53cf..be42bfb 100644 (file)
@@ -84,9 +84,11 @@ IntSize RenderImage::imageSizeForError(CachedImage* newImage) const
     ASSERT_ARG(newImage, newImage);
     ASSERT_ARG(newImage, newImage->image());
 
+    Image* brokenImage = newImage->brokenImage(Page::deviceScaleFactor(frame()));
+
     // imageSize() returns 0 for the error image. We need the true size of the
     // error image, so we have to get it by grabbing image() directly.
-    return IntSize(paddingWidth + newImage->image()->width() * style()->effectiveZoom(), paddingHeight + newImage->image()->height() * style()->effectiveZoom());
+    return IntSize(paddingWidth + brokenImage->width() * style()->effectiveZoom(), paddingHeight + brokenImage->height() * style()->effectiveZoom());
 }
 
 // Sets the image height and width to fit the alt text.  Returns true if the
@@ -268,15 +270,21 @@ void RenderImage::paintReplaced(PaintInfo& paintInfo, const LayoutPoint& paintOf
             RefPtr<Image> image = m_imageResource->image();
 
             if (m_imageResource->errorOccurred() && !image->isNull() && usableWidth >= image->width() && usableHeight >= image->height()) {
+                float deviceScaleFactor = Page::deviceScaleFactor(frame());
+                // Call brokenImage() explicitly to ensure we get the broken image icon at the appropriate resolution.
+                image = m_imageResource->cachedImage()->brokenImage(deviceScaleFactor);
+                IntSize imageSize = image->size();
+                if (deviceScaleFactor >= 2)
+                    imageSize.scale(0.5);
                 // Center the error image, accounting for border and padding.
-                LayoutUnit centerX = (usableWidth - image->width()) / 2;
+                LayoutUnit centerX = (usableWidth - imageSize.width()) / 2;
                 if (centerX < 0)
                     centerX = 0;
-                LayoutUnit centerY = (usableHeight - image->height()) / 2;
+                LayoutUnit centerY = (usableHeight - imageSize.height()) / 2;
                 if (centerY < 0)
                     centerY = 0;
                 imageOffset = LayoutSize(leftBorder + leftPad + centerX + 1, topBorder + topPad + centerY + 1);
-                context->drawImage(image.get(), style()->colorSpace(), paintOffset + imageOffset);
+                context->drawImage(image.get(), style()->colorSpace(), IntRect(paintOffset + imageOffset, imageSize));
                 errorPictureDrawn = true;
             }
 
index 2469f22..e36cbd8 100644 (file)
@@ -2414,6 +2414,28 @@ void RenderLayer::paintScrollCorner(GraphicsContext* context, const LayoutPoint&
         context->fillRect(absRect, Color::white, box->style()->colorSpace());
 }
 
+void RenderLayer::drawPlatformResizerImage(GraphicsContext* context, LayoutRect resizerCornerRect)
+{
+    float deviceScaleFactor = Page::deviceScaleFactor(renderer()->frame());
+    printf("RenderLayer deviceScaleFactor=%f\n", deviceScaleFactor);
+
+    RefPtr<Image> resizeCornerImage;
+    IntSize cornerResizerSize;
+    if (deviceScaleFactor >= 2) {
+        DEFINE_STATIC_LOCAL(Image*, resizeCornerImageHiRes, (Image::loadPlatformResource("textAreaResizeCorner@2x").leakRef()));
+        resizeCornerImage = resizeCornerImageHiRes;
+        cornerResizerSize = resizeCornerImage->size();
+        cornerResizerSize.scale(0.5);
+    } else {
+        DEFINE_STATIC_LOCAL(Image*, resizeCornerImageLoRes, (Image::loadPlatformResource("textAreaResizeCorner").leakRef()));
+        resizeCornerImage = resizeCornerImageLoRes;
+        cornerResizerSize = resizeCornerImage->size();
+    }
+
+    IntRect imageRect(resizerCornerRect.maxXMaxYCorner() - cornerResizerSize, cornerResizerSize);
+    context->drawImage(resizeCornerImage.get(), renderer()->style()->colorSpace(), imageRect);
+}
+
 void RenderLayer::paintResizer(GraphicsContext* context, const LayoutPoint& paintOffset, const LayoutRect& damageRect)
 {
     if (renderer()->style()->resize() == RESIZE_NONE)
@@ -2437,10 +2459,7 @@ void RenderLayer::paintResizer(GraphicsContext* context, const LayoutPoint& pain
         return;
     }
 
-    // Paint the resizer control.
-    DEFINE_STATIC_LOCAL(RefPtr<Image>, resizeCornerImage, (Image::loadPlatformResource("textAreaResizeCorner")));
-    LayoutPoint imagePoint(absRect.maxX() - resizeCornerImage->width(), absRect.maxY() - resizeCornerImage->height());
-    context->drawImage(resizeCornerImage.get(), box->style()->colorSpace(), imagePoint);
+    drawPlatformResizerImage(context, absRect);
 
     // Draw a frame around the resizer (1px grey line) if there are any scrollbars present.
     // Clipping will exclude the right and bottom edges of this frame.
index f5597cd..a3f6da1 100644 (file)
@@ -611,6 +611,8 @@ private:
     void updateScrollCornerStyle();
     void updateResizerStyle();
 
+    void drawPlatformResizerImage(GraphicsContext*, LayoutRect resizerCornerRect);
+
     void updatePagination();
     bool isPaginated() const { return m_isPaginated; }