| 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 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 625 reply_message, true, capabilities); | 625 reply_message, true, capabilities); |
| 626 Send(reply_message); | 626 Send(reply_message); |
| 627 | 627 |
| 628 if (handle_.is_null() && !active_url_.is_empty()) { | 628 if (handle_.is_null() && !active_url_.is_empty()) { |
| 629 GpuChannelManager* gpu_channel_manager = channel_->gpu_channel_manager(); | 629 GpuChannelManager* gpu_channel_manager = channel_->gpu_channel_manager(); |
| 630 gpu_channel_manager->Send(new GpuHostMsg_DidCreateOffscreenContext( | 630 gpu_channel_manager->Send(new GpuHostMsg_DidCreateOffscreenContext( |
| 631 active_url_)); | 631 active_url_)); |
| 632 } | 632 } |
| 633 } | 633 } |
| 634 | 634 |
| 635 void GpuCommandBufferStub::OnCreateStreamTexture( | 635 void GpuCommandBufferStub::CreateStreamTexture(int32 image_id, |
| 636 uint32 texture_id, int32 stream_id, bool* succeeded) { | 636 int32 stream_id, |
| 637 bool* succeeded) { |
| 637 #if defined(OS_ANDROID) | 638 #if defined(OS_ANDROID) |
| 638 *succeeded = StreamTexture::Create(this, texture_id, stream_id); | 639 *succeeded = StreamTexture::Create(this, image_id, stream_id); |
| 639 #else | 640 #else |
| 640 *succeeded = false; | 641 *succeeded = false; |
| 641 #endif | 642 #endif |
| 642 } | 643 } |
| 643 | 644 |
| 645 void GpuCommandBufferStub::OnCreateStreamTexture(uint32 texture_id, |
| 646 int32 stream_id, |
| 647 bool* succeeded) { |
| 648 // TODO(sivag): Do we want to remove this interface completely? |
| 649 NOTREACHED(); |
| 650 } |
| 651 |
| 644 void GpuCommandBufferStub::SetLatencyInfoCallback( | 652 void GpuCommandBufferStub::SetLatencyInfoCallback( |
| 645 const LatencyInfoCallback& callback) { | 653 const LatencyInfoCallback& callback) { |
| 646 latency_info_callback_ = callback; | 654 latency_info_callback_ = callback; |
| 647 } | 655 } |
| 648 | 656 |
| 649 int32 GpuCommandBufferStub::GetRequestedAttribute(int attr) const { | 657 int32 GpuCommandBufferStub::GetRequestedAttribute(int attr) const { |
| 650 // The command buffer is pairs of enum, value | 658 // The command buffer is pairs of enum, value |
| 651 // search for the requested attribute, return the value. | 659 // search for the requested attribute, return the value. |
| 652 for (std::vector<int32>::const_iterator it = requested_attribs_.begin(); | 660 for (std::vector<int32>::const_iterator it = requested_attribs_.begin(); |
| 653 it != requested_attribs_.end(); ++it) { | 661 it != requested_attribs_.end(); ++it) { |
| (...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1133 result)); | 1141 result)); |
| 1134 } | 1142 } |
| 1135 | 1143 |
| 1136 void GpuCommandBufferStub::SendUpdateVSyncParameters(base::TimeTicks timebase, | 1144 void GpuCommandBufferStub::SendUpdateVSyncParameters(base::TimeTicks timebase, |
| 1137 base::TimeDelta interval) { | 1145 base::TimeDelta interval) { |
| 1138 Send(new GpuCommandBufferMsg_UpdateVSyncParameters(route_id_, timebase, | 1146 Send(new GpuCommandBufferMsg_UpdateVSyncParameters(route_id_, timebase, |
| 1139 interval)); | 1147 interval)); |
| 1140 } | 1148 } |
| 1141 | 1149 |
| 1142 } // namespace content | 1150 } // namespace content |
| OLD | NEW |