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/delegating_renderer.h" | 5 #include "cc/output/delegating_renderer.h" |
6 | 6 |
7 #include "cc/test/fake_output_surface.h" | 7 #include "cc/test/fake_output_surface.h" |
8 #include "cc/test/layer_tree_test.h" | 8 #include "cc/test/layer_tree_test.h" |
9 #include "cc/test/render_pass_test_common.h" | 9 #include "cc/test/render_pass_test_common.h" |
10 #include "cc/test/render_pass_test_utils.h" | 10 #include "cc/test/render_pass_test_utils.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
12 | 12 |
13 namespace cc { | 13 namespace cc { |
14 | 14 |
15 class DelegatingRendererTest : public LayerTreeTest { | 15 class DelegatingRendererTest : public LayerTreeTest { |
16 public: | 16 public: |
17 DelegatingRendererTest() : LayerTreeTest(), output_surface_(NULL) {} | 17 DelegatingRendererTest() : LayerTreeTest(), output_surface_(NULL) {} |
18 virtual ~DelegatingRendererTest() {} | 18 virtual ~DelegatingRendererTest() {} |
19 | 19 |
20 virtual scoped_ptr<OutputSurface> CreateOutputSurface(bool fallback) | 20 virtual scoped_ptr<OutputSurface> CreateOutputSurface(bool fallback) |
21 OVERRIDE { | 21 OVERRIDE { |
22 scoped_ptr<FakeOutputSurface> output_surface = | 22 scoped_ptr<FakeOutputSurface> output_surface = |
23 FakeOutputSurface::CreateDelegating3d(); | 23 FakeOutputSurface::CreateDelegating3d(); |
24 output_surface_ = output_surface.get(); | 24 output_surface_ = output_surface.get(); |
25 return output_surface.PassAs<OutputSurface>(); | 25 return output_surface.PassAs<OutputSurface>(); |
26 } | 26 } |
27 | 27 |
| 28 virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE { |
| 29 settings->max_bytes_pending_upload = 16 * 1024 * 1024; |
| 30 } |
| 31 |
28 protected: | 32 protected: |
29 TestWebGraphicsContext3D* context3d_; | 33 TestWebGraphicsContext3D* context3d_; |
30 FakeOutputSurface* output_surface_; | 34 FakeOutputSurface* output_surface_; |
31 }; | 35 }; |
32 | 36 |
33 class DelegatingRendererTestDraw : public DelegatingRendererTest { | 37 class DelegatingRendererTestDraw : public DelegatingRendererTest { |
34 public: | 38 public: |
35 virtual void BeginTest() OVERRIDE { | 39 virtual void BeginTest() OVERRIDE { |
36 layer_tree_host()->SetPageScaleFactorAndLimits(1.f, 0.5f, 4.f); | 40 layer_tree_host()->SetPageScaleFactorAndLimits(1.f, 0.5f, 4.f); |
37 PostSetNeedsCommitToMainThread(); | 41 PostSetNeedsCommitToMainThread(); |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 22u, last_frame.delegated_frame_data->resource_list.size()); | 141 22u, last_frame.delegated_frame_data->resource_list.size()); |
138 | 142 |
139 EndTest(); | 143 EndTest(); |
140 } | 144 } |
141 }; | 145 }; |
142 | 146 |
143 SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_TEST_F( | 147 SINGLE_AND_MULTI_THREAD_DELEGATING_RENDERER_TEST_F( |
144 DelegatingRendererTestResources); | 148 DelegatingRendererTestResources); |
145 | 149 |
146 } // namespace cc | 150 } // namespace cc |
OLD | NEW |