| 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 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 520 if (preempting_flag_.get()) { | 520 if (preempting_flag_.get()) { |
| 521 io_message_loop_->PostTask( | 521 io_message_loop_->PostTask( |
| 522 FROM_HERE, | 522 FROM_HERE, |
| 523 base::Bind(&GpuChannelMessageFilter::UpdateStubSchedulingState, | 523 base::Bind(&GpuChannelMessageFilter::UpdateStubSchedulingState, |
| 524 filter_, | 524 filter_, |
| 525 a_stub_is_descheduled)); | 525 a_stub_is_descheduled)); |
| 526 } | 526 } |
| 527 } | 527 } |
| 528 } | 528 } |
| 529 | 529 |
| 530 bool GpuChannel::CreateViewCommandBuffer( | 530 CreateCommandBufferResult GpuChannel::CreateViewCommandBuffer( |
| 531 const gfx::GLSurfaceHandle& window, | 531 const gfx::GLSurfaceHandle& window, |
| 532 int32 surface_id, | 532 int32 surface_id, |
| 533 const GPUCreateCommandBufferConfig& init_params, | 533 const GPUCreateCommandBufferConfig& init_params, |
| 534 int32 route_id) { | 534 int32 route_id) { |
| 535 TRACE_EVENT1("gpu", | 535 TRACE_EVENT1("gpu", |
| 536 "GpuChannel::CreateViewCommandBuffer", | 536 "GpuChannel::CreateViewCommandBuffer", |
| 537 "surface_id", | 537 "surface_id", |
| 538 surface_id); | 538 surface_id); |
| 539 | 539 |
| 540 GpuCommandBufferStub* share_group = stubs_.Lookup(init_params.share_group_id); | 540 GpuCommandBufferStub* share_group = stubs_.Lookup(init_params.share_group_id); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 561 route_id, | 561 route_id, |
| 562 surface_id, | 562 surface_id, |
| 563 watchdog_, | 563 watchdog_, |
| 564 software_, | 564 software_, |
| 565 init_params.active_url)); | 565 init_params.active_url)); |
| 566 if (preempted_flag_.get()) | 566 if (preempted_flag_.get()) |
| 567 stub->SetPreemptByFlag(preempted_flag_); | 567 stub->SetPreemptByFlag(preempted_flag_); |
| 568 if (!router_.AddRoute(route_id, stub.get())) { | 568 if (!router_.AddRoute(route_id, stub.get())) { |
| 569 DLOG(ERROR) << "GpuChannel::CreateViewCommandBuffer(): " | 569 DLOG(ERROR) << "GpuChannel::CreateViewCommandBuffer(): " |
| 570 "failed to add route"; | 570 "failed to add route"; |
| 571 return false; | 571 return CREATE_COMMAND_BUFFER_FAILED_AND_CHANNEL_LOST; |
| 572 } | 572 } |
| 573 stubs_.AddWithID(stub.release(), route_id); | 573 stubs_.AddWithID(stub.release(), route_id); |
| 574 return true; | 574 return CREATE_COMMAND_BUFFER_SUCCEEDED; |
| 575 } | 575 } |
| 576 | 576 |
| 577 GpuCommandBufferStub* GpuChannel::LookupCommandBuffer(int32 route_id) { | 577 GpuCommandBufferStub* GpuChannel::LookupCommandBuffer(int32 route_id) { |
| 578 return stubs_.Lookup(route_id); | 578 return stubs_.Lookup(route_id); |
| 579 } | 579 } |
| 580 | 580 |
| 581 void GpuChannel::CreateImage( | 581 void GpuChannel::CreateImage( |
| 582 gfx::PluginWindowHandle window, | 582 gfx::PluginWindowHandle window, |
| 583 int32 image_id, | 583 int32 image_id, |
| 584 gfx::Size* size) { | 584 gfx::Size* size) { |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 836 uint64 GpuChannel::GetMemoryUsage() { | 836 uint64 GpuChannel::GetMemoryUsage() { |
| 837 uint64 size = 0; | 837 uint64 size = 0; |
| 838 for (StubMap::Iterator<GpuCommandBufferStub> it(&stubs_); | 838 for (StubMap::Iterator<GpuCommandBufferStub> it(&stubs_); |
| 839 !it.IsAtEnd(); it.Advance()) { | 839 !it.IsAtEnd(); it.Advance()) { |
| 840 size += it.GetCurrentValue()->GetMemoryUsage(); | 840 size += it.GetCurrentValue()->GetMemoryUsage(); |
| 841 } | 841 } |
| 842 return size; | 842 return size; |
| 843 } | 843 } |
| 844 | 844 |
| 845 } // namespace content | 845 } // namespace content |
| OLD | NEW |