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

Side by Side Diff: content/browser/android/in_process/synchronous_compositor_output_surface.cc

Issue 199523002: cc: Throttle swaps in Scheduler instead of OutputSurface (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: dana's comments Created 6 years, 8 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/browser/android/in_process/synchronous_compositor_output_surfa ce.h" 5 #include "content/browser/android/in_process/synchronous_compositor_output_surfa ce.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "cc/output/begin_frame_args.h" 9 #include "cc/output/begin_frame_args.h"
10 #include "cc/output/compositor_frame.h" 10 #include "cc/output/compositor_frame.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 needs_begin_frame_ = enable; 128 needs_begin_frame_ = enable;
129 client_ready_for_begin_frame_ = true; 129 client_ready_for_begin_frame_ = true;
130 SynchronousCompositorOutputSurfaceDelegate* delegate = GetDelegate(); 130 SynchronousCompositorOutputSurfaceDelegate* delegate = GetDelegate();
131 if (delegate && !invoking_composite_) 131 if (delegate && !invoking_composite_)
132 delegate->SetContinuousInvalidate(needs_begin_frame_); 132 delegate->SetContinuousInvalidate(needs_begin_frame_);
133 } 133 }
134 134
135 void SynchronousCompositorOutputSurface::SwapBuffers( 135 void SynchronousCompositorOutputSurface::SwapBuffers(
136 cc::CompositorFrame* frame) { 136 cc::CompositorFrame* frame) {
137 DCHECK(CalledOnValidThread()); 137 DCHECK(CalledOnValidThread());
138 DCHECK(!is_lost_);
139
138 if (!ForcedDrawToSoftwareDevice()) { 140 if (!ForcedDrawToSoftwareDevice()) {
139 DCHECK(context_provider_); 141 DCHECK(context_provider_);
140 context_provider_->ContextGL()->ShallowFlushCHROMIUM(); 142 context_provider_->ContextGL()->ShallowFlushCHROMIUM();
141 } 143 }
142 UpdateFrameMetaData(frame->metadata); 144 UpdateFrameMetaData(frame->metadata);
143 145
144 did_swap_buffer_ = true; 146 did_swap_buffer_ = true;
145 DidSwapBuffers(); 147 DidSwapBuffers();
146 } 148 }
147 149
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 bool SynchronousCompositorOutputSurface::CalledOnValidThread() const { 283 bool SynchronousCompositorOutputSurface::CalledOnValidThread() const {
282 return BrowserThread::CurrentlyOn(BrowserThread::UI); 284 return BrowserThread::CurrentlyOn(BrowserThread::UI);
283 } 285 }
284 286
285 SynchronousCompositorOutputSurfaceDelegate* 287 SynchronousCompositorOutputSurfaceDelegate*
286 SynchronousCompositorOutputSurface::GetDelegate() { 288 SynchronousCompositorOutputSurface::GetDelegate() {
287 return SynchronousCompositorImpl::FromRoutingID(routing_id_); 289 return SynchronousCompositorImpl::FromRoutingID(routing_id_);
288 } 290 }
289 291
290 } // namespace content 292 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698