OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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/trees/layer_tree_host.h" | 5 #include "cc/trees/layer_tree_host.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/synchronization/lock.h" | 9 #include "base/synchronization/lock.h" |
10 #include "cc/animation/timing_function.h" | 10 #include "cc/animation/timing_function.h" |
(...skipping 2860 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2871 }; | 2871 }; |
2872 | 2872 |
2873 TEST_F(LayerTreeHostTestNumFramesPending, DelegatingRenderer) { | 2873 TEST_F(LayerTreeHostTestNumFramesPending, DelegatingRenderer) { |
2874 RunTest(true, true, true); | 2874 RunTest(true, true, true); |
2875 } | 2875 } |
2876 | 2876 |
2877 TEST_F(LayerTreeHostTestNumFramesPending, GLRenderer) { | 2877 TEST_F(LayerTreeHostTestNumFramesPending, GLRenderer) { |
2878 RunTest(true, false, true); | 2878 RunTest(true, false, true); |
2879 } | 2879 } |
2880 | 2880 |
| 2881 class LayerTreeHostTestDeferredInitialize : public LayerTreeHostTest { |
| 2882 public: |
| 2883 virtual void BeginTest() OVERRIDE { |
| 2884 layer_tree_host()->SetNeedsRedraw(); |
| 2885 } |
| 2886 |
| 2887 virtual scoped_ptr<OutputSurface> CreateOutputSurface() OVERRIDE { |
| 2888 return FakeOutputSurface::CreateDeferredGL( |
| 2889 scoped_ptr<WebKit::WebGraphicsContext3D>( |
| 2890 TestWebGraphicsContext3D::Create( |
| 2891 WebKit::WebGraphicsContext3D::Attributes())), |
| 2892 scoped_ptr<SoftwareOutputDevice>(new SoftwareOutputDevice)) |
| 2893 .PassAs<OutputSurface>(); |
| 2894 } |
| 2895 |
| 2896 virtual void InitializedRendererOnThread(LayerTreeHostImpl* host_impl, |
| 2897 bool success) OVERRIDE { |
| 2898 EXPECT_TRUE(success); |
| 2899 EXPECT_TRUE( |
| 2900 host_impl->DeferredInitialize(scoped_refptr<ContextProvider>())); |
| 2901 |
| 2902 PostSetNeedsCommitToMainThread(); |
| 2903 } |
| 2904 |
| 2905 virtual void DidCommitAndDrawFrame() OVERRIDE { |
| 2906 EndTest(); |
| 2907 } |
| 2908 |
| 2909 virtual void AfterTest() OVERRIDE {} |
| 2910 }; |
| 2911 |
| 2912 MULTI_THREAD_TEST_F(LayerTreeHostTestDeferredInitialize); |
| 2913 |
2881 } // namespace | 2914 } // namespace |
2882 } // namespace cc | 2915 } // namespace cc |
OLD | NEW |