Fix build break
[chromium-blink-merge.git] / cc / test / fake_output_surface.cc
blob6369f61ec6740c4e7bb0c9d53617e5443dadd926
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"
9 namespace cc {
11 FakeOutputSurface::FakeOutputSurface(
12 scoped_ptr<WebKit::WebGraphicsContext3D> context3d, bool has_parent)
13 : OutputSurface(context3d.Pass()),
14 num_sent_frames_(0),
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()),
22 num_sent_frames_(0) {
23 capabilities_.has_parent_compositor = has_parent;
26 FakeOutputSurface::~FakeOutputSurface() {}
28 bool FakeOutputSurface::BindToClient(
29 cc::OutputSurfaceClient* client) {
30 DCHECK(client);
31 client_ = client;
32 if (!context3d_)
33 return true;
34 return context3d_->makeContextCurrent();
37 void FakeOutputSurface::SendFrameToParentCompositor(
38 CompositorFrame* frame) {
39 frame->AssignTo(&last_sent_frame_);
40 ++num_sent_frames_;
43 void FakeOutputSurface::EnableVSyncNotification(bool enable) {
44 vsync_notification_enabled_ = enable;
47 void FakeOutputSurface::DidVSync(base::TimeTicks frame_time) {
48 client_->DidVSync(frame_time);
51 } // namespace cc