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 "cc/output/compositor_frame.h" | 9 #include "cc/output/compositor_frame.h" |
9 #include "cc/output/output_surface.h" | 10 #include "cc/output/output_surface.h" |
10 #include "cc/output/software_output_device.h" | 11 #include "cc/output/software_output_device.h" |
11 #include "cc/test/test_web_graphics_context_3d.h" | 12 #include "cc/test/test_web_graphics_context_3d.h" |
12 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3
D.h" | 13 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3
D.h" |
13 | 14 |
14 namespace cc { | 15 namespace cc { |
15 | 16 |
16 class FakeOutputSurface : public OutputSurface { | 17 class FakeOutputSurface : public OutputSurface { |
17 public: | 18 public: |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 return make_scoped_ptr( | 55 return make_scoped_ptr( |
55 new FakeOutputSurface(software_device.Pass(), true)); | 56 new FakeOutputSurface(software_device.Pass(), true)); |
56 } | 57 } |
57 | 58 |
58 virtual bool BindToClient(OutputSurfaceClient*) OVERRIDE; | 59 virtual bool BindToClient(OutputSurfaceClient*) OVERRIDE; |
59 virtual void SendFrameToParentCompositor(CompositorFrame*) OVERRIDE; | 60 virtual void SendFrameToParentCompositor(CompositorFrame*) OVERRIDE; |
60 | 61 |
61 CompositorFrame& last_sent_frame() { return last_sent_frame_; } | 62 CompositorFrame& last_sent_frame() { return last_sent_frame_; } |
62 size_t num_sent_frames() { return num_sent_frames_; } | 63 size_t num_sent_frames() { return num_sent_frames_; } |
63 | 64 |
| 65 virtual void EnableVSyncNotification(bool enable) OVERRIDE; |
| 66 bool vsync_notification_enabled() const { |
| 67 return vsync_notification_enabled_; |
| 68 } |
| 69 void DidVSync(base::TimeTicks frame_time); |
| 70 |
64 private: | 71 private: |
65 FakeOutputSurface( | 72 FakeOutputSurface( |
66 scoped_ptr<WebKit::WebGraphicsContext3D> context3d, | 73 scoped_ptr<WebKit::WebGraphicsContext3D> context3d, |
67 bool has_parent); | 74 bool has_parent); |
68 | 75 |
69 FakeOutputSurface( | 76 FakeOutputSurface( |
70 scoped_ptr<SoftwareOutputDevice> software_device, | 77 scoped_ptr<SoftwareOutputDevice> software_device, |
71 bool has_parent); | 78 bool has_parent); |
72 | 79 |
73 CompositorFrame last_sent_frame_; | 80 CompositorFrame last_sent_frame_; |
74 size_t num_sent_frames_; | 81 size_t num_sent_frames_; |
| 82 bool vsync_notification_enabled_; |
75 }; | 83 }; |
76 | 84 |
77 static inline scoped_ptr<cc::OutputSurface> CreateFakeOutputSurface() { | 85 static inline scoped_ptr<cc::OutputSurface> CreateFakeOutputSurface() { |
78 return FakeOutputSurface::Create3d( | 86 return FakeOutputSurface::Create3d( |
79 TestWebGraphicsContext3D::Create( | 87 TestWebGraphicsContext3D::Create( |
80 WebKit::WebGraphicsContext3D::Attributes()) | 88 WebKit::WebGraphicsContext3D::Attributes()) |
81 .PassAs<WebKit::WebGraphicsContext3D>()).PassAs<cc::OutputSurface>(); | 89 .PassAs<WebKit::WebGraphicsContext3D>()).PassAs<cc::OutputSurface>(); |
82 } | 90 } |
83 | 91 |
84 } // namespace cc | 92 } // namespace cc |
85 | 93 |
86 #endif // CC_TEST_FAKE_OUTPUT_SURFACE_H_ | 94 #endif // CC_TEST_FAKE_OUTPUT_SURFACE_H_ |
OLD | NEW |