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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 #include "platform/PlatformGestureEvent.h" | 106 #include "platform/PlatformGestureEvent.h" |
107 #include "platform/PlatformKeyboardEvent.h" | 107 #include "platform/PlatformKeyboardEvent.h" |
108 #include "platform/PlatformMouseEvent.h" | 108 #include "platform/PlatformMouseEvent.h" |
109 #include "platform/RuntimeEnabledFeatures.h" | 109 #include "platform/RuntimeEnabledFeatures.h" |
110 #include "platform/TraceEvent.h" | 110 #include "platform/TraceEvent.h" |
111 #include "platform/UserGestureIndicator.h" | 111 #include "platform/UserGestureIndicator.h" |
112 #include "platform/exported/WebActiveGestureAnimation.h" | 112 #include "platform/exported/WebActiveGestureAnimation.h" |
113 #include "platform/fonts/FontCache.h" | 113 #include "platform/fonts/FontCache.h" |
114 #include "platform/graphics/Color.h" | 114 #include "platform/graphics/Color.h" |
115 #include "platform/graphics/CompositorFactory.h" | 115 #include "platform/graphics/CompositorFactory.h" |
| 116 #include "platform/graphics/CompositorMutatorClient.h" |
116 #include "platform/graphics/FirstPaintInvalidationTracking.h" | 117 #include "platform/graphics/FirstPaintInvalidationTracking.h" |
117 #include "platform/graphics/GraphicsContext.h" | 118 #include "platform/graphics/GraphicsContext.h" |
118 #include "platform/graphics/Image.h" | 119 #include "platform/graphics/Image.h" |
119 #include "platform/graphics/ImageBuffer.h" | 120 #include "platform/graphics/ImageBuffer.h" |
120 #include "platform/graphics/gpu/DrawingBuffer.h" | 121 #include "platform/graphics/gpu/DrawingBuffer.h" |
121 #include "platform/graphics/paint/DrawingRecorder.h" | 122 #include "platform/graphics/paint/DrawingRecorder.h" |
122 #include "platform/scroll/ScrollbarTheme.h" | 123 #include "platform/scroll/ScrollbarTheme.h" |
123 #include "platform/weborigin/SchemeRegistry.h" | 124 #include "platform/weborigin/SchemeRegistry.h" |
124 #include "public/platform/Platform.h" | 125 #include "public/platform/Platform.h" |
125 #include "public/platform/WebCompositeAndReadbackAsyncCallback.h" | 126 #include "public/platform/WebCompositeAndReadbackAsyncCallback.h" |
(...skipping 20 matching lines...) Expand all Loading... |
146 #include "public/web/WebNode.h" | 147 #include "public/web/WebNode.h" |
147 #include "public/web/WebPlugin.h" | 148 #include "public/web/WebPlugin.h" |
148 #include "public/web/WebPluginAction.h" | 149 #include "public/web/WebPluginAction.h" |
149 #include "public/web/WebRange.h" | 150 #include "public/web/WebRange.h" |
150 #include "public/web/WebScopedUserGesture.h" | 151 #include "public/web/WebScopedUserGesture.h" |
151 #include "public/web/WebSelection.h" | 152 #include "public/web/WebSelection.h" |
152 #include "public/web/WebTextInputInfo.h" | 153 #include "public/web/WebTextInputInfo.h" |
153 #include "public/web/WebViewClient.h" | 154 #include "public/web/WebViewClient.h" |
154 #include "public/web/WebWindowFeatures.h" | 155 #include "public/web/WebWindowFeatures.h" |
155 #include "web/CompositionUnderlineVectorBuilder.h" | 156 #include "web/CompositionUnderlineVectorBuilder.h" |
| 157 #include "web/CompositorMutatorImpl.h" |
156 #include "web/CompositorProxyClientImpl.h" | 158 #include "web/CompositorProxyClientImpl.h" |
157 #include "web/ContextFeaturesClientImpl.h" | 159 #include "web/ContextFeaturesClientImpl.h" |
158 #include "web/ContextMenuAllowedScope.h" | 160 #include "web/ContextMenuAllowedScope.h" |
159 #include "web/DatabaseClientImpl.h" | 161 #include "web/DatabaseClientImpl.h" |
160 #include "web/DedicatedWorkerGlobalScopeProxyProviderImpl.h" | 162 #include "web/DedicatedWorkerGlobalScopeProxyProviderImpl.h" |
161 #include "web/DevToolsEmulator.h" | 163 #include "web/DevToolsEmulator.h" |
162 #include "web/FullscreenController.h" | 164 #include "web/FullscreenController.h" |
163 #include "web/InspectorOverlay.h" | 165 #include "web/InspectorOverlay.h" |
164 #include "web/LinkHighlightImpl.h" | 166 #include "web/LinkHighlightImpl.h" |
165 #include "web/PageOverlay.h" | 167 #include "web/PageOverlay.h" |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 , m_fullscreenController(FullscreenController::create(this)) | 440 , m_fullscreenController(FullscreenController::create(this)) |
439 , m_baseBackgroundColor(Color::white) | 441 , m_baseBackgroundColor(Color::white) |
440 , m_backgroundColorOverride(Color::transparent) | 442 , m_backgroundColorOverride(Color::transparent) |
441 , m_zoomFactorOverride(0) | 443 , m_zoomFactorOverride(0) |
442 , m_userGestureObserved(false) | 444 , m_userGestureObserved(false) |
443 , m_shouldDispatchFirstVisuallyNonEmptyLayout(false) | 445 , m_shouldDispatchFirstVisuallyNonEmptyLayout(false) |
444 , m_shouldDispatchFirstLayoutAfterFinishedParsing(false) | 446 , m_shouldDispatchFirstLayoutAfterFinishedParsing(false) |
445 , m_shouldDispatchFirstLayoutAfterFinishedLoading(false) | 447 , m_shouldDispatchFirstLayoutAfterFinishedLoading(false) |
446 , m_displayMode(WebDisplayModeBrowser) | 448 , m_displayMode(WebDisplayModeBrowser) |
447 , m_elasticOverscroll(FloatSize()) | 449 , m_elasticOverscroll(FloatSize()) |
| 450 , m_mutator(nullptr) |
448 , m_scheduler(adoptPtr(Platform::current()->currentThread()->scheduler()->cr
eateWebViewScheduler(this).release())) | 451 , m_scheduler(adoptPtr(Platform::current()->currentThread()->scheduler()->cr
eateWebViewScheduler(this).release())) |
449 , m_lastFrameTimeMonotonic(0) | 452 , m_lastFrameTimeMonotonic(0) |
450 { | 453 { |
451 Page::PageClients pageClients; | 454 Page::PageClients pageClients; |
452 pageClients.chromeClient = m_chromeClientImpl.get(); | 455 pageClients.chromeClient = m_chromeClientImpl.get(); |
453 pageClients.contextMenuClient = &m_contextMenuClientImpl; | 456 pageClients.contextMenuClient = &m_contextMenuClientImpl; |
454 pageClients.editorClient = &m_editorClientImpl; | 457 pageClients.editorClient = &m_editorClientImpl; |
455 pageClients.spellCheckerClient = &m_spellCheckerClientImpl; | 458 pageClients.spellCheckerClient = &m_spellCheckerClientImpl; |
456 | 459 |
457 m_page = Page::createOrdinary(pageClients); | 460 m_page = Page::createOrdinary(pageClients); |
(...skipping 2348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2806 } | 2809 } |
2807 | 2810 |
2808 if (m_layerTreeView) | 2811 if (m_layerTreeView) |
2809 page()->willCloseLayerTreeView(*m_layerTreeView); | 2812 page()->willCloseLayerTreeView(*m_layerTreeView); |
2810 | 2813 |
2811 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) | 2814 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) |
2812 detachPaintArtifactCompositor(); | 2815 detachPaintArtifactCompositor(); |
2813 else | 2816 else |
2814 setRootGraphicsLayer(nullptr); | 2817 setRootGraphicsLayer(nullptr); |
2815 | 2818 |
| 2819 m_mutator = nullptr; |
2816 m_layerTreeView = nullptr; | 2820 m_layerTreeView = nullptr; |
2817 } | 2821 } |
2818 | 2822 |
2819 void WebViewImpl::didAcquirePointerLock() | 2823 void WebViewImpl::didAcquirePointerLock() |
2820 { | 2824 { |
2821 if (page()) | 2825 if (page()) |
2822 page()->pointerLockController().didAcquirePointerLock(); | 2826 page()->pointerLockController().didAcquirePointerLock(); |
2823 } | 2827 } |
2824 | 2828 |
2825 void WebViewImpl::didNotAcquirePointerLock() | 2829 void WebViewImpl::didNotAcquirePointerLock() |
(...skipping 1715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4541 WebGLRenderingContext::forceNextWebGLContextCreationToFail(); | 4545 WebGLRenderingContext::forceNextWebGLContextCreationToFail(); |
4542 } | 4546 } |
4543 | 4547 |
4544 void WebViewImpl::forceNextDrawingBufferCreationToFail() | 4548 void WebViewImpl::forceNextDrawingBufferCreationToFail() |
4545 { | 4549 { |
4546 DrawingBuffer::forceNextDrawingBufferCreationToFail(); | 4550 DrawingBuffer::forceNextDrawingBufferCreationToFail(); |
4547 } | 4551 } |
4548 | 4552 |
4549 CompositorProxyClient* WebViewImpl::createCompositorProxyClient() | 4553 CompositorProxyClient* WebViewImpl::createCompositorProxyClient() |
4550 { | 4554 { |
4551 return new CompositorProxyClientImpl(); | 4555 if (!m_mutator) { |
| 4556 std::unique_ptr<CompositorMutatorClient> mutatorClient = CompositorMutat
orImpl::createClient(); |
| 4557 m_mutator = static_cast<CompositorMutatorImpl*>(mutatorClient->mutator()
); |
| 4558 m_layerTreeView->setMutatorClient(std::move(mutatorClient)); |
| 4559 } |
| 4560 return new CompositorProxyClientImpl(m_mutator); |
4552 } | 4561 } |
4553 | 4562 |
4554 void WebViewImpl::updatePageOverlays() | 4563 void WebViewImpl::updatePageOverlays() |
4555 { | 4564 { |
4556 if (m_pageColorOverlay) | 4565 if (m_pageColorOverlay) |
4557 m_pageColorOverlay->update(); | 4566 m_pageColorOverlay->update(); |
4558 if (InspectorOverlay* overlay = inspectorOverlay()) { | 4567 if (InspectorOverlay* overlay = inspectorOverlay()) { |
4559 PageOverlay* inspectorPageOverlay = overlay->pageOverlay(); | 4568 PageOverlay* inspectorPageOverlay = overlay->pageOverlay(); |
4560 if (inspectorPageOverlay) | 4569 if (inspectorPageOverlay) |
4561 inspectorPageOverlay->update(); | 4570 inspectorPageOverlay->update(); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4596 { | 4605 { |
4597 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa
ctor rather than | 4606 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa
ctor rather than |
4598 // page's scale factor, which can be 1 in use-zoom-for-dsf mode. | 4607 // page's scale factor, which can be 1 in use-zoom-for-dsf mode. |
4599 if (!page()) | 4608 if (!page()) |
4600 return 1; | 4609 return 1; |
4601 | 4610 |
4602 return page()->deviceScaleFactor(); | 4611 return page()->deviceScaleFactor(); |
4603 } | 4612 } |
4604 | 4613 |
4605 } // namespace blink | 4614 } // namespace blink |
OLD | NEW |