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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 context_group_ = share_group->context_group_; | 133 context_group_ = share_group->context_group_; |
134 } else { | 134 } else { |
135 context_group_ = new gpu::gles2::ContextGroup( | 135 context_group_ = new gpu::gles2::ContextGroup( |
136 mailbox_manager, | 136 mailbox_manager, |
137 new GpuCommandBufferMemoryTracker(channel), | 137 new GpuCommandBufferMemoryTracker(channel), |
138 true); | 138 true); |
139 } | 139 } |
140 if (surface_id != 0) | 140 if (surface_id != 0) |
141 surface_state_.reset(new GpuCommandBufferStubBase::SurfaceState( | 141 surface_state_.reset(new GpuCommandBufferStubBase::SurfaceState( |
142 surface_id, true, base::TimeTicks::Now())); | 142 surface_id, true, base::TimeTicks::Now())); |
143 if (handle_.sync_point) | |
144 OnWaitSyncPoint(handle_.sync_point); | |
145 } | 143 } |
146 | 144 |
147 GpuCommandBufferStub::~GpuCommandBufferStub() { | 145 GpuCommandBufferStub::~GpuCommandBufferStub() { |
148 Destroy(); | 146 Destroy(); |
149 | 147 |
150 GpuChannelManager* gpu_channel_manager = channel_->gpu_channel_manager(); | 148 GpuChannelManager* gpu_channel_manager = channel_->gpu_channel_manager(); |
151 gpu_channel_manager->Send(new GpuHostMsg_DestroyCommandBuffer(surface_id())); | 149 gpu_channel_manager->Send(new GpuHostMsg_DestroyCommandBuffer(surface_id())); |
152 } | 150 } |
153 | 151 |
154 bool GpuCommandBufferStub::OnMessageReceived(const IPC::Message& message) { | 152 bool GpuCommandBufferStub::OnMessageReceived(const IPC::Message& message) { |
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
845 const GpuMemoryAllocation& allocation) { | 843 const GpuMemoryAllocation& allocation) { |
846 Send(new GpuCommandBufferMsg_SetMemoryAllocation(route_id_, allocation)); | 844 Send(new GpuCommandBufferMsg_SetMemoryAllocation(route_id_, allocation)); |
847 // This can be called outside of OnMessageReceived, so the context needs to be | 845 // This can be called outside of OnMessageReceived, so the context needs to be |
848 // made current before calling methods on the surface. | 846 // made current before calling methods on the surface. |
849 if (!surface_ || !MakeCurrent()) | 847 if (!surface_ || !MakeCurrent()) |
850 return; | 848 return; |
851 surface_->SetFrontbufferAllocation(allocation.suggest_have_frontbuffer); | 849 surface_->SetFrontbufferAllocation(allocation.suggest_have_frontbuffer); |
852 } | 850 } |
853 | 851 |
854 #endif // defined(ENABLE_GPU) | 852 #endif // defined(ENABLE_GPU) |
OLD | NEW |