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_web_compositor_output_surface.h" |
| 6 |
| 7 namespace cc { |
| 8 |
| 9 FakeWebCompositorOutputSurface::FakeWebCompositorOutputSurface( |
| 10 scoped_ptr<WebKit::WebGraphicsContext3D> context3D) { |
| 11 m_context3D = context3D.Pass(); |
| 12 } |
| 13 |
| 14 FakeWebCompositorOutputSurface::FakeWebCompositorOutputSurface( |
| 15 scoped_ptr<WebKit::WebCompositorSoftwareOutputDevice> softwareDevice) { |
| 16 m_softwareDevice = softwareDevice.Pass(); |
| 17 } |
| 18 |
| 19 FakeWebCompositorOutputSurface::~FakeWebCompositorOutputSurface() { |
| 20 } |
| 21 |
| 22 bool FakeWebCompositorOutputSurface::bindToClient( |
| 23 WebKit::WebCompositorOutputSurfaceClient* client) { |
| 24 if (!m_context3D) |
| 25 return true; |
| 26 DCHECK(client); |
| 27 if (!m_context3D->makeContextCurrent()) |
| 28 return false; |
| 29 m_client = client; |
| 30 return true; |
| 31 } |
| 32 |
| 33 const FakeWebCompositorOutputSurface::Capabilities& |
| 34 FakeWebCompositorOutputSurface::capabilities() const { |
| 35 return m_capabilities; |
| 36 } |
| 37 |
| 38 WebKit::WebGraphicsContext3D* |
| 39 FakeWebCompositorOutputSurface::context3D() const { |
| 40 return m_context3D.get(); |
| 41 } |
| 42 |
| 43 WebKit::WebCompositorSoftwareOutputDevice* |
| 44 FakeWebCompositorOutputSurface::softwareDevice() const { |
| 45 return m_softwareDevice.get(); |
| 46 } |
| 47 |
| 48 } // namespace cc |
OLD | NEW |