Changeset 166748 in webkit


Ignore:
Timestamp:
Apr 3, 2014 3:44:58 PM (10 years ago)
Author:
Simon Fraser
Message:

Source/WebCore: Pixelated WebView when display is changed from hiDPI to regularDPI
https://bugs.webkit.org/show_bug.cgi?id=131185

Reviewed by Tim Horton.

r166309 added a short circuit in GraphicsLayerCA::updateContentsScale()
when the scale didn't change. This broke layers which expected to
unconditionally receive a setContentsScale(), namely the WebTiledBackingLayer
which owns the TileController. WebTiledBackingLayer overrode -setContentsScale:
to pass the scale down to the TileController; however, it didn't override
-contentsScale, and it mucked with the scale passed in.

Fix by having setting and fetching contentsScale on a WebTiledBackingLayer
work as expected. Also rename the TileController functions to mirror the
CALayer functions better.

  • WebCore.exp.in:
  • platform/graphics/ca/GraphicsLayerCA.cpp:

(WebCore::GraphicsLayerCA::updateContentsScale):

  • platform/graphics/ca/mac/TileController.h:
  • platform/graphics/ca/mac/TileController.mm:

(WebCore::TileController::TileController):
(WebCore::TileController::contentsScale):
(WebCore::TileController::setContentsScale):
(WebCore::TileController::scale): Deleted.
(WebCore::TileController::setScale): Deleted.

  • platform/graphics/ca/mac/WebTiledBackingLayer.mm:

(-[WebTiledBackingLayer setContentsScale:]):
(-[WebTiledBackingLayer contentsScale]):

Source/WebKit2: Pixelated WebView when display is changed from hiDPI to regularDPI
https://bugs.webkit.org/show_bug.cgi?id=131185
<rdar://problem/16512184&16503714>

Reviewed by Tim Horton.

TileController function was renamed.

  • WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp:

(WebKit::PlatformCALayerRemoteTiledBacking::setContentsScale):

Location:
trunk/Source
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r166747 r166748  
     12014-04-03  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Pixelated WebView when display is changed from hiDPI to regularDPI
     4        https://bugs.webkit.org/show_bug.cgi?id=131185
     5
     6        Reviewed by Tim Horton.
     7
     8        r166309 added a short circuit in GraphicsLayerCA::updateContentsScale()
     9        when the scale didn't change. This broke layers which expected to
     10        unconditionally receive a setContentsScale(), namely the WebTiledBackingLayer
     11        which owns the TileController. WebTiledBackingLayer overrode -setContentsScale:
     12        to pass the scale down to the TileController; however, it didn't override
     13        -contentsScale, and it mucked with the scale passed in.
     14       
     15        Fix by having setting and fetching contentsScale on a WebTiledBackingLayer
     16        work as expected. Also rename the TileController functions to mirror the
     17        CALayer functions better.
     18
     19        * WebCore.exp.in:
     20        * platform/graphics/ca/GraphicsLayerCA.cpp:
     21        (WebCore::GraphicsLayerCA::updateContentsScale):
     22        * platform/graphics/ca/mac/TileController.h:
     23        * platform/graphics/ca/mac/TileController.mm:
     24        (WebCore::TileController::TileController):
     25        (WebCore::TileController::contentsScale):
     26        (WebCore::TileController::setContentsScale):
     27        (WebCore::TileController::scale): Deleted.
     28        (WebCore::TileController::setScale): Deleted.
     29        * platform/graphics/ca/mac/WebTiledBackingLayer.mm:
     30        (-[WebTiledBackingLayer setContentsScale:]):
     31        (-[WebTiledBackingLayer contentsScale]):
     32
    1332014-04-03  Zoltan Horvath  <zoltan@webkit.org>
    234
  • trunk/Source/WebCore/WebCore.exp.in

    r166741 r166748  
    433433__ZN7WebCore14TileController15containerLayersEv
    434434__ZN7WebCore14TileController15setNeedsDisplayEv
     435__ZN7WebCore14TileController16setContentsScaleEf
    435436__ZN7WebCore14TileController21setAcceleratesDrawingEb
    436437__ZN7WebCore14TileController21setNeedsDisplayInRectERKNS_7IntRectE
     
    439440__ZN7WebCore14TileController27tileCacheLayerBoundsChangedEv
    440441__ZN7WebCore14TileController6createEPNS_15PlatformCALayerE
    441 __ZN7WebCore14TileController8setScaleEf
    442442__ZN7WebCore14decodeHostNameEP8NSString
    443443__ZN7WebCore14encodeHostNameEP8NSString
  • trunk/Source/WebCore/platform/graphics/ca/mac/TileController.h

    r166654 r166748  
    6060    void setNeedsDisplayInRect(const IntRect&);
    6161
    62     void setScale(float);
    63     float scale() const;
     62    void setContentsScale(float);
     63    float contentsScale() const { return m_contentsScale; }
    6464
    6565    bool acceleratesDrawing() const { return m_acceleratesDrawing; }
     
    192192    RepaintCountMap m_tileRepaintCounts;
    193193
     194    float m_contentsScale;
    194195    float m_deviceScaleFactor;
    195196
  • trunk/Source/WebCore/platform/graphics/ca/mac/TileController.mm

    r166654 r166748  
    6161    , m_exposedRect(FloatRect::infiniteRect())
    6262    , m_tileRevalidationTimer(this, &TileController::tileRevalidationTimerFired)
     63    , m_contentsScale(1)
    6364    , m_deviceScaleFactor(1)
    6465    , m_tileCoverage(CoverageForVisibleArea)
     
    157158}
    158159
    159 float TileController::scale() const
    160 {
    161     return tileGrid().scale();
    162 }
    163 
    164 void TileController::setScale(float scale)
    165 {
     160void TileController::setContentsScale(float scale)
     161{
     162    m_contentsScale = scale;
     163   
    166164    ASSERT(owningGraphicsLayer()->isCommittingChanges());
    167165
  • trunk/Source/WebCore/platform/graphics/ca/mac/WebTiledBackingLayer.mm

    r165676 r166748  
    116116- (void)setContentsScale:(CGFloat)contentsScale
    117117{
    118     _tileController->setScale(contentsScale);
     118    _tileController->setContentsScale(contentsScale);
     119}
     120
     121- (CGFloat)contentsScale
     122{
     123    return _tileController->contentsScale();
    119124}
    120125
  • trunk/Source/WebKit2/ChangeLog

    r166744 r166748  
     12014-04-03  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Pixelated WebView when display is changed from hiDPI to regularDPI
     4        https://bugs.webkit.org/show_bug.cgi?id=131185
     5        <rdar://problem/16512184&16503714>
     6
     7        Reviewed by Tim Horton.
     8       
     9        TileController function was renamed.
     10
     11        * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp:
     12        (WebKit::PlatformCALayerRemoteTiledBacking::setContentsScale):
     13
    1142014-04-03  Sam Weinig  <sam@webkit.org>
    215
  • trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp

    r166654 r166748  
    8989void PlatformCALayerRemoteTiledBacking::setContentsScale(float scale)
    9090{
    91     m_tileController->setScale(scale);
     91    m_tileController->setContentsScale(scale);
    9292}
    9393
Note: See TracChangeset for help on using the changeset viewer.