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

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

Issue 10824168: Cleaning up compositing field trial code and enable FCM in beta/stable (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: revert some.gyp Created 8 years, 4 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/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 4cf413d69ed01f9fe61e3fcfb29ccc15d87fd324..8a4ab7288af9ae69fa0291b9f33fd00c5af3e881 100644
--- a/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc
+++ b/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc
@@ -26,6 +26,7 @@
#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/compositor_util.h"
#include "content/public/common/content_constants.h"
#include "content/public/common/content_switches.h"
#include "gpu/command_buffer/client/gles2_cmd_helper.h"
@@ -151,7 +152,12 @@ WebGraphicsContext3DCommandBufferImpl::WebGraphicsContext3DCommandBufferImpl(
transfer_buffer_(NULL),
gl_(NULL),
frame_number_(0),
- bind_generates_resources_(false) {
+ bind_generates_resources_(false),
+ 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_ = compositor_util::IsThreadedCompositingEnabled();
+#endif
}
WebGraphicsContext3DCommandBufferImpl::
@@ -521,20 +527,7 @@ void WebGraphicsContext3DCommandBufferImpl::prepareTexture() {
if (command_buffer_->GetLastState().error == gpu::error::kNoError)
gl_->SwapBuffers();
- bool use_echo_for_swap_ack = true;
-#if defined(OS_MACOSX) || defined(OS_WIN)
- // Get ViewMsg_SwapBuffers_ACK from browser for single-threaded path.
- 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) {
+ if (use_echo_for_swap_ack_) {
command_buffer_->Echo(base::Bind(
&WebGraphicsContext3DCommandBufferImpl::OnSwapBuffersComplete,
weak_ptr_factory_.GetWeakPtr()));

Powered by Google App Engine
This is Rietveld 408576698