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

Unified Diff: ui/compositor/compositor.h

Issue 775143003: cc: Implement unified BeginFrame on aura (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move common logic to DelegatedFrameHost Created 6 years 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
Index: ui/compositor/compositor.h
diff --git a/ui/compositor/compositor.h b/ui/compositor/compositor.h
index bf61d29730e67aa70bd7c8533baa860a2335de42..80fd0ef86103ca4620601fd083622bb8693eda34 100644
--- a/ui/compositor/compositor.h
+++ b/ui/compositor/compositor.h
@@ -13,10 +13,12 @@
#include "base/observer_list.h"
#include "base/single_thread_task_runner.h"
#include "base/time/time.h"
+#include "cc/output/begin_frame_args.h"
#include "cc/surfaces/surface_sequence.h"
#include "cc/trees/layer_tree_host_client.h"
#include "cc/trees/layer_tree_host_single_thread_client.h"
#include "third_party/skia/include/core/SkColor.h"
+#include "ui/base/compositor/compositor_begin_frame_observer.h"
#include "ui/compositor/compositor_animation_observer.h"
#include "ui/compositor/compositor_export.h"
#include "ui/compositor/compositor_observer.h"
@@ -223,6 +225,12 @@ class COMPOSITOR_EXPORT Compositor
void RemoveAnimationObserver(CompositorAnimationObserver* observer);
bool HasAnimationObserver(const CompositorAnimationObserver* observer) const;
+ void AddBeginFrameObserver(
+ CompositorBeginFrameObserver* observer,
+ const cc::BeginFrameArgs& last_begin_frame_args_sent_to_observer);
+ void RemoveBeginFrameObserver(CompositorBeginFrameObserver* observer);
+ bool HasBeginFrameObserver(CompositorBeginFrameObserver* observer);
+
// Creates a compositor lock. Returns NULL if it is not possible to lock at
// this time (i.e. we're waiting to complete a previous unlock).
scoped_refptr<CompositorLock> GetCompositorLock();
@@ -257,6 +265,7 @@ class COMPOSITOR_EXPORT Compositor
void DidCommit() override;
void DidCommitAndDrawFrame() override;
void DidCompleteSwapBuffers() override;
+ void SendBeginFramesToChildren(const cc::BeginFrameArgs& args) override;
// cc::LayerTreeHostSingleThreadClient implementation.
void DidPostSwapBuffers() override;
@@ -286,6 +295,9 @@ class COMPOSITOR_EXPORT Compositor
// Called to release any pending CompositorLock
void CancelCompositorLock();
+ // Request scheduling of next BeginFrame to LayerTreeHost.
+ void SetChildrenNeedBeginFrames(bool need_begin_frame);
+
gfx::Size size_;
ui::ContextFactory* context_factory_;
@@ -295,6 +307,7 @@ class COMPOSITOR_EXPORT Compositor
ObserverList<CompositorObserver> observer_list_;
ObserverList<CompositorAnimationObserver> animation_observer_list_;
+ ObserverList<CompositorBeginFrameObserver> begin_frame_observer_list_;
gfx::AcceleratedWidget widget_;
scoped_ptr<cc::SurfaceIdAllocator> surface_id_allocator_;
@@ -319,6 +332,9 @@ class COMPOSITOR_EXPORT Compositor
LayerAnimatorCollection layer_animator_collection_;
+ // Used to send to any new CompositorBeginFrameObserver immediately.
+ cc::BeginFrameArgs last_begin_frame_args_;
+
base::WeakPtrFactory<Compositor> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(Compositor);

Powered by Google App Engine
This is Rietveld 408576698