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

Side by Side Diff: third_party/WebKit/Source/web/CompositorMutatorImpl.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: Add big fat TODOs in scheduler code to implement proper idle task scheduling and ensure GC is runniā€¦ 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "web/CompositorMutatorImpl.h"
6
7 #include "core/animation/CustomCompositorAnimationManager.h"
8 #include "core/dom/CompositorProxy.h"
9 #include "platform/TraceEvent.h"
10 #include "platform/graphics/CompositorMutationsTarget.h"
11 #include "platform/graphics/CompositorMutatorClient.h"
12 #include "platform/heap/Handle.h"
13 #include "web/CompositorProxyClientImpl.h"
14
15 namespace blink {
16
17 CompositorMutatorImpl::CompositorMutatorImpl()
18 : m_animationManager(adoptPtr(new CustomCompositorAnimationManager))
19 , m_client(nullptr)
20 {
21 }
22
23 CompositorMutatorImpl* CompositorMutatorImpl::create()
24 {
25 return new CompositorMutatorImpl();
26 }
27
28 bool CompositorMutatorImpl::mutate(double monotonicTimeNow)
29 {
30 TRACE_EVENT0("compositor-worker", "CompositorMutatorImpl::mutate");
31 bool needToReinvoke = false;
32 // TODO(vollick): we should avoid executing the animation frame
33 // callbacks if none of the proxies in the global scope are affected by
34 // m_mutations.
35 for (CompositorProxyClientImpl* client : m_proxyClients) {
36 if (client->mutate(monotonicTimeNow))
37 needToReinvoke = true;
38 }
39
40 return needToReinvoke;
41 }
42
43 void CompositorMutatorImpl::registerProxyClient(CompositorProxyClientImpl* clien t)
44 {
45 TRACE_EVENT0("compositor-worker", "CompositorMutatorImpl::registerClient");
46 m_proxyClients.add(client);
47 setNeedsMutate();
48 }
49
50 void CompositorMutatorImpl::setNeedsMutate()
51 {
52 TRACE_EVENT0("compositor-worker", "CompositorMutatorImpl::setNeedsMutate");
53 m_client->setNeedsMutate();
54 }
55
56 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698