OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 #include "cc/test/fake_output_surface.h" |
| 6 |
| 7 namespace cc { |
| 8 |
| 9 FakeOutputSurface::FakeOutputSurface(scoped_ptr<WebKit::WebGraphicsContext3D> co
ntext3d) { |
| 10 context3d_ = context3d.Pass(); |
| 11 } |
| 12 |
| 13 FakeOutputSurface::FakeOutputSurface(scoped_ptr<SoftwareOutputDevice> softwareDe
vice) { |
| 14 software_device_ = softwareDevice.Pass(); |
| 15 } |
| 16 |
| 17 FakeOutputSurface::~FakeOutputSurface() {} |
| 18 |
| 19 bool FakeOutputSurface::BindToClient(OutputSurfaceClient* client) { |
| 20 if (!context3d_) |
| 21 return true; |
| 22 DCHECK(client); |
| 23 if (!context3d_->makeContextCurrent()) |
| 24 return false; |
| 25 client_ = client; |
| 26 return true; |
| 27 } |
| 28 |
| 29 const struct OutputSurface::Capabilities& FakeOutputSurface::Capabilities() cons
t { |
| 30 return capabilities_; |
| 31 } |
| 32 |
| 33 WebKit::WebGraphicsContext3D* FakeOutputSurface::Context3D() const { |
| 34 return context3d_.get(); |
| 35 } |
| 36 |
| 37 SoftwareOutputDevice* FakeOutputSurface::SoftwareDevice() const { |
| 38 return software_device_.get(); |
| 39 } |
| 40 |
| 41 void FakeOutputSurface::SendFrameToParentCompositor(const CompositorFrame&) {} |
| 42 |
| 43 } // namespace cc |
OLD | NEW |