add a use_alsa gyp setting
[chromium-blink-merge.git] / cc / test / fake_output_surface.cc
blob0b9a6d3dd98d3fd65febf22d8343cfaf078bed9d
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 namespace cc {
9 FakeOutputSurface::FakeOutputSurface(
10 scoped_ptr<WebKit::WebGraphicsContext3D> context3d, bool has_parent)
11 : OutputSurface(context3d.Pass()),
12 num_sent_frames_(0) {
13 capabilities_.has_parent_compositor = has_parent;
16 FakeOutputSurface::FakeOutputSurface(
17 scoped_ptr<SoftwareOutputDevice> software_device, bool has_parent)
18 : OutputSurface(software_device.Pass()),
19 num_sent_frames_(0) {
20 capabilities_.has_parent_compositor = has_parent;
23 FakeOutputSurface::~FakeOutputSurface() {}
25 bool FakeOutputSurface::BindToClient(
26 cc::OutputSurfaceClient* client) {
27 DCHECK(client);
28 client_ = client;
29 if (!context3d_)
30 return true;
31 return context3d_->makeContextCurrent();
34 void FakeOutputSurface::SendFrameToParentCompositor(
35 CompositorFrame* frame) {
36 frame->AssignTo(&last_sent_frame_);
37 ++num_sent_frames_;
40 } // namespace cc