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 #include "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/bind_helpers.h" | 6 #include "base/bind_helpers.h" |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/hash.h" | 8 #include "base/hash.h" |
9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
10 #include "base/memory/shared_memory.h" | 10 #include "base/memory/shared_memory.h" |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 OnSignalSyncPoint) | 283 OnSignalSyncPoint) |
284 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_SignalQuery, | 284 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_SignalQuery, |
285 OnSignalQuery) | 285 OnSignalQuery) |
286 IPC_MESSAGE_HANDLER( | 286 IPC_MESSAGE_HANDLER( |
287 GpuCommandBufferMsg_SetClientHasMemoryAllocationChangedCallback, | 287 GpuCommandBufferMsg_SetClientHasMemoryAllocationChangedCallback, |
288 OnSetClientHasMemoryAllocationChangedCallback) | 288 OnSetClientHasMemoryAllocationChangedCallback) |
289 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_CreateImage, OnCreateImage); | 289 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_CreateImage, OnCreateImage); |
290 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_DestroyImage, OnDestroyImage); | 290 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_DestroyImage, OnDestroyImage); |
291 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_CreateStreamTexture, | 291 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_CreateStreamTexture, |
292 OnCreateStreamTexture) | 292 OnCreateStreamTexture) |
| 293 IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_CreateStreamTextureImage, |
| 294 OnCreateStreamTextureImage) |
| 295 |
293 IPC_MESSAGE_UNHANDLED(handled = false) | 296 IPC_MESSAGE_UNHANDLED(handled = false) |
294 IPC_END_MESSAGE_MAP() | 297 IPC_END_MESSAGE_MAP() |
295 | 298 |
296 CheckCompleteWaits(); | 299 CheckCompleteWaits(); |
297 | 300 |
298 if (have_context) { | 301 if (have_context) { |
299 // Ensure that any delayed work that was created will be handled. | 302 // Ensure that any delayed work that was created will be handled. |
300 ScheduleDelayedWork(kHandleMoreWorkPeriodMs); | 303 ScheduleDelayedWork(kHandleMoreWorkPeriodMs); |
301 } | 304 } |
302 | 305 |
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
629 if (handle_.is_null() && !active_url_.is_empty()) { | 632 if (handle_.is_null() && !active_url_.is_empty()) { |
630 GpuChannelManager* gpu_channel_manager = channel_->gpu_channel_manager(); | 633 GpuChannelManager* gpu_channel_manager = channel_->gpu_channel_manager(); |
631 gpu_channel_manager->Send(new GpuHostMsg_DidCreateOffscreenContext( | 634 gpu_channel_manager->Send(new GpuHostMsg_DidCreateOffscreenContext( |
632 active_url_)); | 635 active_url_)); |
633 } | 636 } |
634 } | 637 } |
635 | 638 |
636 void GpuCommandBufferStub::OnCreateStreamTexture( | 639 void GpuCommandBufferStub::OnCreateStreamTexture( |
637 uint32 texture_id, int32 stream_id, bool* succeeded) { | 640 uint32 texture_id, int32 stream_id, bool* succeeded) { |
638 #if defined(OS_ANDROID) | 641 #if defined(OS_ANDROID) |
639 *succeeded = StreamTexture::Create(this, texture_id, stream_id); | 642 *succeeded = StreamTexture::CreateStreamTexture(this, texture_id, stream_id); |
640 #else | 643 #else |
641 *succeeded = false; | 644 *succeeded = false; |
642 #endif | 645 #endif |
| 646 } |
| 647 |
| 648 void GpuCommandBufferStub::OnCreateStreamTextureImage(int32 image_id, |
| 649 int32 stream_id, |
| 650 bool* succeeded) { |
| 651 #if defined(OS_ANDROID) |
| 652 *succeeded = |
| 653 StreamTexture::CreateStreamTextureImage(this, image_id, stream_id); |
| 654 #else |
| 655 *succeeded = false; |
| 656 #endif |
643 } | 657 } |
644 | 658 |
645 void GpuCommandBufferStub::SetLatencyInfoCallback( | 659 void GpuCommandBufferStub::SetLatencyInfoCallback( |
646 const LatencyInfoCallback& callback) { | 660 const LatencyInfoCallback& callback) { |
647 latency_info_callback_ = callback; | 661 latency_info_callback_ = callback; |
648 } | 662 } |
649 | 663 |
650 int32 GpuCommandBufferStub::GetRequestedAttribute(int attr) const { | 664 int32 GpuCommandBufferStub::GetRequestedAttribute(int attr) const { |
651 // The command buffer is pairs of enum, value | 665 // The command buffer is pairs of enum, value |
652 // search for the requested attribute, return the value. | 666 // search for the requested attribute, return the value. |
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1134 result)); | 1148 result)); |
1135 } | 1149 } |
1136 | 1150 |
1137 void GpuCommandBufferStub::SendUpdateVSyncParameters(base::TimeTicks timebase, | 1151 void GpuCommandBufferStub::SendUpdateVSyncParameters(base::TimeTicks timebase, |
1138 base::TimeDelta interval) { | 1152 base::TimeDelta interval) { |
1139 Send(new GpuCommandBufferMsg_UpdateVSyncParameters(route_id_, timebase, | 1153 Send(new GpuCommandBufferMsg_UpdateVSyncParameters(route_id_, timebase, |
1140 interval)); | 1154 interval)); |
1141 } | 1155 } |
1142 | 1156 |
1143 } // namespace content | 1157 } // namespace content |
OLD | NEW |