Skip to content
  • commit-queue@webkit.org's avatar
    [chromium] Store the contents scale factor in PlatformContextSkia on initialization · ba2dac26
    commit-queue@webkit.org authored
    https://bugs.webkit.org/show_bug.cgi?id=96137
    
    Patch by Terry Anderson <tdanderson@chromium.org> on 2012-09-19
    Reviewed by Stephen White.
    
    Source/WebCore:
    
    When the compositor creates a PlatformContextSkia, the scale on |canvas| will
    be equal to the content scale factor (which, without pinch-to-zoom, will be
    the same as the device scale factor). Set this value as a member on PlatformContextSkia,
    which will be used to correctly render glyphs when hinting is used and the device
    scale factor is not 1.
    
    Tests: added two new unit tests.
    
    * platform/graphics/chromium/OpaqueRectTrackingContentLayerDelegate.cpp:
    (WebCore::OpaqueRectTrackingContentLayerDelegate::paintContents):
    * platform/graphics/skia/PlatformContextSkia.cpp:
    (WebCore::PlatformContextSkia::PlatformContextSkia):
    (WebCore::PlatformContextSkia::setupPaintCommon):
    * platform/graphics/skia/PlatformContextSkia.h:
    (PlatformContextSkia):
    (WebCore::PlatformContextSkia::setHintingScaleFactor):
    (WebCore::PlatformContextSkia::hintingScaleFactor):
    
    Source/WebKit/chromium:
    
    Define SK_SUPPORT_HINTING_SCALE_FACTOR by default. This is also used
    for the skia patch here: https://codereview.appspot.com/6506099/.
    Also added two new unit tests.
    
    * features.gypi:
    * tests/OpaqueRectTrackingContentLayerDelegateTest.cpp:
    (WebCore):
    (WebCore::HintingScaleCallback::HintingScaleCallback):
    (HintingScaleCallback):
    (WebCore::HintingScaleCallback::operator()):
    (WebCore::TEST_F):
    * tests/PlatformContextSkiaTest.cpp:
    (WebCore):
    (WebCore::TEST):
    
    LayoutTests:
    
    These tests will fail due to a font hinting/rasterization issue with
    chromium DRT pixel tests having a page/device scale factor of 2.
    See crbug.com/150682.
    
    * platform/chromium/TestExpectations:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@129054 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    ba2dac26