Grammar markers are not updated when switching between 1x and 2x
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 21 Oct 2013 21:31:28 +0000 (21:31 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 21 Oct 2013 21:31:28 +0000 (21:31 +0000)
commit8c32c11ea1c7f047596a03874288c53d86344c56
tree5773e6e2021c926fd6563cf14fa3d46b755bf537
parentc7313b0c75587ae780440283dbb55951726a1b65
Grammar markers are not updated when switching between 1x and 2x
https://bugs.webkit.org/show_bug.cgi?id=122146

Patch by Myles C. Maxfield <mmaxfield@apple.com> on 2013-10-21
Reviewed by Dean Jackson.

Source/WebCore:

When running editing/spelling/grammar-markers-hidpi.html, the 2x
grammar/spelling dot resources are cached. If you then run
editing/spelling/grammar-markers.html without tearing down WebKit,
it re-uses the 2x dots. The difference between the two tests is a call
to testRunner.setBackingScaleFactor().

We create a NSColor from an NSImage, and remember it in a static
variable. However, NSColor inspects the current graphics context to
determine which resolution to use, and then remembers that decision.
Therefore, we want to recreate the NSColor whenever the device pixel
ratio changes. This patch adds a new static function to GraphicsContext
which recreates this NSColor every time the ratio changes.

Tests: editing/spelling/grammar-markers.html
       editing/spelling/inline_spelling_markers.html

* platform/graphics/mac/GraphicsContextMac.mm:
(WebCore::makePattern):
(WebCore::GraphicsContext::drawLineForDocumentMarker):

LayoutTests:

* platform/mac/editing/spelling/grammar-markers-expected.png:
* platform/mac/editing/spelling/inline_spelling_markers-expected.png:

* platform/graphics/mac/GraphicsContextMac.mm:
(WebCore::makePattern):
(WebCore::GraphicsContext::drawLineForDocumentMarker):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@157739 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/platform/mac/editing/spelling/grammar-markers-expected.png
LayoutTests/platform/mac/editing/spelling/inline_spelling_markers-expected.png
Source/WebCore/ChangeLog
Source/WebCore/page/Page.cpp
Source/WebCore/platform/graphics/GraphicsContext.h
Source/WebCore/platform/graphics/blackberry/PathBlackBerry.cpp
Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
Source/WebCore/platform/graphics/mac/GraphicsContextMac.mm
Source/WebCore/platform/graphics/win/GraphicsContextCGWin.cpp
Source/WebCore/platform/graphics/wince/GraphicsContextWinCE.cpp