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

Unified Diff: content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc

Issue 10811002: Add threaded compositing mode to field trial (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ilya feedback Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/renderer_host/render_widget_host_impl.cc ('k') | content/public/common/content_constants.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc
diff --git a/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc b/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc
index 2c26f2a827fa49c1e8b18c5dd60f3071a291fa0f..0ba832c30571c0693d21dfea09cdcbcdeb5c9633 100644
--- a/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc
+++ b/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc
@@ -20,11 +20,13 @@
#include "base/debug/trace_event.h"
#include "base/logging.h"
#include "base/message_loop.h"
+#include "base/metrics/field_trial.h"
#include "base/metrics/histogram.h"
#include "base/synchronization/lock.h"
#include "content/common/gpu/gpu_memory_allocation.h"
#include "content/common/gpu/client/gpu_channel_host.h"
#include "content/common/gpu/gpu_process_launch_causes.h"
+#include "content/public/common/content_constants.h"
#include "content/public/common/content_switches.h"
#include "gpu/command_buffer/client/gles2_cmd_helper.h"
#include "gpu/command_buffer/client/gles2_implementation.h"
@@ -522,11 +524,15 @@ void WebGraphicsContext3DCommandBufferImpl::prepareTexture() {
bool use_echo_for_swap_ack = true;
#if defined(OS_MACOSX) || defined(OS_WIN)
// Get ViewMsg_SwapBuffers_ACK from browser for single-threaded path.
- use_echo_for_swap_ack =
- CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableThreadedCompositing) &&
- !CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kDisableThreadedCompositing);
+ base::FieldTrial* trial =
+ base::FieldTrialList::Find(content::kGpuCompositingFieldTrialName);
+ bool thread_trial = trial && trial->group_name() ==
+ content::kGpuCompositingFieldTrialThreadEnabledName;
+ use_echo_for_swap_ack = thread_trial ||
+ (CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableThreadedCompositing) &&
+ !CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kDisableThreadedCompositing));
#endif
if (use_echo_for_swap_ack) {
command_buffer_->Echo(base::Bind(
« no previous file with comments | « content/browser/renderer_host/render_widget_host_impl.cc ('k') | content/public/common/content_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698