1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
|
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CC_TREES_REMOTE_CHANNEL_MAIN_H_
#define CC_TREES_REMOTE_CHANNEL_MAIN_H_
#include "base/macros.h"
#include "cc/base/cc_export.h"
#include "cc/trees/channel_main.h"
#include "cc/trees/remote_proto_channel.h"
#include "cc/trees/task_runner_provider.h"
namespace cc {
class ProxyMain;
namespace proto {
class CompositorMessage;
}
class CC_EXPORT RemoteChannelMain : public ChannelMain,
public RemoteProtoChannel::ProtoReceiver {
public:
static scoped_ptr<RemoteChannelMain> Create(
RemoteProtoChannel* remote_proto_channel,
ProxyMain* proxy_main,
TaskRunnerProvider* task_runner_provider);
~RemoteChannelMain() override;
// ChannelMain implementation
void SetThrottleFrameProductionOnImpl(bool throttle) override;
void UpdateTopControlsStateOnImpl(TopControlsState constraints,
TopControlsState current,
bool animate) override;
void InitializeOutputSurfaceOnImpl(OutputSurface* output_surface) override;
void MainThreadHasStoppedFlingingOnImpl() override;
void SetInputThrottledUntilCommitOnImpl(bool is_throttled) override;
void SetDeferCommitsOnImpl(bool defer_commits) override;
void FinishAllRenderingOnImpl(CompletionEvent* completion) override;
void SetVisibleOnImpl(bool visible) override;
void ReleaseOutputSurfaceOnImpl(CompletionEvent* completion) override;
void MainFrameWillHappenOnImplForTesting(
CompletionEvent* completion,
bool* main_frame_will_happen) override;
void SetNeedsRedrawOnImpl(const gfx::Rect& damage_rect) override;
void SetNeedsCommitOnImpl() override;
void BeginMainFrameAbortedOnImpl(
CommitEarlyOutReason reason,
base::TimeTicks main_thread_start_time) override;
void StartCommitOnImpl(CompletionEvent* completion,
LayerTreeHost* layer_tree_host,
base::TimeTicks main_thread_start_time,
bool hold_commit_for_activation) override;
void SynchronouslyInitializeImpl(
LayerTreeHost* layer_tree_host,
scoped_ptr<BeginFrameSource> external_begin_frame_source) override;
void SynchronouslyCloseImpl() override;
// RemoteProtoChannel::ProtoReceiver implementation
void OnProtoReceived(scoped_ptr<proto::CompositorMessage> proto) override;
protected:
RemoteChannelMain(RemoteProtoChannel* remote_proto_channel,
ProxyMain* proxy_main,
TaskRunnerProvider* task_runner_provider);
private:
void SendMessageProto(const proto::CompositorMessage& proto);
RemoteProtoChannel* remote_proto_channel_;
ProxyMain* proxy_main_;
TaskRunnerProvider* task_runner_provider_;
bool initialized_;
DISALLOW_COPY_AND_ASSIGN(RemoteChannelMain);
};
} // namespace cc
#endif // CC_TREES_REMOTE_CHANNEL_MAIN_H_
|