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 3710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3721 { | 3721 { |
3722 if (isAcceleratedCompositingActive()) { | 3722 if (isAcceleratedCompositingActive()) { |
3723 ASSERT(m_layerTreeView); | 3723 ASSERT(m_layerTreeView); |
3724 m_layerTreeView->setNeedsAnimate(); | 3724 m_layerTreeView->setNeedsAnimate(); |
3725 return; | 3725 return; |
3726 } | 3726 } |
3727 if (m_client) | 3727 if (m_client) |
3728 m_client->scheduleAnimation(); | 3728 m_client->scheduleAnimation(); |
3729 } | 3729 } |
3730 | 3730 |
| 3731 void WebViewImpl::setCompositorCreationFailed(bool failed) |
| 3732 { |
| 3733 m_compositorCreationFailed = failed; |
| 3734 // ChromeClientImpl::allowedCompositingTriggers reads this bit, so we need |
| 3735 // to update the composting triggers. |
| 3736 m_page->updateAcceleratedCompositingSettings(); |
| 3737 } |
| 3738 |
3731 void WebViewImpl::setIsAcceleratedCompositingActive(bool active) | 3739 void WebViewImpl::setIsAcceleratedCompositingActive(bool active) |
3732 { | 3740 { |
3733 blink::Platform::current()->histogramEnumeration("GPU.setIsAcceleratedCompos
itingActive", active * 2 + m_isAcceleratedCompositingActive, 4); | 3741 blink::Platform::current()->histogramEnumeration("GPU.setIsAcceleratedCompos
itingActive", active * 2 + m_isAcceleratedCompositingActive, 4); |
3734 | 3742 |
3735 if (m_isAcceleratedCompositingActive == active) | 3743 if (m_isAcceleratedCompositingActive == active) |
3736 return; | 3744 return; |
3737 | 3745 |
3738 if (!active) { | 3746 if (!active) { |
3739 m_isAcceleratedCompositingActive = false; | 3747 m_isAcceleratedCompositingActive = false; |
3740 // We need to finish all GL rendering before sending didDeactivateCompos
itor() to prevent | 3748 // We need to finish all GL rendering before sending didDeactivateCompos
itor() to prevent |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3774 updateLayerTreeBackgroundColor(); | 3782 updateLayerTreeBackgroundColor(); |
3775 m_layerTreeView->setHasTransparentBackground(isTransparent()); | 3783 m_layerTreeView->setHasTransparentBackground(isTransparent()); |
3776 #if USE(RUBBER_BANDING) | 3784 #if USE(RUBBER_BANDING) |
3777 RefPtr<Image> overhangImage = OverscrollTheme::theme()->getOverhangI
mage(); | 3785 RefPtr<Image> overhangImage = OverscrollTheme::theme()->getOverhangI
mage(); |
3778 if (overhangImage) | 3786 if (overhangImage) |
3779 m_layerTreeView->setOverhangBitmap(overhangImage->nativeImageFor
CurrentFrame()->bitmap()); | 3787 m_layerTreeView->setOverhangBitmap(overhangImage->nativeImageFor
CurrentFrame()->bitmap()); |
3780 #endif | 3788 #endif |
3781 updateLayerTreeViewport(); | 3789 updateLayerTreeViewport(); |
3782 m_client->didActivateCompositor(); | 3790 m_client->didActivateCompositor(); |
3783 m_isAcceleratedCompositingActive = true; | 3791 m_isAcceleratedCompositingActive = true; |
3784 m_compositorCreationFailed = false; | 3792 setCompositorCreationFailed(false); |
3785 if (m_pageOverlays) | 3793 if (m_pageOverlays) |
3786 m_pageOverlays->update(); | 3794 m_pageOverlays->update(); |
3787 m_layerTreeView->setShowFPSCounter(m_showFPSCounter); | 3795 m_layerTreeView->setShowFPSCounter(m_showFPSCounter); |
3788 m_layerTreeView->setShowPaintRects(m_showPaintRects); | 3796 m_layerTreeView->setShowPaintRects(m_showPaintRects); |
3789 m_layerTreeView->setShowDebugBorders(m_showDebugBorders); | 3797 m_layerTreeView->setShowDebugBorders(m_showDebugBorders); |
3790 m_layerTreeView->setContinuousPaintingEnabled(m_continuousPaintingEn
abled); | 3798 m_layerTreeView->setContinuousPaintingEnabled(m_continuousPaintingEn
abled); |
3791 m_layerTreeView->setShowScrollBottleneckRects(m_showScrollBottleneck
Rects); | 3799 m_layerTreeView->setShowScrollBottleneckRects(m_showScrollBottleneck
Rects); |
3792 } else { | 3800 } else { |
3793 m_isAcceleratedCompositingActive = false; | 3801 m_isAcceleratedCompositingActive = false; |
3794 m_client->didDeactivateCompositor(); | 3802 m_client->didDeactivateCompositor(); |
3795 m_compositorCreationFailed = true; | 3803 setCompositorCreationFailed(true); |
3796 } | 3804 } |
3797 } | 3805 } |
3798 if (page()) | 3806 if (page()) |
3799 page()->mainFrame()->view()->setClipsRepaints(!m_isAcceleratedCompositin
gActive); | 3807 page()->mainFrame()->view()->setClipsRepaints(!m_isAcceleratedCompositin
gActive); |
3800 } | 3808 } |
3801 | 3809 |
3802 void WebViewImpl::updateMainFrameScrollPosition(const IntPoint& scrollPosition,
bool programmaticScroll) | 3810 void WebViewImpl::updateMainFrameScrollPosition(const IntPoint& scrollPosition,
bool programmaticScroll) |
3803 { | 3811 { |
3804 FrameView* frameView = page()->mainFrame()->view(); | 3812 FrameView* frameView = page()->mainFrame()->view(); |
3805 if (!frameView) | 3813 if (!frameView) |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3845 WebPoint scrollPoint(scrollOffset.width, scrollOffset.height); | 3853 WebPoint scrollPoint(scrollOffset.width, scrollOffset.height); |
3846 setPageScaleFactor(pageScaleFactor() * pageScaleDelta, scrollPoint); | 3854 setPageScaleFactor(pageScaleFactor() * pageScaleDelta, scrollPoint); |
3847 m_doubleTapZoomPending = false; | 3855 m_doubleTapZoomPending = false; |
3848 } | 3856 } |
3849 } | 3857 } |
3850 | 3858 |
3851 void WebViewImpl::didExitCompositingMode() | 3859 void WebViewImpl::didExitCompositingMode() |
3852 { | 3860 { |
3853 ASSERT(m_isAcceleratedCompositingActive); | 3861 ASSERT(m_isAcceleratedCompositingActive); |
3854 setIsAcceleratedCompositingActive(false); | 3862 setIsAcceleratedCompositingActive(false); |
3855 m_compositorCreationFailed = true; | 3863 setCompositorCreationFailed(true); |
3856 m_client->didInvalidateRect(IntRect(0, 0, m_size.width, m_size.height)); | 3864 m_client->didInvalidateRect(IntRect(0, 0, m_size.width, m_size.height)); |
3857 | 3865 |
3858 // Force a style recalc to remove all the composited layers. | 3866 // Force a style recalc to remove all the composited layers. |
3859 m_page->mainFrame()->document()->setNeedsStyleRecalc(SubtreeStyleChange); | 3867 m_page->mainFrame()->document()->setNeedsStyleRecalc(SubtreeStyleChange); |
3860 | 3868 |
3861 if (m_pageOverlays) | 3869 if (m_pageOverlays) |
3862 m_pageOverlays->update(); | 3870 m_pageOverlays->update(); |
3863 } | 3871 } |
3864 | 3872 |
3865 void WebViewImpl::updateLayerTreeViewport() | 3873 void WebViewImpl::updateLayerTreeViewport() |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3999 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); | 4007 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); |
4000 | 4008 |
4001 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) | 4009 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) |
4002 return false; | 4010 return false; |
4003 | 4011 |
4004 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width | 4012 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width |
4005 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); | 4013 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); |
4006 } | 4014 } |
4007 | 4015 |
4008 } // namespace blink | 4016 } // namespace blink |
OLD | NEW |