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

Side by Side Diff: content/renderer/gpu/compositor_external_begin_frame_source.cc

Issue 2740833005: [cc] Pass on BeginFrameAcks from CompositorEBFS through RWHVAura, DFH. (Closed)
Patch Set: address security comments Created 3 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
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/gpu/compositor_external_begin_frame_source.h" 5 #include "content/renderer/gpu/compositor_external_begin_frame_source.h"
6 6
7 #include "content/common/view_messages.h" 7 #include "content/common/view_messages.h"
8 #include "ipc/ipc_sync_channel.h" 8 #include "ipc/ipc_sync_channel.h"
9 #include "ipc/ipc_sync_message_filter.h" 9 #include "ipc/ipc_sync_message_filter.h"
10 10
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 } 48 }
49 49
50 external_begin_frame_source_.AddObserver(obs); 50 external_begin_frame_source_.AddObserver(obs);
51 } 51 }
52 52
53 void CompositorExternalBeginFrameSource::RemoveObserver( 53 void CompositorExternalBeginFrameSource::RemoveObserver(
54 cc::BeginFrameObserver* obs) { 54 cc::BeginFrameObserver* obs) {
55 external_begin_frame_source_.RemoveObserver(obs); 55 external_begin_frame_source_.RemoveObserver(obs);
56 } 56 }
57 57
58 void CompositorExternalBeginFrameSource::DidFinishFrame(
59 cc::BeginFrameObserver* obs,
60 const cc::BeginFrameAck& ack) {
61 external_begin_frame_source_.DidFinishFrame(obs, ack);
62 }
63
58 bool CompositorExternalBeginFrameSource::IsThrottled() const { 64 bool CompositorExternalBeginFrameSource::IsThrottled() const {
59 return true; 65 return true;
60 } 66 }
61 67
62 void CompositorExternalBeginFrameSource::OnNeedsBeginFrames( 68 void CompositorExternalBeginFrameSource::OnNeedsBeginFrames(
63 bool needs_begin_frames) { 69 bool needs_begin_frames) {
64 Send(new ViewHostMsg_SetNeedsBeginFrames(routing_id_, needs_begin_frames)); 70 Send(new ViewHostMsg_SetNeedsBeginFrames(routing_id_, needs_begin_frames));
65 } 71 }
66 72
67 void CompositorExternalBeginFrameSource::OnDidFinishFrame( 73 void CompositorExternalBeginFrameSource::OnDidFinishFrame(
68 const cc::BeginFrameAck& ack) { 74 const cc::BeginFrameAck& ack) {
69 // TODO(eseckler): Pass on the ack to the view host. 75 DCHECK_LE(cc::BeginFrameArgs::kStartingFrameNumber, ack.sequence_number);
76 // If there was damage, ViewHostMsg_SwapCompositorFrame includes the ack.
77 if (!ack.has_damage)
78 Send(new ViewHostMsg_BeginFrameDidNotSwap(routing_id_, ack));
70 } 79 }
71 80
72 void CompositorExternalBeginFrameSource::OnMessageReceived( 81 void CompositorExternalBeginFrameSource::OnMessageReceived(
73 const IPC::Message& message) { 82 const IPC::Message& message) {
74 DCHECK(CalledOnValidThread()); 83 DCHECK(CalledOnValidThread());
75 DCHECK(begin_frame_source_proxy_); 84 DCHECK(begin_frame_source_proxy_);
76 IPC_BEGIN_MESSAGE_MAP(CompositorExternalBeginFrameSource, message) 85 IPC_BEGIN_MESSAGE_MAP(CompositorExternalBeginFrameSource, message)
77 IPC_MESSAGE_HANDLER(ViewMsg_SetBeginFramePaused, 86 IPC_MESSAGE_HANDLER(ViewMsg_SetBeginFramePaused,
78 OnSetBeginFrameSourcePaused) 87 OnSetBeginFrameSourcePaused)
79 IPC_MESSAGE_HANDLER(ViewMsg_BeginFrame, OnBeginFrame) 88 IPC_MESSAGE_HANDLER(ViewMsg_BeginFrame, OnBeginFrame)
80 IPC_END_MESSAGE_MAP() 89 IPC_END_MESSAGE_MAP()
81 } 90 }
82 91
83 void CompositorExternalBeginFrameSource::OnSetBeginFrameSourcePaused( 92 void CompositorExternalBeginFrameSource::OnSetBeginFrameSourcePaused(
84 bool paused) { 93 bool paused) {
85 external_begin_frame_source_.OnSetBeginFrameSourcePaused(paused); 94 external_begin_frame_source_.OnSetBeginFrameSourcePaused(paused);
86 } 95 }
87 96
88 void CompositorExternalBeginFrameSource::OnBeginFrame( 97 void CompositorExternalBeginFrameSource::OnBeginFrame(
89 const cc::BeginFrameArgs& args) { 98 const cc::BeginFrameArgs& args) {
90 external_begin_frame_source_.OnBeginFrame(args); 99 external_begin_frame_source_.OnBeginFrame(args);
91 } 100 }
92 101
93 bool CompositorExternalBeginFrameSource::Send(IPC::Message* message) { 102 bool CompositorExternalBeginFrameSource::Send(IPC::Message* message) {
94 return message_sender_->Send(message); 103 return message_sender_->Send(message);
95 } 104 }
96 105
97 } // namespace content 106 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698