| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |