Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(542)

Side by Side Diff: content/renderer/pepper/ppb_graphics_3d_impl.cc

Issue 2134263002: Move Pepper 3D Image Chromium behind an experiment. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/public/common/content_features.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « content/public/common/content_features.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698