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 bool FakeOutputSurface::BindToClient(
29 cc::OutputSurfaceClient
* client
) {
34 return context3d_
->makeContextCurrent();
37 void FakeOutputSurface::SendFrameToParentCompositor(
38 CompositorFrame
* frame
) {
39 frame
->AssignTo(&last_sent_frame_
);
43 void FakeOutputSurface::EnableVSyncNotification(bool enable
) {
44 vsync_notification_enabled_
= enable
;
47 void FakeOutputSurface::DidVSync(base::TimeTicks frame_time
) {
48 client_
->DidVSync(frame_time
);