OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 1889 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1900 void WebViewImpl::themeChanged() | 1900 void WebViewImpl::themeChanged() |
1901 { | 1901 { |
1902 if (!page()) | 1902 if (!page()) |
1903 return; | 1903 return; |
1904 FrameView* view = page()->mainFrame()->view(); | 1904 FrameView* view = page()->mainFrame()->view(); |
1905 | 1905 |
1906 WebRect damagedRect(0, 0, m_size.width, m_size.height); | 1906 WebRect damagedRect(0, 0, m_size.width, m_size.height); |
1907 view->invalidateRect(damagedRect); | 1907 view->invalidateRect(damagedRect); |
1908 } | 1908 } |
1909 | 1909 |
1910 void WebViewImpl::setNeedsRedraw() | |
1911 { | |
1912 if (m_layerTreeView && isAcceleratedCompositingActive()) | |
1913 m_layerTreeView->setNeedsRedraw(); | |
1914 } | |
1915 | |
1916 void WebViewImpl::enterFullScreenForElement(WebCore::Element* element) | 1910 void WebViewImpl::enterFullScreenForElement(WebCore::Element* element) |
1917 { | 1911 { |
1918 m_fullscreenController->enterFullScreenForElement(element); | 1912 m_fullscreenController->enterFullScreenForElement(element); |
1919 } | 1913 } |
1920 | 1914 |
1921 void WebViewImpl::exitFullScreenForElement(WebCore::Element* element) | 1915 void WebViewImpl::exitFullScreenForElement(WebCore::Element* element) |
1922 { | 1916 { |
1923 m_fullscreenController->exitFullScreenForElement(element); | 1917 m_fullscreenController->exitFullScreenForElement(element); |
1924 } | 1918 } |
1925 | 1919 |
(...skipping 1932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3858 else | 3852 else |
3859 m_layerTreeView->clearViewportLayers(); | 3853 m_layerTreeView->clearViewportLayers(); |
3860 } | 3854 } |
3861 } | 3855 } |
3862 | 3856 |
3863 suppressInvalidations(false); | 3857 suppressInvalidations(false); |
3864 } | 3858 } |
3865 | 3859 |
3866 void WebViewImpl::scheduleCompositingLayerSync() | 3860 void WebViewImpl::scheduleCompositingLayerSync() |
3867 { | 3861 { |
3868 m_layerTreeView->setNeedsRedraw(); | 3862 m_layerTreeView->setNeedsAnimate(); |
3869 } | 3863 } |
3870 | 3864 |
3871 void WebViewImpl::scrollRootLayerRect(const IntSize&, const IntRect&) | 3865 void WebViewImpl::scrollRootLayerRect(const IntSize&, const IntRect&) |
3872 { | 3866 { |
3873 updateLayerTreeViewport(); | 3867 updateLayerTreeViewport(); |
3874 } | 3868 } |
3875 | 3869 |
3876 void WebViewImpl::invalidateRect(const IntRect& rect) | 3870 void WebViewImpl::invalidateRect(const IntRect& rect) |
3877 { | 3871 { |
3878 if (m_isAcceleratedCompositingActive) { | 3872 if (m_isAcceleratedCompositingActive) { |
(...skipping 24 matching lines...) Expand all Loading... | |
3903 m_layerTreeView->registerForAnimations(layer); | 3897 m_layerTreeView->registerForAnimations(layer); |
3904 } | 3898 } |
3905 | 3899 |
3906 WebCore::GraphicsLayer* WebViewImpl::rootGraphicsLayer() | 3900 WebCore::GraphicsLayer* WebViewImpl::rootGraphicsLayer() |
3907 { | 3901 { |
3908 return m_rootGraphicsLayer; | 3902 return m_rootGraphicsLayer; |
3909 } | 3903 } |
3910 | 3904 |
3911 void WebViewImpl::scheduleAnimation() | 3905 void WebViewImpl::scheduleAnimation() |
3912 { | 3906 { |
3913 if (isAcceleratedCompositingActive() && Platform::current()->isThreadedCompo sitingEnabled()) { | 3907 if (isAcceleratedCompositingActive()) { |
3914 ASSERT(m_layerTreeView); | 3908 ASSERT(m_layerTreeView); |
3915 m_layerTreeView->setNeedsAnimate(); | 3909 m_layerTreeView->setNeedsAnimate(); |
3916 return; | 3910 return; |
3917 } | 3911 } |
3918 if (m_client) | 3912 if (m_client) |
jamesr
2013/11/21 23:59:33
since m_client here is the RenderWidget which know
trchen
2013/11/22 00:15:32
For single thread mode that would be an infinite r
| |
3919 m_client->scheduleAnimation(); | 3913 m_client->scheduleAnimation(); |
3920 } | 3914 } |
3921 | 3915 |
3922 void WebViewImpl::setIsAcceleratedCompositingActive(bool active) | 3916 void WebViewImpl::setIsAcceleratedCompositingActive(bool active) |
3923 { | 3917 { |
3924 blink::Platform::current()->histogramEnumeration("GPU.setIsAcceleratedCompos itingActive", active * 2 + m_isAcceleratedCompositingActive, 4); | 3918 blink::Platform::current()->histogramEnumeration("GPU.setIsAcceleratedCompos itingActive", active * 2 + m_isAcceleratedCompositingActive, 4); |
3925 | 3919 |
3926 if (m_isAcceleratedCompositingActive == active) | 3920 if (m_isAcceleratedCompositingActive == active) |
3927 return; | 3921 return; |
3928 | 3922 |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4177 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints(); | 4171 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints(); |
4178 | 4172 |
4179 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) | 4173 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) |
4180 return false; | 4174 return false; |
4181 | 4175 |
4182 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width | 4176 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width |
4183 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); | 4177 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); |
4184 } | 4178 } |
4185 | 4179 |
4186 } // namespace blink | 4180 } // namespace blink |
OLD | NEW |