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/time.h" | 8 #include "base/time.h" |
9 #include "cc/output/compositor_frame.h" | 9 #include "cc/output/compositor_frame.h" |
10 #include "cc/output/output_surface.h" | 10 #include "cc/output/output_surface.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 .PassAs<WebKit::WebGraphicsContext3D>(); | 49 .PassAs<WebKit::WebGraphicsContext3D>(); |
50 return make_scoped_ptr(new FakeOutputSurface(context3d.Pass(), true)); | 50 return make_scoped_ptr(new FakeOutputSurface(context3d.Pass(), true)); |
51 } | 51 } |
52 | 52 |
53 static scoped_ptr<FakeOutputSurface> CreateDelegatingSoftware( | 53 static scoped_ptr<FakeOutputSurface> CreateDelegatingSoftware( |
54 scoped_ptr<SoftwareOutputDevice> software_device) { | 54 scoped_ptr<SoftwareOutputDevice> software_device) { |
55 return make_scoped_ptr( | 55 return make_scoped_ptr( |
56 new FakeOutputSurface(software_device.Pass(), true)); | 56 new FakeOutputSurface(software_device.Pass(), true)); |
57 } | 57 } |
58 | 58 |
59 virtual bool BindToClient(OutputSurfaceClient* client) OVERRIDE; | |
60 virtual void SendFrameToParentCompositor(CompositorFrame* frame) OVERRIDE; | 59 virtual void SendFrameToParentCompositor(CompositorFrame* frame) OVERRIDE; |
61 | 60 |
62 CompositorFrame& last_sent_frame() { return last_sent_frame_; } | 61 CompositorFrame& last_sent_frame() { return last_sent_frame_; } |
63 size_t num_sent_frames() { return num_sent_frames_; } | 62 size_t num_sent_frames() { return num_sent_frames_; } |
64 | 63 |
65 virtual void EnableVSyncNotification(bool enable) OVERRIDE; | 64 virtual void EnableVSyncNotification(bool enable) OVERRIDE; |
66 bool vsync_notification_enabled() const { | 65 bool vsync_notification_enabled() const { |
67 return vsync_notification_enabled_; | 66 return vsync_notification_enabled_; |
68 } | 67 } |
69 void DidVSync(base::TimeTicks frame_time); | 68 void DidVSync(base::TimeTicks frame_time); |
(...skipping 15 matching lines...) Expand all Loading... |
85 static inline scoped_ptr<cc::OutputSurface> CreateFakeOutputSurface() { | 84 static inline scoped_ptr<cc::OutputSurface> CreateFakeOutputSurface() { |
86 return FakeOutputSurface::Create3d( | 85 return FakeOutputSurface::Create3d( |
87 TestWebGraphicsContext3D::Create( | 86 TestWebGraphicsContext3D::Create( |
88 WebKit::WebGraphicsContext3D::Attributes()) | 87 WebKit::WebGraphicsContext3D::Attributes()) |
89 .PassAs<WebKit::WebGraphicsContext3D>()).PassAs<cc::OutputSurface>(); | 88 .PassAs<WebKit::WebGraphicsContext3D>()).PassAs<cc::OutputSurface>(); |
90 } | 89 } |
91 | 90 |
92 } // namespace cc | 91 } // namespace cc |
93 | 92 |
94 #endif // CC_TEST_FAKE_OUTPUT_SURFACE_H_ | 93 #endif // CC_TEST_FAKE_OUTPUT_SURFACE_H_ |
OLD | NEW |