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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 #include "web/ValidationMessageClientImpl.h" | 165 #include "web/ValidationMessageClientImpl.h" |
166 #include "web/ViewportAnchor.h" | 166 #include "web/ViewportAnchor.h" |
167 #include "web/WebDevToolsAgentImpl.h" | 167 #include "web/WebDevToolsAgentImpl.h" |
168 #include "web/WebInputEventConversion.h" | 168 #include "web/WebInputEventConversion.h" |
169 #include "web/WebLocalFrameImpl.h" | 169 #include "web/WebLocalFrameImpl.h" |
170 #include "web/WebPagePopupImpl.h" | 170 #include "web/WebPagePopupImpl.h" |
171 #include "web/WebPluginContainerImpl.h" | 171 #include "web/WebPluginContainerImpl.h" |
172 #include "web/WebRemoteFrameImpl.h" | 172 #include "web/WebRemoteFrameImpl.h" |
173 #include "web/WebSettingsImpl.h" | 173 #include "web/WebSettingsImpl.h" |
174 #include "web/WorkerGlobalScopeProxyProviderImpl.h" | 174 #include "web/WorkerGlobalScopeProxyProviderImpl.h" |
175 #include "web/painting/ContinuousPainter.h" | |
176 #include "wtf/CurrentTime.h" | 175 #include "wtf/CurrentTime.h" |
177 #include "wtf/RefPtr.h" | 176 #include "wtf/RefPtr.h" |
178 #include "wtf/TemporaryChange.h" | 177 #include "wtf/TemporaryChange.h" |
179 | 178 |
180 #if USE(DEFAULT_RENDER_THEME) | 179 #if USE(DEFAULT_RENDER_THEME) |
181 #include "core/layout/LayoutThemeDefault.h" | 180 #include "core/layout/LayoutThemeDefault.h" |
182 #endif | 181 #endif |
183 | 182 |
184 // Get rid of WTF's pow define so we can use std::pow. | 183 // Get rid of WTF's pow define so we can use std::pow. |
185 #undef pow | 184 #undef pow |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
444 , m_rootLayer(0) | 443 , m_rootLayer(0) |
445 , m_rootGraphicsLayer(0) | 444 , m_rootGraphicsLayer(0) |
446 , m_rootTransformLayer(0) | 445 , m_rootTransformLayer(0) |
447 , m_graphicsLayerFactory(adoptPtr(new GraphicsLayerFactoryChromium(this))) | 446 , m_graphicsLayerFactory(adoptPtr(new GraphicsLayerFactoryChromium(this))) |
448 , m_matchesHeuristicsForGpuRasterization(false) | 447 , m_matchesHeuristicsForGpuRasterization(false) |
449 , m_recreatingGraphicsContext(false) | 448 , m_recreatingGraphicsContext(false) |
450 , m_flingModifier(0) | 449 , m_flingModifier(0) |
451 , m_flingSourceDevice(false) | 450 , m_flingSourceDevice(false) |
452 , m_fullscreenController(FullscreenController::create(this)) | 451 , m_fullscreenController(FullscreenController::create(this)) |
453 , m_showFPSCounter(false) | 452 , m_showFPSCounter(false) |
454 , m_continuousPaintingEnabled(false) | |
455 , m_baseBackgroundColor(Color::white) | 453 , m_baseBackgroundColor(Color::white) |
456 , m_backgroundColorOverride(Color::transparent) | 454 , m_backgroundColorOverride(Color::transparent) |
457 , m_zoomFactorOverride(0) | 455 , m_zoomFactorOverride(0) |
458 , m_userGestureObserved(false) | 456 , m_userGestureObserved(false) |
459 , m_displayMode(WebDisplayModeBrowser) | 457 , m_displayMode(WebDisplayModeBrowser) |
460 , m_elasticOverscroll(FloatSize()) | 458 , m_elasticOverscroll(FloatSize()) |
461 { | 459 { |
462 Page::PageClients pageClients; | 460 Page::PageClients pageClients; |
463 pageClients.chromeClient = m_chromeClientImpl.get(); | 461 pageClients.chromeClient = m_chromeClientImpl.get(); |
464 pageClients.contextMenuClient = &m_contextMenuClientImpl; | 462 pageClients.contextMenuClient = &m_contextMenuClientImpl; |
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
957 | 955 |
958 void WebViewImpl::enableFakePageScaleAnimationForTesting(bool enable) | 956 void WebViewImpl::enableFakePageScaleAnimationForTesting(bool enable) |
959 { | 957 { |
960 m_enableFakePageScaleAnimationForTesting = enable; | 958 m_enableFakePageScaleAnimationForTesting = enable; |
961 } | 959 } |
962 | 960 |
963 void WebViewImpl::setShowFPSCounter(bool show) | 961 void WebViewImpl::setShowFPSCounter(bool show) |
964 { | 962 { |
965 if (m_layerTreeView) { | 963 if (m_layerTreeView) { |
966 TRACE_EVENT0("blink", "WebViewImpl::setShowFPSCounter"); | 964 TRACE_EVENT0("blink", "WebViewImpl::setShowFPSCounter"); |
967 // FIXME: allow emulation, fps counter and continuous painting at the sa
me time: crbug.com/299837. | |
968 m_layerTreeView->setShowFPSCounter(show && !m_devToolsEmulator->deviceEm
ulationEnabled()); | 965 m_layerTreeView->setShowFPSCounter(show && !m_devToolsEmulator->deviceEm
ulationEnabled()); |
969 } | 966 } |
970 m_showFPSCounter = show; | 967 m_showFPSCounter = show; |
971 } | 968 } |
972 | 969 |
973 void WebViewImpl::setShowPaintRects(bool show) | 970 void WebViewImpl::setShowPaintRects(bool show) |
974 { | 971 { |
975 if (m_layerTreeView) { | 972 if (m_layerTreeView) { |
976 TRACE_EVENT0("blink", "WebViewImpl::setShowPaintRects"); | 973 TRACE_EVENT0("blink", "WebViewImpl::setShowPaintRects"); |
977 m_layerTreeView->setShowPaintRects(show); | 974 m_layerTreeView->setShowPaintRects(show); |
978 } | 975 } |
979 setFirstPaintInvalidationTrackingEnabledForShowPaintRects(show); | 976 setFirstPaintInvalidationTrackingEnabledForShowPaintRects(show); |
980 } | 977 } |
981 | 978 |
982 void WebViewImpl::setShowDebugBorders(bool show) | 979 void WebViewImpl::setShowDebugBorders(bool show) |
983 { | 980 { |
984 if (m_layerTreeView) | 981 if (m_layerTreeView) |
985 m_layerTreeView->setShowDebugBorders(show); | 982 m_layerTreeView->setShowDebugBorders(show); |
986 } | 983 } |
987 | 984 |
988 void WebViewImpl::setContinuousPaintingEnabled(bool enabled) | 985 void WebViewImpl::updateShowFPSCounter() |
989 { | 986 { |
990 if (m_layerTreeView) { | 987 if (m_layerTreeView) |
991 TRACE_EVENT0("blink", "WebViewImpl::setContinuousPaintingEnabled"); | |
992 // FIXME: allow emulation, fps counter and continuous painting at the sa
me time: crbug.com/299837. | |
993 m_layerTreeView->setContinuousPaintingEnabled(enabled && !m_devToolsEmul
ator->deviceEmulationEnabled()); | |
994 } | |
995 m_continuousPaintingEnabled = enabled; | |
996 if (m_client) | |
997 m_client->scheduleAnimation(); | |
998 } | |
999 | |
1000 void WebViewImpl::updateShowFPSCounterAndContinuousPainting() | |
1001 { | |
1002 if (m_layerTreeView) { | |
1003 // FIXME: allow emulation, fps counter and continuous painting at the sa
me time: crbug.com/299837. | |
1004 m_layerTreeView->setContinuousPaintingEnabled(m_continuousPaintingEnable
d && !m_devToolsEmulator->deviceEmulationEnabled()); | |
1005 m_layerTreeView->setShowFPSCounter(m_showFPSCounter && !m_devToolsEmulat
or->deviceEmulationEnabled()); | 988 m_layerTreeView->setShowFPSCounter(m_showFPSCounter && !m_devToolsEmulat
or->deviceEmulationEnabled()); |
1006 } | |
1007 } | 989 } |
1008 | 990 |
1009 void WebViewImpl::setShowScrollBottleneckRects(bool show) | 991 void WebViewImpl::setShowScrollBottleneckRects(bool show) |
1010 { | 992 { |
1011 if (m_layerTreeView) | 993 if (m_layerTreeView) |
1012 m_layerTreeView->setShowScrollBottleneckRects(show); | 994 m_layerTreeView->setShowScrollBottleneckRects(show); |
1013 } | 995 } |
1014 | 996 |
1015 void WebViewImpl::acceptLanguagesChanged() | 997 void WebViewImpl::acceptLanguagesChanged() |
1016 { | 998 { |
(...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1894 mainFrameImpl()->frame()->eventHandler().handleGestureScrollEnd(endS
crollEvent); | 1876 mainFrameImpl()->frame()->eventHandler().handleGestureScrollEnd(endS
crollEvent); |
1895 } | 1877 } |
1896 } | 1878 } |
1897 | 1879 |
1898 if (!m_page) | 1880 if (!m_page) |
1899 return; | 1881 return; |
1900 | 1882 |
1901 // FIXME: This should probably be using the local root? | 1883 // FIXME: This should probably be using the local root? |
1902 if (m_page->mainFrame()->isLocalFrame()) | 1884 if (m_page->mainFrame()->isLocalFrame()) |
1903 PageWidgetDelegate::animate(*m_page, validFrameTime.lastFrameTimeMonoton
ic, *m_page->deprecatedLocalMainFrame()); | 1885 PageWidgetDelegate::animate(*m_page, validFrameTime.lastFrameTimeMonoton
ic, *m_page->deprecatedLocalMainFrame()); |
1904 | |
1905 if (m_continuousPaintingEnabled) { | |
1906 GraphicsLayer* inspectorOverlayLayer = nullptr; | |
1907 if (m_inspectorOverlay) { | |
1908 PageOverlay* inspectorPageOverlay = m_inspectorOverlay->pageOverlay(
); | |
1909 if (inspectorPageOverlay) | |
1910 inspectorOverlayLayer = inspectorPageOverlay->graphicsLayer(); | |
1911 } | |
1912 ContinuousPainter::setNeedsDisplayRecursive(m_rootGraphicsLayer, inspect
orOverlayLayer); | |
1913 m_client->scheduleAnimation(); | |
1914 } | |
1915 } | 1886 } |
1916 | 1887 |
1917 void WebViewImpl::layout() | 1888 void WebViewImpl::layout() |
1918 { | 1889 { |
1919 TRACE_EVENT0("blink", "WebViewImpl::layout"); | 1890 TRACE_EVENT0("blink", "WebViewImpl::layout"); |
1920 if (!mainFrameImpl()) | 1891 if (!mainFrameImpl()) |
1921 return; | 1892 return; |
1922 | 1893 |
1923 PageWidgetDelegate::layout(*m_page, *mainFrameImpl()->frame()); | 1894 PageWidgetDelegate::layout(*m_page, *mainFrameImpl()->frame()); |
1924 updateLayerTreeBackgroundColor(); | 1895 updateLayerTreeBackgroundColor(); |
(...skipping 2573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4498 if (m_pageColorOverlay) | 4469 if (m_pageColorOverlay) |
4499 m_pageColorOverlay->update(); | 4470 m_pageColorOverlay->update(); |
4500 if (m_inspectorOverlay) { | 4471 if (m_inspectorOverlay) { |
4501 PageOverlay* inspectorPageOverlay = m_inspectorOverlay->pageOverlay(); | 4472 PageOverlay* inspectorPageOverlay = m_inspectorOverlay->pageOverlay(); |
4502 if (inspectorPageOverlay) | 4473 if (inspectorPageOverlay) |
4503 inspectorPageOverlay->update(); | 4474 inspectorPageOverlay->update(); |
4504 } | 4475 } |
4505 } | 4476 } |
4506 | 4477 |
4507 } // namespace blink | 4478 } // namespace blink |
OLD | NEW |