| 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(ENABLE_GPU) | 5 #if defined(ENABLE_GPU) |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 const gfx::GLSurfaceHandle& handle, | 42 const gfx::GLSurfaceHandle& handle, |
| 43 gpu::gles2::MailboxManager* mailbox_manager, | 43 gpu::gles2::MailboxManager* mailbox_manager, |
| 44 const gfx::Size& size, | 44 const gfx::Size& size, |
| 45 const gpu::gles2::DisallowedFeatures& disallowed_features, | 45 const gpu::gles2::DisallowedFeatures& disallowed_features, |
| 46 const std::string& allowed_extensions, | 46 const std::string& allowed_extensions, |
| 47 const std::vector<int32>& attribs, | 47 const std::vector<int32>& attribs, |
| 48 gfx::GpuPreference gpu_preference, | 48 gfx::GpuPreference gpu_preference, |
| 49 int32 route_id, | 49 int32 route_id, |
| 50 int32 surface_id, | 50 int32 surface_id, |
| 51 GpuWatchdog* watchdog, | 51 GpuWatchdog* watchdog, |
| 52 bool software) | 52 bool software, |
| 53 base::WeakPtr<gpu::ShaderCache> shader_cache) |
| 53 : channel_(channel), | 54 : channel_(channel), |
| 54 handle_(handle), | 55 handle_(handle), |
| 55 initial_size_(size), | 56 initial_size_(size), |
| 56 disallowed_features_(disallowed_features), | 57 disallowed_features_(disallowed_features), |
| 57 allowed_extensions_(allowed_extensions), | 58 allowed_extensions_(allowed_extensions), |
| 58 requested_attribs_(attribs), | 59 requested_attribs_(attribs), |
| 59 gpu_preference_(gpu_preference), | 60 gpu_preference_(gpu_preference), |
| 60 route_id_(route_id), | 61 route_id_(route_id), |
| 61 software_(software), | 62 software_(software), |
| 62 client_has_memory_allocation_changed_callback_(false), | 63 client_has_memory_allocation_changed_callback_(false), |
| 63 last_flush_count_(0), | 64 last_flush_count_(0), |
| 64 parent_stub_for_initialization_(), | 65 parent_stub_for_initialization_(), |
| 65 parent_texture_for_initialization_(0), | 66 parent_texture_for_initialization_(0), |
| 66 watchdog_(watchdog) { | 67 watchdog_(watchdog) { |
| 67 if (share_group) { | 68 if (share_group) { |
| 68 context_group_ = share_group->context_group_; | 69 context_group_ = share_group->context_group_; |
| 69 } else { | 70 } else { |
| 70 context_group_ = new gpu::gles2::ContextGroup(mailbox_manager, true); | 71 context_group_ = new gpu::gles2::ContextGroup(mailbox_manager, |
| 72 true, |
| 73 shader_cache); |
| 71 } | 74 } |
| 72 if (surface_id != 0) | 75 if (surface_id != 0) |
| 73 surface_state_.reset(new GpuCommandBufferStubBase::SurfaceState( | 76 surface_state_.reset(new GpuCommandBufferStubBase::SurfaceState( |
| 74 surface_id, true, base::TimeTicks::Now())); | 77 surface_id, true, base::TimeTicks::Now())); |
| 75 } | 78 } |
| 76 | 79 |
| 77 GpuCommandBufferStub::~GpuCommandBufferStub() { | 80 GpuCommandBufferStub::~GpuCommandBufferStub() { |
| 78 Destroy(); | 81 Destroy(); |
| 79 | 82 |
| 80 GpuChannelManager* gpu_channel_manager = channel_->gpu_channel_manager(); | 83 GpuChannelManager* gpu_channel_manager = channel_->gpu_channel_manager(); |
| (...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 711 | 714 |
| 712 void GpuCommandBufferStub::SetMemoryAllocation( | 715 void GpuCommandBufferStub::SetMemoryAllocation( |
| 713 const GpuMemoryAllocation& allocation) { | 716 const GpuMemoryAllocation& allocation) { |
| 714 Send(new GpuCommandBufferMsg_SetMemoryAllocation(route_id_, allocation)); | 717 Send(new GpuCommandBufferMsg_SetMemoryAllocation(route_id_, allocation)); |
| 715 if (!surface_) | 718 if (!surface_) |
| 716 return; | 719 return; |
| 717 surface_->SetFrontbufferAllocation(allocation.suggest_have_frontbuffer); | 720 surface_->SetFrontbufferAllocation(allocation.suggest_have_frontbuffer); |
| 718 } | 721 } |
| 719 | 722 |
| 720 #endif // defined(ENABLE_GPU) | 723 #endif // defined(ENABLE_GPU) |
| OLD | NEW |