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

Side by Side Diff: content/browser/renderer_host/compositor_begin_frame_observer_impl.h

Issue 1000503002: Add BeginFrameObserverProxy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 2015 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 #ifndef CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_BEGIN_FRAME_OBSERVER_IMPL_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_BEGIN_FRAME_OBSERVER_IMPL_H_
7
8 #include "content/common/content_export.h"
9 #include "ui/compositor/compositor.h"
10 #include "ui/compositor/compositor_observer.h"
11
12 namespace cc {
13 struct BeginFrameArgs;
14 }
15
16 namespace content {
17
18 // This is the interface from the CompositorBeginFrameObserverImpl which manages
19 // sending BeginFrame messages.
20 class CompositorBeginFrameObserverImplClient {
21 public:
22 virtual void SendBeginFrame(const cc::BeginFrameArgs& args) = 0;
23 };
24
25 // This class is used to manage all of the RenderWidgetHostView state and
26 // functionality that is associated with BeginFrame message handling.
27 class CONTENT_EXPORT CompositorBeginFrameObserverImpl
28 : public ui::CompositorBeginFrameObserver {
29 public:
30 explicit CompositorBeginFrameObserverImpl(
31 CompositorBeginFrameObserverImplClient* client);
32 virtual ~CompositorBeginFrameObserverImpl();
33
34 void SetNeedsBeginFrames(bool needs_begin_frames);
35
36 void SetCompositor(ui::Compositor* compositor);
37 void ResetCompositor();
38
39 // Overridden from ui::CompositorBeginFrameObserver:
40 void OnSendBeginFrame(const cc::BeginFrameArgs& args) override;
41
42 private:
43 void StartObservingBeginFrames();
44 void StopObservingBeginFrames();
45
46 // True when RenderWidget needs a BeginFrame message.
47 bool needs_begin_frames_;
48
49 // Pass |last_sent_begin_frame_args_| to compositor when |this| is added as a
danakj 2015/03/20 16:46:11 Update this comment?
simonhong 2015/03/20 17:24:14 Done.
50 // CompositorBeginFrameObserver. With this, Compositor can determine whether
51 // latest BeginFrameArgs it has sent can be used immediately or not.
52 cc::BeginFrameArgs last_sent_begin_frame_args_;
53
54 CompositorBeginFrameObserverImplClient* client_;
55 ui::Compositor* compositor_;
56
57 DISALLOW_COPY_AND_ASSIGN(CompositorBeginFrameObserverImpl);
58 };
59
60 } // namespace content
61
62 #endif // CONTENT_BROWSER_RENDERER_HOST_COMPOSITOR_BEGIN_FRAME_OBSERVER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698