| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #if defined(OS_WIN) | 5 #if defined(OS_WIN) |
| 6 #include <windows.h> | 6 #include <windows.h> |
| 7 #endif | 7 #endif |
| 8 | 8 |
| 9 #include "content/common/gpu/gpu_channel.h" | 9 #include "content/common/gpu/gpu_channel.h" |
| 10 | 10 |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 | 105 |
| 106 bool handled = false; | 106 bool handled = false; |
| 107 if ((message.type() == GpuCommandBufferMsg_RetireSyncPoint::ID) && | 107 if ((message.type() == GpuCommandBufferMsg_RetireSyncPoint::ID) && |
| 108 !future_sync_points_) { | 108 !future_sync_points_) { |
| 109 DLOG(ERROR) << "Untrusted client should not send " | 109 DLOG(ERROR) << "Untrusted client should not send " |
| 110 "GpuCommandBufferMsg_RetireSyncPoint message"; | 110 "GpuCommandBufferMsg_RetireSyncPoint message"; |
| 111 return true; | 111 return true; |
| 112 } | 112 } |
| 113 | 113 |
| 114 if (message.type() == GpuCommandBufferMsg_InsertSyncPoint::ID) { | 114 if (message.type() == GpuCommandBufferMsg_InsertSyncPoint::ID) { |
| 115 Tuple<bool> retire; | 115 base::Tuple<bool> retire; |
| 116 IPC::Message* reply = IPC::SyncMessage::GenerateReply(&message); | 116 IPC::Message* reply = IPC::SyncMessage::GenerateReply(&message); |
| 117 if (!GpuCommandBufferMsg_InsertSyncPoint::ReadSendParam(&message, | 117 if (!GpuCommandBufferMsg_InsertSyncPoint::ReadSendParam(&message, |
| 118 &retire)) { | 118 &retire)) { |
| 119 reply->set_reply_error(); | 119 reply->set_reply_error(); |
| 120 Send(reply); | 120 Send(reply); |
| 121 return true; | 121 return true; |
| 122 } | 122 } |
| 123 if (!future_sync_points_ && !get<0>(retire)) { | 123 if (!future_sync_points_ && !base::get<0>(retire)) { |
| 124 LOG(ERROR) << "Untrusted contexts can't create future sync points"; | 124 LOG(ERROR) << "Untrusted contexts can't create future sync points"; |
| 125 reply->set_reply_error(); | 125 reply->set_reply_error(); |
| 126 Send(reply); | 126 Send(reply); |
| 127 return true; | 127 return true; |
| 128 } | 128 } |
| 129 uint32 sync_point = sync_point_manager_->GenerateSyncPoint(); | 129 uint32 sync_point = sync_point_manager_->GenerateSyncPoint(); |
| 130 GpuCommandBufferMsg_InsertSyncPoint::WriteReplyParams(reply, sync_point); | 130 GpuCommandBufferMsg_InsertSyncPoint::WriteReplyParams(reply, sync_point); |
| 131 Send(reply); | 131 Send(reply); |
| 132 task_runner_->PostTask( | 132 task_runner_->PostTask( |
| 133 FROM_HERE, | 133 FROM_HERE, |
| 134 base::Bind(&GpuChannelMessageFilter::InsertSyncPointOnMainThread, | 134 base::Bind(&GpuChannelMessageFilter::InsertSyncPointOnMainThread, |
| 135 gpu_channel_, sync_point_manager_, message.routing_id(), | 135 gpu_channel_, sync_point_manager_, message.routing_id(), |
| 136 get<0>(retire), sync_point)); | 136 base::get<0>(retire), sync_point)); |
| 137 handled = true; | 137 handled = true; |
| 138 } | 138 } |
| 139 | 139 |
| 140 // All other messages get processed by the GpuChannel. | 140 // All other messages get processed by the GpuChannel. |
| 141 messages_forwarded_to_channel_++; | 141 messages_forwarded_to_channel_++; |
| 142 if (preempting_flag_.get()) | 142 if (preempting_flag_.get()) |
| 143 pending_messages_.push(PendingMessage(messages_forwarded_to_channel_)); | 143 pending_messages_.push(PendingMessage(messages_forwarded_to_channel_)); |
| 144 UpdatePreemptionState(); | 144 UpdatePreemptionState(); |
| 145 | 145 |
| 146 return handled; | 146 return handled; |
| (...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 848 } | 848 } |
| 849 } | 849 } |
| 850 } | 850 } |
| 851 | 851 |
| 852 void GpuChannel::HandleUpdateValueState( | 852 void GpuChannel::HandleUpdateValueState( |
| 853 unsigned int target, const gpu::ValueState& state) { | 853 unsigned int target, const gpu::ValueState& state) { |
| 854 pending_valuebuffer_state_->UpdateState(target, state); | 854 pending_valuebuffer_state_->UpdateState(target, state); |
| 855 } | 855 } |
| 856 | 856 |
| 857 } // namespace content | 857 } // namespace content |
| OLD | NEW |