| OLD | NEW |
| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 begin_frame_source_filter_->AddHandlerOnCompositorThread( | 67 begin_frame_source_filter_->AddHandlerOnCompositorThread( |
| 68 routing_id_, | 68 routing_id_, |
| 69 begin_frame_source_filter_handler_); | 69 begin_frame_source_filter_handler_); |
| 70 } | 70 } |
| 71 | 71 |
| 72 void CompositorExternalBeginFrameSource::OnMessageReceived( | 72 void CompositorExternalBeginFrameSource::OnMessageReceived( |
| 73 const IPC::Message& message) { | 73 const IPC::Message& message) { |
| 74 DCHECK(CalledOnValidThread()); | 74 DCHECK(CalledOnValidThread()); |
| 75 DCHECK(begin_frame_source_proxy_.get()); | 75 DCHECK(begin_frame_source_proxy_.get()); |
| 76 IPC_BEGIN_MESSAGE_MAP(CompositorExternalBeginFrameSource, message) | 76 IPC_BEGIN_MESSAGE_MAP(CompositorExternalBeginFrameSource, message) |
| 77 IPC_MESSAGE_HANDLER(ViewMsg_SetBeginFramePaused, SetBeginFrameSourcePaused) |
| 77 IPC_MESSAGE_HANDLER(ViewMsg_BeginFrame, OnBeginFrame) | 78 IPC_MESSAGE_HANDLER(ViewMsg_BeginFrame, OnBeginFrame) |
| 78 IPC_END_MESSAGE_MAP() | 79 IPC_END_MESSAGE_MAP() |
| 79 } | 80 } |
| 80 | 81 |
| 81 void CompositorExternalBeginFrameSource::OnBeginFrame( | 82 void CompositorExternalBeginFrameSource::OnBeginFrame( |
| 82 const cc::BeginFrameArgs& args) { | 83 const cc::BeginFrameArgs& args) { |
| 83 DCHECK(CalledOnValidThread()); | 84 DCHECK(CalledOnValidThread()); |
| 84 missed_begin_frame_args_ = args; | 85 missed_begin_frame_args_ = args; |
| 85 missed_begin_frame_args_.type = cc::BeginFrameArgs::MISSED; | 86 missed_begin_frame_args_.type = cc::BeginFrameArgs::MISSED; |
| 86 CallOnBeginFrame(args); | 87 CallOnBeginFrame(args); |
| 87 } | 88 } |
| 88 | 89 |
| 89 bool CompositorExternalBeginFrameSource::Send(IPC::Message* message) { | 90 bool CompositorExternalBeginFrameSource::Send(IPC::Message* message) { |
| 90 return message_sender_->Send(message); | 91 return message_sender_->Send(message); |
| 91 } | 92 } |
| 92 | 93 |
| 93 } // namespace content | 94 } // namespace content |
| OLD | NEW |