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

Side by Side Diff: content/renderer/gpu/compositor_output_surface.cc

Issue 12540003: CrOS: Set max frames pending for UI from command line. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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 | Annotate | Revision Log
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/gpu/compositor_output_surface.h" 5 #include "content/renderer/gpu/compositor_output_surface.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/message_loop_proxy.h" 8 #include "base/message_loop_proxy.h"
9 #include "cc/compositor_frame.h" 9 #include "cc/compositor_frame.h"
10 #include "cc/compositor_frame_ack.h" 10 #include "cc/compositor_frame_ack.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 make_scoped_ptr(software_device)), 58 make_scoped_ptr(software_device)),
59 output_surface_filter_( 59 output_surface_filter_(
60 RenderThreadImpl::current()->compositor_output_surface_filter()), 60 RenderThreadImpl::current()->compositor_output_surface_filter()),
61 routing_id_(routing_id), 61 routing_id_(routing_id),
62 prefers_smoothness_(false), 62 prefers_smoothness_(false),
63 main_thread_id_(base::PlatformThread::CurrentId()) { 63 main_thread_id_(base::PlatformThread::CurrentId()) {
64 DCHECK(output_surface_filter_); 64 DCHECK(output_surface_filter_);
65 CommandLine* command_line = CommandLine::ForCurrentProcess(); 65 CommandLine* command_line = CommandLine::ForCurrentProcess();
66 capabilities_.has_parent_compositor = command_line->HasSwitch( 66 capabilities_.has_parent_compositor = command_line->HasSwitch(
67 switches::kEnableDelegatedRenderer); 67 switches::kEnableDelegatedRenderer);
68 if (capabilities_.has_parent_compositor)
69 capabilities_.max_frames_pending = 1;
piman 2013/03/13 15:55:22 This logic should stay inside the compositor. It's
jonathan.backer 2013/03/13 16:55:29 Done.
68 DetachFromThread(); 70 DetachFromThread();
69 } 71 }
70 72
71 CompositorOutputSurface::~CompositorOutputSurface() { 73 CompositorOutputSurface::~CompositorOutputSurface() {
72 DCHECK(CalledOnValidThread()); 74 DCHECK(CalledOnValidThread());
73 if (!client_) 75 if (!client_)
74 return; 76 return;
75 UpdateSmoothnessTakesPriority(false); 77 UpdateSmoothnessTakesPriority(false);
76 if (output_surface_proxy_) 78 if (output_surface_proxy_)
77 output_surface_proxy_->ClearOutputSurface(); 79 output_surface_proxy_->ClearOutputSurface();
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 // If this is the last surface to stop preferring smoothness, 163 // If this is the last surface to stop preferring smoothness,
162 // Reset the main thread's priority to the default. 164 // Reset the main thread's priority to the default.
163 if (prefers_smoothness_ == true && 165 if (prefers_smoothness_ == true &&
164 --g_prefer_smoothness_count == 0) { 166 --g_prefer_smoothness_count == 0) {
165 SetThreadsPriorityToDefault(main_thread_id_); 167 SetThreadsPriorityToDefault(main_thread_id_);
166 } 168 }
167 prefers_smoothness_ = prefers_smoothness; 169 prefers_smoothness_ = prefers_smoothness;
168 } 170 }
169 171
170 } // namespace content 172 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/image_transport_factory.cc ('k') | ui/compositor/compositor_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698