Ignore:
Timestamp:
02/16/12 21:58:38 (3 years ago)
Author:
commit-queue@webkit.org
Message:

[chromium] Bundle page scale factor and limits in CCLayerTreeHost
https://bugs.webkit.org/show_bug.cgi?id=78762

Setting page scale factor and its limits in separate methods
may cause clamping bugs if one of them makes it to the
impl thread before the other. Change the API to bundle them together,
which matches the existing impl-side interface.

Patch by Alexandre Elias <aelias@google.com> on 2012-02-16
Reviewed by James Robinson.

Source/WebCore:

No new tests (API change will disallow this type of bug).

  • platform/graphics/chromium/cc/CCLayerTreeHost.cpp:

(WebCore::CCLayerTreeHost::CCLayerTreeHost):
(WebCore::CCLayerTreeHost::finishCommitOnImplThread):
(WebCore::CCLayerTreeHost::setPageScaleFactorAndLimits):

  • platform/graphics/chromium/cc/CCLayerTreeHost.h:

(CCLayerTreeHost):

Source/WebKit/chromium:

  • src/WebViewImpl.cpp:

(WebKit::WebViewImpl::computePageScaleFactorLimits):
(WebKit::WebViewImpl::setIsAcceleratedCompositingActive):
(WebKit::WebViewImpl::updateLayerTreeViewport):

  • tests/CCLayerTreeHostTest.cpp:

(WTF::CCLayerTreeHostTestStartPageScaleAnimation::applyScrollAndScale):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp

    r108013 r108031  
    7070    , m_visible(true) 
    7171    , m_haveWheelEventHandlers(false) 
    72     , m_pageScale(1) 
    73     , m_minPageScale(1) 
    74     , m_maxPageScale(1) 
     72    , m_pageScaleFactor(1) 
     73    , m_minPageScaleFactor(1) 
     74    , m_maxPageScaleFactor(1) 
    7575    , m_triggerIdlePaints(true) 
    7676    , m_partialTextureUpdateRequests(0) 
     
    180180    hostImpl->setHaveWheelEventHandlers(m_haveWheelEventHandlers); 
    181181    hostImpl->setViewportSize(viewportSize()); 
    182     hostImpl->setPageScaleFactorAndLimits(pageScale(), m_minPageScale, m_maxPageScale); 
     182    hostImpl->setPageScaleFactorAndLimits(m_pageScaleFactor, m_minPageScaleFactor, m_maxPageScaleFactor); 
    183183 
    184184    m_frameNumber++; 
     
    286286} 
    287287 
    288 void CCLayerTreeHost::setPageScale(float pageScale) 
    289 { 
    290     if (pageScale == m_pageScale) 
    291         return; 
    292  
    293     m_pageScale = pageScale; 
    294     setNeedsCommit(); 
    295 } 
    296  
    297 void CCLayerTreeHost::setPageScaleFactorLimits(float minScale, float maxScale) 
    298 { 
    299     if (minScale == m_minPageScale && maxScale == m_maxPageScale) 
    300         return; 
    301  
    302     m_minPageScale = minScale; 
    303     m_maxPageScale = maxScale; 
     288void CCLayerTreeHost::setPageScaleFactorAndLimits(float pageScaleFactor, float minPageScaleFactor, float maxPageScaleFactor) 
     289{ 
     290    if (pageScaleFactor == m_pageScaleFactor && minPageScaleFactor == m_minPageScaleFactor && maxPageScaleFactor == m_maxPageScaleFactor) 
     291        return; 
     292 
     293    m_pageScaleFactor = pageScaleFactor; 
     294    m_minPageScaleFactor = minPageScaleFactor; 
     295    m_maxPageScaleFactor = maxPageScaleFactor; 
    304296    setNeedsCommit(); 
    305297} 
Note: See TracChangeset for help on using the changeset viewer.