OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/output/output_surface.h" | 5 #include "cc/output/output_surface.h" |
6 #include "cc/output/output_surface_client.h" | 6 #include "cc/output/output_surface_client.h" |
7 #include "cc/test/test_web_graphics_context_3d.h" | 7 #include "cc/test/test_web_graphics_context_3d.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 | 9 |
10 namespace cc { | 10 namespace cc { |
(...skipping 10 matching lines...) Expand all Loading... |
21 | 21 |
22 TestOutputSurface(scoped_ptr<WebKit::WebGraphicsContext3D> context3d, | 22 TestOutputSurface(scoped_ptr<WebKit::WebGraphicsContext3D> context3d, |
23 scoped_ptr<cc::SoftwareOutputDevice> software_device) | 23 scoped_ptr<cc::SoftwareOutputDevice> software_device) |
24 : OutputSurface(context3d.Pass(), software_device.Pass()) {} | 24 : OutputSurface(context3d.Pass(), software_device.Pass()) {} |
25 | 25 |
26 OutputSurfaceClient* client() { return client_; } | 26 OutputSurfaceClient* client() { return client_; } |
27 }; | 27 }; |
28 | 28 |
29 class FakeOutputSurfaceClient : public OutputSurfaceClient { | 29 class FakeOutputSurfaceClient : public OutputSurfaceClient { |
30 public: | 30 public: |
| 31 virtual bool DeferredInitialize( |
| 32 scoped_refptr<ContextProvider> offscreen_context_provider) OVERRIDE { |
| 33 return true; |
| 34 } |
31 virtual void SetNeedsRedrawRect(gfx::Rect damage_rect) OVERRIDE {} | 35 virtual void SetNeedsRedrawRect(gfx::Rect damage_rect) OVERRIDE {} |
32 virtual void OnVSyncParametersChanged(base::TimeTicks timebase, | 36 virtual void OnVSyncParametersChanged(base::TimeTicks timebase, |
33 base::TimeDelta interval) OVERRIDE {} | 37 base::TimeDelta interval) OVERRIDE {} |
34 virtual void BeginFrame(base::TimeTicks frame_time) OVERRIDE {} | 38 virtual void BeginFrame(base::TimeTicks frame_time) OVERRIDE {} |
35 virtual void OnSendFrameToParentCompositorAck(const CompositorFrameAck& ack) | 39 virtual void OnSendFrameToParentCompositorAck(const CompositorFrameAck& ack) |
36 OVERRIDE {} | 40 OVERRIDE {} |
37 virtual void OnSwapBuffersComplete() OVERRIDE {} | 41 virtual void OnSwapBuffersComplete() OVERRIDE {} |
38 virtual void DidLoseOutputSurface() OVERRIDE {} | 42 virtual void DidLoseOutputSurface() OVERRIDE {} |
39 }; | 43 }; |
40 | 44 |
(...skipping 21 matching lines...) Expand all Loading... |
62 context3d.PassAs<WebKit::WebGraphicsContext3D>()); | 66 context3d.PassAs<WebKit::WebGraphicsContext3D>()); |
63 EXPECT_EQ(NULL, output_surface.client()); | 67 EXPECT_EQ(NULL, output_surface.client()); |
64 | 68 |
65 FakeOutputSurfaceClient client; | 69 FakeOutputSurfaceClient client; |
66 EXPECT_FALSE(output_surface.BindToClient(&client)); | 70 EXPECT_FALSE(output_surface.BindToClient(&client)); |
67 EXPECT_EQ(NULL, output_surface.client()); | 71 EXPECT_EQ(NULL, output_surface.client()); |
68 } | 72 } |
69 | 73 |
70 } // namespace | 74 } // namespace |
71 } // namespace cc | 75 } // namespace cc |
OLD | NEW |