Chromium Code Reviews| 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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 194 new GpuCommandBufferMemoryTracker(channel), | 194 new GpuCommandBufferMemoryTracker(channel), |
| 195 channel_->gpu_channel_manager()->shader_translator_cache(), | 195 channel_->gpu_channel_manager()->shader_translator_cache(), |
| 196 NULL, | 196 NULL, |
| 197 subscription_ref_set, | 197 subscription_ref_set, |
| 198 pending_valuebuffer_state, | 198 pending_valuebuffer_state, |
| 199 attrib_parser.bind_generates_resource); | 199 attrib_parser.bind_generates_resource); |
| 200 } | 200 } |
| 201 | 201 |
| 202 use_virtualized_gl_context_ |= | 202 use_virtualized_gl_context_ |= |
| 203 context_group_->feature_info()->workarounds().use_virtualized_gl_contexts; | 203 context_group_->feature_info()->workarounds().use_virtualized_gl_contexts; |
| 204 | |
| 205 bool is_offscreen = surface_id_ == 0; | |
| 206 if (is_offscreen && initial_size_.IsEmpty()) { | |
|
hendrikw
2015/04/24 18:33:38
I might rename initial_size_ to initial_offscreen_
| |
| 207 // If we're an offscreen surface with zero width and/or height, set to a | |
| 208 // non-zero size so that we have a complete framebuffer for operations like | |
| 209 // glClear. | |
| 210 initial_size_ = gfx::Size(1, 1); | |
| 211 } | |
| 204 } | 212 } |
| 205 | 213 |
| 206 GpuCommandBufferStub::~GpuCommandBufferStub() { | 214 GpuCommandBufferStub::~GpuCommandBufferStub() { |
| 207 Destroy(); | 215 Destroy(); |
| 208 | 216 |
| 209 GpuChannelManager* gpu_channel_manager = channel_->gpu_channel_manager(); | 217 GpuChannelManager* gpu_channel_manager = channel_->gpu_channel_manager(); |
| 210 gpu_channel_manager->Send(new GpuHostMsg_DestroyCommandBuffer(surface_id())); | 218 gpu_channel_manager->Send(new GpuHostMsg_DestroyCommandBuffer(surface_id())); |
| 211 } | 219 } |
| 212 | 220 |
| 213 GpuMemoryManager* GpuCommandBufferStub::GetMemoryManager() const { | 221 GpuMemoryManager* GpuCommandBufferStub::GetMemoryManager() const { |
| (...skipping 888 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1102 Send(new GpuCommandBufferMsg_SwapBuffersCompleted(route_id_, latency_info)); | 1110 Send(new GpuCommandBufferMsg_SwapBuffersCompleted(route_id_, latency_info)); |
| 1103 } | 1111 } |
| 1104 | 1112 |
| 1105 void GpuCommandBufferStub::SendUpdateVSyncParameters(base::TimeTicks timebase, | 1113 void GpuCommandBufferStub::SendUpdateVSyncParameters(base::TimeTicks timebase, |
| 1106 base::TimeDelta interval) { | 1114 base::TimeDelta interval) { |
| 1107 Send(new GpuCommandBufferMsg_UpdateVSyncParameters(route_id_, timebase, | 1115 Send(new GpuCommandBufferMsg_UpdateVSyncParameters(route_id_, timebase, |
| 1108 interval)); | 1116 interval)); |
| 1109 } | 1117 } |
| 1110 | 1118 |
| 1111 } // namespace content | 1119 } // namespace content |
| OLD | NEW |