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

Unified Diff: content/browser/renderer_host/render_widget_host_impl.cc

Issue 10811002: Add threaded compositing mode to field trial (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
Index: content/browser/renderer_host/render_widget_host_impl.cc
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
index e8b5dcbc5b6e19f672fe80df2a1df6617068b40d..b71f8d36bde0b0c8d2f8ee1bfec309164386a497 100644
--- a/content/browser/renderer_host/render_widget_host_impl.cc
+++ b/content/browser/renderer_host/render_widget_host_impl.cc
@@ -12,6 +12,7 @@
#include "base/debug/trace_event.h"
#include "base/i18n/rtl.h"
#include "base/message_loop.h"
+#include "base/metrics/field_trial.h"
#include "base/metrics/histogram.h"
#include "base/string_number_conversions.h"
#include "base/utf_string_conversions.h"
@@ -34,6 +35,7 @@
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_types.h"
#include "content/public/browser/user_metrics.h"
+#include "content/public/common/content_constants.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/result_codes.h"
#include "skia/ext/image_operations.h"
@@ -1893,11 +1895,15 @@ void RenderWidgetHostImpl::AcknowledgeBufferPresent(
}
void RenderWidgetHostImpl::AcknowledgeSwapBuffersToRenderer() {
- bool enable_threaded_compositing =
- 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;
+ bool enable_threaded_compositing = thread_trial ||
+ (CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableThreadedCompositing) &&
+ !CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kDisableThreadedCompositing));
if (!enable_threaded_compositing)
Send(new ViewMsg_SwapBuffers_ACK(routing_id_));
}

Powered by Google App Engine
This is Rietveld 408576698