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 "cc/output/compositor_frame.h" | 8 #include "cc/output/compositor_frame.h" |
9 #include "cc/output/output_surface.h" | 9 #include "cc/output/output_surface.h" |
10 #include "cc/output/software_output_device.h" | 10 #include "cc/output/software_output_device.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 .PassAs<WebKit::WebGraphicsContext3D>(); | 48 .PassAs<WebKit::WebGraphicsContext3D>(); |
49 return make_scoped_ptr(new FakeOutputSurface(context3d.Pass(), true)); | 49 return make_scoped_ptr(new FakeOutputSurface(context3d.Pass(), true)); |
50 } | 50 } |
51 | 51 |
52 static scoped_ptr<FakeOutputSurface> CreateDelegatingSoftware( | 52 static scoped_ptr<FakeOutputSurface> CreateDelegatingSoftware( |
53 scoped_ptr<SoftwareOutputDevice> software_device) { | 53 scoped_ptr<SoftwareOutputDevice> software_device) { |
54 return make_scoped_ptr( | 54 return make_scoped_ptr( |
55 new FakeOutputSurface(software_device.Pass(), true)); | 55 new FakeOutputSurface(software_device.Pass(), true)); |
56 } | 56 } |
57 | 57 |
58 virtual bool BindToClient(OutputSurfaceClient*) OVERRIDE; | |
59 virtual void SendFrameToParentCompositor(CompositorFrame*) OVERRIDE; | 58 virtual void SendFrameToParentCompositor(CompositorFrame*) OVERRIDE; |
60 | 59 |
61 CompositorFrame& last_sent_frame() { return last_sent_frame_; } | 60 CompositorFrame& last_sent_frame() { return last_sent_frame_; } |
62 size_t num_sent_frames() { return num_sent_frames_; } | 61 size_t num_sent_frames() { return num_sent_frames_; } |
63 | 62 |
64 private: | 63 private: |
65 FakeOutputSurface( | 64 FakeOutputSurface( |
66 scoped_ptr<WebKit::WebGraphicsContext3D> context3d, | 65 scoped_ptr<WebKit::WebGraphicsContext3D> context3d, |
67 bool has_parent); | 66 bool has_parent); |
68 | 67 |
69 FakeOutputSurface( | 68 FakeOutputSurface( |
70 scoped_ptr<SoftwareOutputDevice> software_device, | 69 scoped_ptr<SoftwareOutputDevice> software_device, |
71 bool has_parent); | 70 bool has_parent); |
72 | 71 |
73 CompositorFrame last_sent_frame_; | 72 CompositorFrame last_sent_frame_; |
74 size_t num_sent_frames_; | 73 size_t num_sent_frames_; |
75 }; | 74 }; |
76 | 75 |
77 static inline scoped_ptr<cc::OutputSurface> CreateFakeOutputSurface() { | 76 static inline scoped_ptr<cc::OutputSurface> CreateFakeOutputSurface() { |
78 return FakeOutputSurface::Create3d( | 77 return FakeOutputSurface::Create3d( |
79 TestWebGraphicsContext3D::Create( | 78 TestWebGraphicsContext3D::Create( |
80 WebKit::WebGraphicsContext3D::Attributes()) | 79 WebKit::WebGraphicsContext3D::Attributes()) |
81 .PassAs<WebKit::WebGraphicsContext3D>()).PassAs<cc::OutputSurface>(); | 80 .PassAs<WebKit::WebGraphicsContext3D>()).PassAs<cc::OutputSurface>(); |
82 } | 81 } |
83 | 82 |
84 } // namespace cc | 83 } // namespace cc |
85 | 84 |
86 #endif // CC_TEST_FAKE_OUTPUT_SURFACE_H_ | 85 #endif // CC_TEST_FAKE_OUTPUT_SURFACE_H_ |
OLD | NEW |