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 | 6 |
7 #include "base/test/test_simple_task_runner.h" | 7 #include "base/test/test_simple_task_runner.h" |
8 #include "cc/debug/test_context_provider.h" | 8 #include "cc/debug/test_context_provider.h" |
9 #include "cc/debug/test_web_graphics_context_3d.h" | 9 #include "cc/debug/test_web_graphics_context_3d.h" |
10 #include "cc/output/managed_memory_policy.h" | 10 #include "cc/output/managed_memory_policy.h" |
11 #include "cc/output/output_surface_client.h" | 11 #include "cc/output/output_surface_client.h" |
12 #include "cc/output/software_output_device.h" | 12 #include "cc/output/software_output_device.h" |
13 #include "cc/test/fake_output_surface.h" | 13 #include "cc/test/fake_output_surface.h" |
14 #include "cc/test/fake_output_surface_client.h" | 14 #include "cc/test/fake_output_surface_client.h" |
15 #include "cc/test/scheduler_test_common.h" | 15 #include "cc/test/scheduler_test_common.h" |
16 #include "gpu/GLES2/gl2extchromium.h" | 16 #include "gpu/GLES2/gl2extchromium.h" |
17 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
18 | 18 |
19 namespace cc { | 19 namespace cc { |
20 namespace { | 20 namespace { |
21 | 21 |
22 class TestOutputSurface : public OutputSurface { | 22 class TestOutputSurface : public OutputSurface { |
23 public: | 23 public: |
24 explicit TestOutputSurface(scoped_refptr<ContextProvider> context_provider) | 24 explicit TestOutputSurface(scoped_refptr<ContextProvider> context_provider) |
25 : OutputSurface(context_provider) {} | 25 : OutputSurface(context_provider, |
| 26 OutputSurface::kDefaultMaxTransferBufferUsageBytes) {} |
26 | 27 |
27 explicit TestOutputSurface( | 28 explicit TestOutputSurface( |
28 scoped_ptr<cc::SoftwareOutputDevice> software_device) | 29 scoped_ptr<cc::SoftwareOutputDevice> software_device) |
29 : OutputSurface(software_device.Pass()) {} | 30 : OutputSurface(software_device.Pass(), |
| 31 OutputSurface::kDefaultMaxTransferBufferUsageBytes) {} |
30 | 32 |
31 TestOutputSurface(scoped_refptr<ContextProvider> context_provider, | 33 TestOutputSurface(scoped_refptr<ContextProvider> context_provider, |
32 scoped_ptr<cc::SoftwareOutputDevice> software_device) | 34 scoped_ptr<cc::SoftwareOutputDevice> software_device) |
33 : OutputSurface(context_provider, software_device.Pass()) {} | 35 : OutputSurface(context_provider, software_device.Pass(), |
| 36 OutputSurface::kDefaultMaxTransferBufferUsageBytes) {} |
34 | 37 |
35 bool InitializeNewContext3d( | 38 bool InitializeNewContext3d( |
36 scoped_refptr<ContextProvider> new_context_provider) { | 39 scoped_refptr<ContextProvider> new_context_provider) { |
37 return InitializeAndSetContext3d(new_context_provider, | 40 return InitializeAndSetContext3d(new_context_provider, |
38 scoped_refptr<ContextProvider>()); | 41 scoped_refptr<ContextProvider>()); |
39 } | 42 } |
40 | 43 |
41 using OutputSurface::ReleaseGL; | 44 using OutputSurface::ReleaseGL; |
42 | 45 |
43 void OnVSyncParametersChangedForTesting(base::TimeTicks timebase, | 46 void OnVSyncParametersChangedForTesting(base::TimeTicks timebase, |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 | 405 |
403 // 0 bytes limit should be ignored. | 406 // 0 bytes limit should be ignored. |
404 policy.bytes_limit_when_visible = 0; | 407 policy.bytes_limit_when_visible = 0; |
405 context_provider->SetMemoryAllocation(policy, | 408 context_provider->SetMemoryAllocation(policy, |
406 discard_backbuffer_when_not_visible); | 409 discard_backbuffer_when_not_visible); |
407 EXPECT_EQ(1234u, client.memory_policy().bytes_limit_when_visible); | 410 EXPECT_EQ(1234u, client.memory_policy().bytes_limit_when_visible); |
408 } | 411 } |
409 | 412 |
410 } // namespace | 413 } // namespace |
411 } // namespace cc | 414 } // namespace cc |
OLD | NEW |