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

Side by Side Diff: content/renderer/android/synchronous_compositor_output_surface.cc

Issue 15836005: cc: Emulate BeginFrame in OutputSurfaces that don't support it natively (Closed) Base URL: http://git.chromium.org/chromium/src.git@nofrc
Patch Set: Created 7 years, 6 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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/renderer/android/synchronous_compositor_output_surface.h" 5 #include "content/renderer/android/synchronous_compositor_output_surface.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/time.h" 9 #include "base/time.h"
10 #include "cc/output/compositor_frame.h" 10 #include "cc/output/compositor_frame.h"
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 InvokeComposite(transform, damage_area); 180 InvokeComposite(transform, damage_area);
181 181
182 return did_swap_buffer_; 182 return did_swap_buffer_;
183 } 183 }
184 184
185 void SynchronousCompositorOutputSurface::InvokeComposite( 185 void SynchronousCompositorOutputSurface::InvokeComposite(
186 const gfx::Transform& transform, 186 const gfx::Transform& transform,
187 gfx::Rect damage_area) { 187 gfx::Rect damage_area) {
188 // TODO(boliu): This assumes |transform| is identity and |damage_area| is the 188 // TODO(boliu): This assumes |transform| is identity and |damage_area| is the
189 // whole view. Tracking bug to implement this: crbug.com/230463. 189 // whole view. Tracking bug to implement this: crbug.com/230463.
190 client_->SetNeedsRedrawRect(damage_area); 190 SetNeedsRedrawRect(damage_area);
191 if (needs_begin_frame_) 191 if (needs_begin_frame_)
192 client_->BeginFrame(base::TimeTicks::Now()); 192 BeginFrame(base::TimeTicks::Now());
193 } 193 }
194 194
195 // Not using base::NonThreadSafe as we want to enforce a more exacting threading 195 // Not using base::NonThreadSafe as we want to enforce a more exacting threading
196 // requirement: SynchronousCompositorOutputSurface() must only be used by 196 // requirement: SynchronousCompositorOutputSurface() must only be used by
197 // embedders that supply their own compositor loop via 197 // embedders that supply their own compositor loop via
198 // OverrideCompositorMessageLoop(). 198 // OverrideCompositorMessageLoop().
199 bool SynchronousCompositorOutputSurface::CalledOnValidThread() const { 199 bool SynchronousCompositorOutputSurface::CalledOnValidThread() const {
200 return base::MessageLoop::current() && (base::MessageLoop::current() == 200 return base::MessageLoop::current() && (base::MessageLoop::current() ==
201 GetContentClient()->renderer()->OverrideCompositorMessageLoop()); 201 GetContentClient()->renderer()->OverrideCompositorMessageLoop());
202 } 202 }
203 203
204 } // namespace content 204 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698