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 #ifndef CC_TEST_FAKE_OUTPUT_SURFACE_H_ | 5 #ifndef CC_TEST_FAKE_OUTPUT_SURFACE_H_ |
6 #define CC_TEST_FAKE_OUTPUT_SURFACE_H_ | 6 #define CC_TEST_FAKE_OUTPUT_SURFACE_H_ |
7 | 7 |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "cc/output_surface.h" | 10 #include "cc/output_surface.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 virtual bool BindToClient(OutputSurfaceClient* client) OVERRIDE; | 59 virtual bool BindToClient(OutputSurfaceClient* client) OVERRIDE; |
60 | 60 |
61 virtual const struct Capabilities& Capabilities() const OVERRIDE; | 61 virtual const struct Capabilities& Capabilities() const OVERRIDE; |
62 | 62 |
63 virtual WebKit::WebGraphicsContext3D* Context3D() const OVERRIDE; | 63 virtual WebKit::WebGraphicsContext3D* Context3D() const OVERRIDE; |
64 virtual SoftwareOutputDevice* SoftwareDevice() const OVERRIDE; | 64 virtual SoftwareOutputDevice* SoftwareDevice() const OVERRIDE; |
65 | 65 |
66 virtual void SendFrameToParentCompositor(const CompositorFrame&) OVERRIDE; | 66 virtual void SendFrameToParentCompositor(const CompositorFrame&) OVERRIDE; |
67 | 67 |
68 private: | 68 private: |
69 explicit FakeOutputSurface( | 69 FakeOutputSurface(scoped_ptr<WebKit::WebGraphicsContext3D> context3d, |
70 scoped_ptr<WebKit::WebGraphicsContext3D> context3d, bool has_parent); | 70 bool has_parent); |
71 explicit FakeOutputSurface( | 71 FakeOutputSurface(scoped_ptr<SoftwareOutputDevice> software_device, |
72 scoped_ptr<SoftwareOutputDevice> software_device, bool has_parent); | 72 bool has_parent); |
73 | 73 |
74 scoped_ptr<WebKit::WebGraphicsContext3D> context3d_; | 74 scoped_ptr<WebKit::WebGraphicsContext3D> context3d_; |
75 scoped_ptr<SoftwareOutputDevice> software_device_; | 75 scoped_ptr<SoftwareOutputDevice> software_device_; |
76 struct Capabilities capabilities_; | 76 struct Capabilities capabilities_; |
77 OutputSurfaceClient* client_; | 77 OutputSurfaceClient* client_; |
78 }; | 78 }; |
79 | 79 |
80 static inline scoped_ptr<cc::OutputSurface> createFakeOutputSurface() | 80 static inline scoped_ptr<cc::OutputSurface> createFakeOutputSurface() |
81 { | 81 { |
82 return FakeOutputSurface::Create3d( | 82 return FakeOutputSurface::Create3d( |
83 FakeWebGraphicsContext3D::Create( | 83 FakeWebGraphicsContext3D::Create( |
84 WebKit::WebGraphicsContext3D::Attributes()) | 84 WebKit::WebGraphicsContext3D::Attributes()) |
85 .PassAs<WebKit::WebGraphicsContext3D>()) | 85 .PassAs<WebKit::WebGraphicsContext3D>()) |
86 .PassAs<cc::OutputSurface>(); | 86 .PassAs<cc::OutputSurface>(); |
87 } | 87 } |
88 | 88 |
89 } // namespace cc | 89 } // namespace cc |
90 | 90 |
91 #endif // CC_TEST_FAKE_OUTPUT_SURFACE_H_ | 91 #endif // CC_TEST_FAKE_OUTPUT_SURFACE_H_ |
OLD | NEW |