| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "cc/test/fake_output_surface.h" | 5 #include "cc/test/fake_output_surface.h" |
| 6 | 6 |
| 7 namespace cc { | 7 namespace cc { |
| 8 | 8 |
| 9 FakeOutputSurface::FakeOutputSurface( | 9 FakeOutputSurface::FakeOutputSurface( |
| 10 scoped_ptr<WebKit::WebGraphicsContext3D> context3d) { | 10 scoped_ptr<WebKit::WebGraphicsContext3D> context3d, bool has_parent) { |
| 11 context3d_ = context3d.Pass(); | 11 context3d_ = context3d.Pass(); |
| 12 capabilities_.has_parent_compositor = has_parent; |
| 12 } | 13 } |
| 13 | 14 |
| 14 FakeOutputSurface::FakeOutputSurface( | 15 FakeOutputSurface::FakeOutputSurface( |
| 15 scoped_ptr<SoftwareOutputDevice> software_device) { | 16 scoped_ptr<SoftwareOutputDevice> software_device, bool has_parent) { |
| 16 software_device_ = software_device.Pass(); | 17 software_device_ = software_device.Pass(); |
| 18 capabilities_.has_parent_compositor = has_parent; |
| 17 } | 19 } |
| 18 | 20 |
| 19 FakeOutputSurface::~FakeOutputSurface() {} | 21 FakeOutputSurface::~FakeOutputSurface() {} |
| 20 | 22 |
| 21 bool FakeOutputSurface::BindToClient(OutputSurfaceClient* client) { | 23 bool FakeOutputSurface::BindToClient(OutputSurfaceClient* client) { |
| 22 if (!context3d_) | 24 if (!context3d_) |
| 23 return true; | 25 return true; |
| 24 DCHECK(client); | 26 DCHECK(client); |
| 25 if (!context3d_->makeContextCurrent()) | 27 if (!context3d_->makeContextCurrent()) |
| 26 return false; | 28 return false; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 37 return context3d_.get(); | 39 return context3d_.get(); |
| 38 } | 40 } |
| 39 | 41 |
| 40 SoftwareOutputDevice* FakeOutputSurface::SoftwareDevice() const { | 42 SoftwareOutputDevice* FakeOutputSurface::SoftwareDevice() const { |
| 41 return software_device_.get(); | 43 return software_device_.get(); |
| 42 } | 44 } |
| 43 | 45 |
| 44 void FakeOutputSurface::SendFrameToParentCompositor(const CompositorFrame&) {} | 46 void FakeOutputSurface::SendFrameToParentCompositor(const CompositorFrame&) {} |
| 45 | 47 |
| 46 } // namespace cc | 48 } // namespace cc |
| OLD | NEW |