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_impl.h" | 5 #include "cc/trees/layer_tree_host_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 8366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8377 EXPECT_EQ(GpuRasterizationStatus::ON_FORCED, | 8377 EXPECT_EQ(GpuRasterizationStatus::ON_FORCED, |
8378 host_impl_->gpu_rasterization_status()); | 8378 host_impl_->gpu_rasterization_status()); |
8379 EXPECT_TRUE(host_impl_->use_gpu_rasterization()); | 8379 EXPECT_TRUE(host_impl_->use_gpu_rasterization()); |
8380 } | 8380 } |
8381 | 8381 |
8382 // A mock output surface which lets us detect calls to ForceReclaimResources. | 8382 // A mock output surface which lets us detect calls to ForceReclaimResources. |
8383 class MockReclaimResourcesOutputSurface : public FakeOutputSurface { | 8383 class MockReclaimResourcesOutputSurface : public FakeOutputSurface { |
8384 public: | 8384 public: |
8385 static scoped_ptr<MockReclaimResourcesOutputSurface> Create3d() { | 8385 static scoped_ptr<MockReclaimResourcesOutputSurface> Create3d() { |
8386 return make_scoped_ptr(new MockReclaimResourcesOutputSurface( | 8386 return make_scoped_ptr(new MockReclaimResourcesOutputSurface( |
8387 TestContextProvider::Create(), TestContextProvider::Create(), false)); | 8387 TestContextProvider::Create(), TestContextProvider::CreateWorker(), |
| 8388 false)); |
8388 } | 8389 } |
8389 | 8390 |
8390 MOCK_METHOD0(ForceReclaimResources, void()); | 8391 MOCK_METHOD0(ForceReclaimResources, void()); |
8391 | 8392 |
8392 protected: | 8393 protected: |
8393 MockReclaimResourcesOutputSurface( | 8394 MockReclaimResourcesOutputSurface( |
8394 scoped_refptr<ContextProvider> context_provider, | 8395 scoped_refptr<ContextProvider> context_provider, |
8395 scoped_refptr<ContextProvider> worker_context_provider, | 8396 scoped_refptr<ContextProvider> worker_context_provider, |
8396 bool delegated_rendering) | 8397 bool delegated_rendering) |
8397 : FakeOutputSurface(context_provider, | 8398 : FakeOutputSurface(context_provider, |
(...skipping 11 matching lines...) Expand all Loading... |
8409 // Hold an unowned pointer to the output surface to use for mock expectations. | 8410 // Hold an unowned pointer to the output surface to use for mock expectations. |
8410 MockReclaimResourcesOutputSurface* mock_output_surface = output_surface.get(); | 8411 MockReclaimResourcesOutputSurface* mock_output_surface = output_surface.get(); |
8411 | 8412 |
8412 CreateHostImpl(DefaultSettings(), output_surface.Pass()); | 8413 CreateHostImpl(DefaultSettings(), output_surface.Pass()); |
8413 EXPECT_CALL(*mock_output_surface, ForceReclaimResources()).Times(1); | 8414 EXPECT_CALL(*mock_output_surface, ForceReclaimResources()).Times(1); |
8414 host_impl_->BeginCommit(); | 8415 host_impl_->BeginCommit(); |
8415 } | 8416 } |
8416 | 8417 |
8417 } // namespace | 8418 } // namespace |
8418 } // namespace cc | 8419 } // namespace cc |
OLD | NEW |