| 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 virtual void SetExternalDrawConstraints(const gfx::Transform& transform, | 43 virtual void SetExternalDrawConstraints(const gfx::Transform& transform, |
| 40 gfx::Rect viewport) OVERRIDE {} | 44 gfx::Rect viewport) OVERRIDE {} |
| (...skipping 23 matching lines...) Expand all Loading... |
| 64 context3d.PassAs<WebKit::WebGraphicsContext3D>()); | 68 context3d.PassAs<WebKit::WebGraphicsContext3D>()); |
| 65 EXPECT_EQ(NULL, output_surface.client()); | 69 EXPECT_EQ(NULL, output_surface.client()); |
| 66 | 70 |
| 67 FakeOutputSurfaceClient client; | 71 FakeOutputSurfaceClient client; |
| 68 EXPECT_FALSE(output_surface.BindToClient(&client)); | 72 EXPECT_FALSE(output_surface.BindToClient(&client)); |
| 69 EXPECT_EQ(NULL, output_surface.client()); | 73 EXPECT_EQ(NULL, output_surface.client()); |
| 70 } | 74 } |
| 71 | 75 |
| 72 } // namespace | 76 } // namespace |
| 73 } // namespace cc | 77 } // namespace cc |
| OLD | NEW |