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
3 // found in the LICENSE file.
5 #include "cc/test/fake_output_surface.h"
7 #include "cc/output/output_surface_client.h"
11 FakeOutputSurface::FakeOutputSurface(
12 scoped_ptr
<WebKit::WebGraphicsContext3D
> context3d
, bool has_parent
)
13 : OutputSurface(context3d
.Pass()),
15 vsync_notification_enabled_(false) {
16 capabilities_
.has_parent_compositor
= has_parent
;
19 FakeOutputSurface::FakeOutputSurface(
20 scoped_ptr
<SoftwareOutputDevice
> software_device
, bool has_parent
)
21 : OutputSurface(software_device
.Pass()),
23 capabilities_
.has_parent_compositor
= has_parent
;
26 FakeOutputSurface::~FakeOutputSurface() {}
28 void FakeOutputSurface::SendFrameToParentCompositor(
29 CompositorFrame
* frame
) {
30 frame
->AssignTo(&last_sent_frame_
);
34 void FakeOutputSurface::EnableVSyncNotification(bool enable
) {
35 vsync_notification_enabled_
= enable
;
38 void FakeOutputSurface::DidVSync(base::TimeTicks frame_time
) {
39 client_
->DidVSync(frame_time
);