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 "content/renderer/pepper/ppb_graphics_3d_impl.h" | 5 #include "content/renderer/pepper/ppb_graphics_3d_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/feature_list.h" | 9 #include "base/feature_list.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
11 #include "base/metrics/histogram_macros.h" | 11 #include "base/metrics/histogram_macros.h" |
12 #include "base/single_thread_task_runner.h" | 12 #include "base/single_thread_task_runner.h" |
13 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
14 #include "base/threading/thread_task_runner_handle.h" | 14 #include "base/threading/thread_task_runner_handle.h" |
| 15 #include "content/common/gpu_stream_constants.h" |
15 #include "content/public/common/content_features.h" | 16 #include "content/public/common/content_features.h" |
16 #include "content/public/common/content_switches.h" | 17 #include "content/public/common/content_switches.h" |
17 #include "content/public/common/web_preferences.h" | 18 #include "content/public/common/web_preferences.h" |
18 #include "content/renderer/pepper/host_globals.h" | 19 #include "content/renderer/pepper/host_globals.h" |
19 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" | 20 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" |
20 #include "content/renderer/pepper/plugin_instance_throttler_impl.h" | 21 #include "content/renderer/pepper/plugin_instance_throttler_impl.h" |
21 #include "content/renderer/pepper/plugin_module.h" | 22 #include "content/renderer/pepper/plugin_module.h" |
22 #include "content/renderer/render_thread_impl.h" | 23 #include "content/renderer/render_thread_impl.h" |
23 #include "content/renderer/render_view_impl.h" | 24 #include "content/renderer/render_view_impl.h" |
24 #include "gpu/GLES2/gl2extchromium.h" | 25 #include "gpu/GLES2/gl2extchromium.h" |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 if (!plugin_instance->is_flash_plugin()) | 251 if (!plugin_instance->is_flash_plugin()) |
251 UMA_HISTOGRAM_BOOLEAN("Pepper.Graphics3DHasShareGroup", !!share_context); | 252 UMA_HISTOGRAM_BOOLEAN("Pepper.Graphics3DHasShareGroup", !!share_context); |
252 if (share_context) { | 253 if (share_context) { |
253 PPB_Graphics3D_Impl* share_graphics = | 254 PPB_Graphics3D_Impl* share_graphics = |
254 static_cast<PPB_Graphics3D_Impl*>(share_context); | 255 static_cast<PPB_Graphics3D_Impl*>(share_context); |
255 share_buffer = share_graphics->GetCommandBufferProxy(); | 256 share_buffer = share_graphics->GetCommandBufferProxy(); |
256 } | 257 } |
257 | 258 |
258 command_buffer_ = gpu::CommandBufferProxyImpl::Create( | 259 command_buffer_ = gpu::CommandBufferProxyImpl::Create( |
259 std::move(channel), gpu::kNullSurfaceHandle, share_buffer, | 260 std::move(channel), gpu::kNullSurfaceHandle, share_buffer, |
260 gpu::GPU_STREAM_DEFAULT, gpu::GpuStreamPriority::NORMAL, attrib_helper, | 261 kGpuStreamIdDefault, kGpuStreamPriorityDefault, attrib_helper, |
261 GURL::EmptyGURL(), base::ThreadTaskRunnerHandle::Get()); | 262 GURL::EmptyGURL(), base::ThreadTaskRunnerHandle::Get()); |
262 if (!command_buffer_) | 263 if (!command_buffer_) |
263 return false; | 264 return false; |
264 | 265 |
265 command_buffer_->SetGpuControlClient(this); | 266 command_buffer_->SetGpuControlClient(this); |
266 | 267 |
267 if (shared_state_handle) | 268 if (shared_state_handle) |
268 *shared_state_handle = command_buffer_->GetSharedStateHandle(); | 269 *shared_state_handle = command_buffer_->GetSharedStateHandle(); |
269 if (capabilities) | 270 if (capabilities) |
270 *capabilities = command_buffer_->GetCapabilities(); | 271 *capabilities = command_buffer_->GetCapabilities(); |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 if (!mailboxes_to_reuse_.empty()) { | 353 if (!mailboxes_to_reuse_.empty()) { |
353 gpu::Mailbox mailbox = mailboxes_to_reuse_.back(); | 354 gpu::Mailbox mailbox = mailboxes_to_reuse_.back(); |
354 mailboxes_to_reuse_.pop_back(); | 355 mailboxes_to_reuse_.pop_back(); |
355 return mailbox; | 356 return mailbox; |
356 } | 357 } |
357 | 358 |
358 return gpu::Mailbox::Generate(); | 359 return gpu::Mailbox::Generate(); |
359 } | 360 } |
360 | 361 |
361 } // namespace content | 362 } // namespace content |
OLD | NEW |