| 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/location.h" | 10 #include "base/location.h" |
| 10 #include "base/single_thread_task_runner.h" | 11 #include "base/single_thread_task_runner.h" |
| 11 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
| 12 #include "base/threading/thread_task_runner_handle.h" | 13 #include "base/threading/thread_task_runner_handle.h" |
| 14 #include "content/public/common/content_features.h" |
| 13 #include "content/public/common/content_switches.h" | 15 #include "content/public/common/content_switches.h" |
| 14 #include "content/public/common/web_preferences.h" | 16 #include "content/public/common/web_preferences.h" |
| 15 #include "content/renderer/pepper/host_globals.h" | 17 #include "content/renderer/pepper/host_globals.h" |
| 16 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" | 18 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" |
| 17 #include "content/renderer/pepper/plugin_instance_throttler_impl.h" | 19 #include "content/renderer/pepper/plugin_instance_throttler_impl.h" |
| 18 #include "content/renderer/pepper/plugin_module.h" | 20 #include "content/renderer/pepper/plugin_module.h" |
| 19 #include "content/renderer/render_thread_impl.h" | 21 #include "content/renderer/render_thread_impl.h" |
| 20 #include "content/renderer/render_view_impl.h" | 22 #include "content/renderer/render_view_impl.h" |
| 21 #include "gpu/GLES2/gl2extchromium.h" | 23 #include "gpu/GLES2/gl2extchromium.h" |
| 22 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 24 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 44 : PPB_Graphics3D_Shared(instance), | 46 : PPB_Graphics3D_Shared(instance), |
| 45 bound_to_instance_(false), | 47 bound_to_instance_(false), |
| 46 commit_pending_(false), | 48 commit_pending_(false), |
| 47 has_alpha_(false), | 49 has_alpha_(false), |
| 48 use_image_chromium_(false), | 50 use_image_chromium_(false), |
| 49 weak_ptr_factory_(this) { | 51 weak_ptr_factory_(this) { |
| 50 #if defined(OS_MACOSX) | 52 #if defined(OS_MACOSX) |
| 51 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 53 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 52 bool use_image_chromium = | 54 bool use_image_chromium = |
| 53 !command_line->HasSwitch(switches::kDisablePepper3DImageChromium); | 55 !command_line->HasSwitch(switches::kDisablePepper3DImageChromium); |
| 56 |
| 57 if (use_image_chromium) { |
| 58 use_image_chromium = |
| 59 base::FeatureList::IsEnabled(features::kPepper3DImageChromium); |
| 60 } |
| 54 use_image_chromium_ = use_image_chromium; | 61 use_image_chromium_ = use_image_chromium; |
| 55 #endif | 62 #endif |
| 56 } | 63 } |
| 57 | 64 |
| 58 PPB_Graphics3D_Impl::~PPB_Graphics3D_Impl() { | 65 PPB_Graphics3D_Impl::~PPB_Graphics3D_Impl() { |
| 59 // Unset the client before the command_buffer_ is destroyed, similar to how | 66 // Unset the client before the command_buffer_ is destroyed, similar to how |
| 60 // WeakPtrFactory invalidates before it. | 67 // WeakPtrFactory invalidates before it. |
| 61 if (command_buffer_) | 68 if (command_buffer_) |
| 62 command_buffer_->SetGpuControlClient(nullptr); | 69 command_buffer_->SetGpuControlClient(nullptr); |
| 63 } | 70 } |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 if (!mailboxes_to_reuse_.empty()) { | 363 if (!mailboxes_to_reuse_.empty()) { |
| 357 gpu::Mailbox mailbox = mailboxes_to_reuse_.back(); | 364 gpu::Mailbox mailbox = mailboxes_to_reuse_.back(); |
| 358 mailboxes_to_reuse_.pop_back(); | 365 mailboxes_to_reuse_.pop_back(); |
| 359 return mailbox; | 366 return mailbox; |
| 360 } | 367 } |
| 361 | 368 |
| 362 return gpu::Mailbox::Generate(); | 369 return gpu::Mailbox::Generate(); |
| 363 } | 370 } |
| 364 | 371 |
| 365 } // namespace content | 372 } // namespace content |
| OLD | NEW |