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/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "base/hash.h" | 9 #include "base/hash.h" |
10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 27 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
28 #include "gpu/command_buffer/common/mailbox.h" | 28 #include "gpu/command_buffer/common/mailbox.h" |
29 #include "gpu/command_buffer/service/gl_context_virtual.h" | 29 #include "gpu/command_buffer/service/gl_context_virtual.h" |
30 #include "gpu/command_buffer/service/gl_state_restorer_impl.h" | 30 #include "gpu/command_buffer/service/gl_state_restorer_impl.h" |
31 #include "gpu/command_buffer/service/image_manager.h" | 31 #include "gpu/command_buffer/service/image_manager.h" |
32 #include "gpu/command_buffer/service/logger.h" | 32 #include "gpu/command_buffer/service/logger.h" |
33 #include "gpu/command_buffer/service/mailbox_manager.h" | 33 #include "gpu/command_buffer/service/mailbox_manager.h" |
34 #include "gpu/command_buffer/service/memory_tracking.h" | 34 #include "gpu/command_buffer/service/memory_tracking.h" |
35 #include "gpu/command_buffer/service/query_manager.h" | 35 #include "gpu/command_buffer/service/query_manager.h" |
36 #include "gpu/command_buffer/service/sync_point_manager.h" | 36 #include "gpu/command_buffer/service/sync_point_manager.h" |
| 37 #include "gpu/command_buffer/service/valuebuffer_manager.h" |
37 #include "ui/gl/gl_bindings.h" | 38 #include "ui/gl/gl_bindings.h" |
38 #include "ui/gl/gl_switches.h" | 39 #include "ui/gl/gl_switches.h" |
39 | 40 |
40 #if defined(OS_WIN) | 41 #if defined(OS_WIN) |
41 #include "content/public/common/sandbox_init.h" | 42 #include "content/public/common/sandbox_init.h" |
42 #endif | 43 #endif |
43 | 44 |
44 #if defined(OS_ANDROID) | 45 #if defined(OS_ANDROID) |
45 #include "content/common/gpu/stream_texture_android.h" | 46 #include "content/common/gpu/stream_texture_android.h" |
46 #endif | 47 #endif |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 return new DevToolsChannelData(res.release()); | 141 return new DevToolsChannelData(res.release()); |
141 } | 142 } |
142 | 143 |
143 } // namespace | 144 } // namespace |
144 | 145 |
145 GpuCommandBufferStub::GpuCommandBufferStub( | 146 GpuCommandBufferStub::GpuCommandBufferStub( |
146 GpuChannel* channel, | 147 GpuChannel* channel, |
147 GpuCommandBufferStub* share_group, | 148 GpuCommandBufferStub* share_group, |
148 const gfx::GLSurfaceHandle& handle, | 149 const gfx::GLSurfaceHandle& handle, |
149 gpu::gles2::MailboxManager* mailbox_manager, | 150 gpu::gles2::MailboxManager* mailbox_manager, |
| 151 gpu::ValueStateMap* pending_valuebuffer_state, |
150 const gfx::Size& size, | 152 const gfx::Size& size, |
151 const gpu::gles2::DisallowedFeatures& disallowed_features, | 153 const gpu::gles2::DisallowedFeatures& disallowed_features, |
152 const std::vector<int32>& attribs, | 154 const std::vector<int32>& attribs, |
153 gfx::GpuPreference gpu_preference, | 155 gfx::GpuPreference gpu_preference, |
154 bool use_virtualized_gl_context, | 156 bool use_virtualized_gl_context, |
155 int32 route_id, | 157 int32 route_id, |
156 int32 surface_id, | 158 int32 surface_id, |
157 GpuWatchdog* watchdog, | 159 GpuWatchdog* watchdog, |
158 bool software, | 160 bool software, |
159 const GURL& active_url) | 161 const GURL& active_url) |
(...skipping 24 matching lines...) Expand all Loading... |
184 if (share_group) { | 186 if (share_group) { |
185 context_group_ = share_group->context_group_; | 187 context_group_ = share_group->context_group_; |
186 DCHECK(context_group_->bind_generates_resource() == | 188 DCHECK(context_group_->bind_generates_resource() == |
187 attrib_parser.bind_generates_resource); | 189 attrib_parser.bind_generates_resource); |
188 } else { | 190 } else { |
189 context_group_ = new gpu::gles2::ContextGroup( | 191 context_group_ = new gpu::gles2::ContextGroup( |
190 mailbox_manager, | 192 mailbox_manager, |
191 new GpuCommandBufferMemoryTracker(channel), | 193 new GpuCommandBufferMemoryTracker(channel), |
192 channel_->gpu_channel_manager()->shader_translator_cache(), | 194 channel_->gpu_channel_manager()->shader_translator_cache(), |
193 NULL, | 195 NULL, |
| 196 pending_valuebuffer_state, |
194 attrib_parser.bind_generates_resource); | 197 attrib_parser.bind_generates_resource); |
195 } | 198 } |
196 | 199 |
197 use_virtualized_gl_context_ |= | 200 use_virtualized_gl_context_ |= |
198 context_group_->feature_info()->workarounds().use_virtualized_gl_contexts; | 201 context_group_->feature_info()->workarounds().use_virtualized_gl_contexts; |
199 } | 202 } |
200 | 203 |
201 GpuCommandBufferStub::~GpuCommandBufferStub() { | 204 GpuCommandBufferStub::~GpuCommandBufferStub() { |
202 Destroy(); | 205 Destroy(); |
203 | 206 |
(...skipping 876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1080 uint64 GpuCommandBufferStub::GetMemoryUsage() const { | 1083 uint64 GpuCommandBufferStub::GetMemoryUsage() const { |
1081 return GetMemoryManager()->GetClientMemoryUsage(this); | 1084 return GetMemoryManager()->GetClientMemoryUsage(this); |
1082 } | 1085 } |
1083 | 1086 |
1084 void GpuCommandBufferStub::SwapBuffersCompleted( | 1087 void GpuCommandBufferStub::SwapBuffersCompleted( |
1085 const std::vector<ui::LatencyInfo>& latency_info) { | 1088 const std::vector<ui::LatencyInfo>& latency_info) { |
1086 Send(new GpuCommandBufferMsg_SwapBuffersCompleted(route_id_, latency_info)); | 1089 Send(new GpuCommandBufferMsg_SwapBuffersCompleted(route_id_, latency_info)); |
1087 } | 1090 } |
1088 | 1091 |
1089 } // namespace content | 1092 } // namespace content |
OLD | NEW |