Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1216)

Unified Diff: third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp

Issue 1895873006: compositor-worker: Initialize CW machinery plumbing to compositor and fire CW rAF callbacks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Include WebCompositorMutatorClient from WebLayerTreeView to allow unique_ptr usage. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/web/WebFrameWidgetImpl.h ('k') | third_party/WebKit/Source/web/WebViewImpl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp b/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp
index 5365c9a14aeff2dccee027e15574896ce09934aa..4998d018a4b0aa5acf4cb15650c0c993af9e3956 100644
--- a/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp
+++ b/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp
@@ -48,8 +48,10 @@
#include "core/page/FocusController.h"
#include "core/page/Page.h"
#include "platform/KeyboardCodes.h"
+#include "platform/graphics/CompositorMutatorClient.h"
#include "public/platform/WebFrameScheduler.h"
#include "public/web/WebWidgetClient.h"
+#include "web/CompositorMutatorImpl.h"
#include "web/CompositorProxyClientImpl.h"
#include "web/ContextMenuAllowedScope.h"
#include "web/WebDevToolsAgentImpl.h"
@@ -90,6 +92,7 @@ WebFrameWidgetsSet& WebFrameWidgetImpl::allInstances()
WebFrameWidgetImpl::WebFrameWidgetImpl(WebWidgetClient* client, WebLocalFrame* localRoot)
: m_client(client)
, m_localRoot(toWebLocalFrameImpl(localRoot))
+ , m_mutator(nullptr)
, m_layerTreeView(nullptr)
, m_rootLayer(nullptr)
, m_rootGraphicsLayer(nullptr)
@@ -133,6 +136,7 @@ void WebFrameWidgetImpl::close()
// deleted.
m_client = nullptr;
+ m_mutator = nullptr;
m_layerTreeView = nullptr;
m_rootLayer = nullptr;
m_rootGraphicsLayer = nullptr;
@@ -405,7 +409,12 @@ void WebFrameWidgetImpl::scheduleAnimation()
CompositorProxyClient* WebFrameWidgetImpl::createCompositorProxyClient()
{
- return new CompositorProxyClientImpl();
+ if (!m_mutator) {
+ std::unique_ptr<CompositorMutatorClient> mutatorClient = CompositorMutatorImpl::createClient();
+ m_mutator = static_cast<CompositorMutatorImpl*>(mutatorClient->mutator());
+ m_layerTreeView->setMutatorClient(std::move(mutatorClient));
+ }
+ return new CompositorProxyClientImpl(m_mutator);
}
void WebFrameWidgetImpl::applyViewportDeltas(
@@ -625,6 +634,7 @@ void WebFrameWidgetImpl::willCloseLayerTreeView()
page()->willCloseLayerTreeView(*m_layerTreeView);
setIsAcceleratedCompositingActive(false);
+ m_mutator = nullptr;
m_layerTreeView = nullptr;
m_layerTreeViewClosed = true;
}
@@ -997,6 +1007,7 @@ Element* WebFrameWidgetImpl::focusedElement() const
void WebFrameWidgetImpl::initializeLayerTreeView()
{
if (m_client) {
+ DCHECK(!m_mutator);
m_client->initializeLayerTreeView();
m_layerTreeView = m_client->layerTreeView();
}
« no previous file with comments | « third_party/WebKit/Source/web/WebFrameWidgetImpl.h ('k') | third_party/WebKit/Source/web/WebViewImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698