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

Side by Side Diff: cc/test/fake_output_surface.cc

Issue 11833009: Provide a vsync notification to the renderer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 7 years, 10 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
« no previous file with comments | « cc/test/fake_output_surface.h ('k') | cc/thread_proxy.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 "cc/test/fake_output_surface.h" 5 #include "cc/test/fake_output_surface.h"
6 6
7 #include "cc/output_surface_client.h"
8
7 namespace cc { 9 namespace cc {
8 10
9 FakeOutputSurface::FakeOutputSurface( 11 FakeOutputSurface::FakeOutputSurface(
10 scoped_ptr<WebKit::WebGraphicsContext3D> context3d, bool has_parent) 12 scoped_ptr<WebKit::WebGraphicsContext3D> context3d, bool has_parent)
11 : num_sent_frames_(0) { 13 : num_sent_frames_(0)
14 , vsync_notification_enabled_(false) {
12 context3d_ = context3d.Pass(); 15 context3d_ = context3d.Pass();
13 capabilities_.has_parent_compositor = has_parent; 16 capabilities_.has_parent_compositor = has_parent;
14 } 17 }
15 18
16 FakeOutputSurface::FakeOutputSurface( 19 FakeOutputSurface::FakeOutputSurface(
17 scoped_ptr<SoftwareOutputDevice> software_device, bool has_parent) 20 scoped_ptr<SoftwareOutputDevice> software_device, bool has_parent)
18 : num_sent_frames_(0) { 21 : num_sent_frames_(0) {
19 software_device_ = software_device.Pass(); 22 software_device_ = software_device.Pass();
20 capabilities_.has_parent_compositor = has_parent; 23 capabilities_.has_parent_compositor = has_parent;
21 } 24 }
(...skipping 22 matching lines...) Expand all
44 SoftwareOutputDevice* FakeOutputSurface::SoftwareDevice() const { 47 SoftwareOutputDevice* FakeOutputSurface::SoftwareDevice() const {
45 return software_device_.get(); 48 return software_device_.get();
46 } 49 }
47 50
48 void FakeOutputSurface::SendFrameToParentCompositor( 51 void FakeOutputSurface::SendFrameToParentCompositor(
49 CompositorFrame* frame) { 52 CompositorFrame* frame) {
50 frame->AssignTo(&last_sent_frame_); 53 frame->AssignTo(&last_sent_frame_);
51 ++num_sent_frames_; 54 ++num_sent_frames_;
52 } 55 }
53 56
57 void FakeOutputSurface::EnableVSyncNotification(bool enable) {
58 vsync_notification_enabled_ = enable;
59 }
60
61 void FakeOutputSurface::DidVSync(base::TimeTicks frame_time) {
62 client_->DidVSync(frame_time);
63 }
64
54 } // namespace cc 65 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/fake_output_surface.h ('k') | cc/thread_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698