| 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 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 613 stub->SetPreemptByFlag(preempted_flag_); | 613 stub->SetPreemptByFlag(preempted_flag_); |
| 614 if (!router_.AddRoute(route_id, stub.get())) { | 614 if (!router_.AddRoute(route_id, stub.get())) { |
| 615 DLOG(ERROR) << "GpuChannel::CreateViewCommandBuffer(): " | 615 DLOG(ERROR) << "GpuChannel::CreateViewCommandBuffer(): " |
| 616 "failed to add route"; | 616 "failed to add route"; |
| 617 return CREATE_COMMAND_BUFFER_FAILED_AND_CHANNEL_LOST; | 617 return CREATE_COMMAND_BUFFER_FAILED_AND_CHANNEL_LOST; |
| 618 } | 618 } |
| 619 stubs_.AddWithID(stub.release(), route_id); | 619 stubs_.AddWithID(stub.release(), route_id); |
| 620 return CREATE_COMMAND_BUFFER_SUCCEEDED; | 620 return CREATE_COMMAND_BUFFER_SUCCEEDED; |
| 621 } | 621 } |
| 622 | 622 |
| 623 bool GpuChannel::CreateStreamTexture(int32 image_id, |
| 624 int32 route_id, |
| 625 int32 stream_id) { |
| 626 GpuCommandBufferStub* stub = LookupCommandBuffer(route_id); |
| 627 DCHECK(stub); |
| 628 bool success = false; |
| 629 stub->CreateStreamTexture(image_id, stream_id, &success); |
| 630 return success; |
| 631 } |
| 632 |
| 623 GpuCommandBufferStub* GpuChannel::LookupCommandBuffer(int32 route_id) { | 633 GpuCommandBufferStub* GpuChannel::LookupCommandBuffer(int32 route_id) { |
| 624 return stubs_.Lookup(route_id); | 634 return stubs_.Lookup(route_id); |
| 625 } | 635 } |
| 626 | 636 |
| 627 void GpuChannel::LoseAllContexts() { | 637 void GpuChannel::LoseAllContexts() { |
| 628 gpu_channel_manager_->LoseAllContexts(); | 638 gpu_channel_manager_->LoseAllContexts(); |
| 629 } | 639 } |
| 630 | 640 |
| 631 void GpuChannel::MarkAllContextsLost() { | 641 void GpuChannel::MarkAllContextsLost() { |
| 632 for (StubMap::Iterator<GpuCommandBufferStub> it(&stubs_); | 642 for (StubMap::Iterator<GpuCommandBufferStub> it(&stubs_); |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 882 pmd->CreateAllocatorDump(base::StringPrintf("gl/%s", dump_name.c_str())); | 892 pmd->CreateAllocatorDump(base::StringPrintf("gl/%s", dump_name.c_str())); |
| 883 | 893 |
| 884 dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize, | 894 dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize, |
| 885 base::trace_event::MemoryAllocatorDump::kUnitsBytes, | 895 base::trace_event::MemoryAllocatorDump::kUnitsBytes, |
| 886 GetMemoryUsage()); | 896 GetMemoryUsage()); |
| 887 | 897 |
| 888 return true; | 898 return true; |
| 889 } | 899 } |
| 890 | 900 |
| 891 } // namespace content | 901 } // namespace content |
| OLD | NEW |