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 8461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8472 EXPECT_EQ(GpuRasterizationStatus::ON_FORCED, | 8472 EXPECT_EQ(GpuRasterizationStatus::ON_FORCED, |
8473 host_impl_->gpu_rasterization_status()); | 8473 host_impl_->gpu_rasterization_status()); |
8474 EXPECT_TRUE(host_impl_->use_gpu_rasterization()); | 8474 EXPECT_TRUE(host_impl_->use_gpu_rasterization()); |
8475 } | 8475 } |
8476 | 8476 |
8477 // A mock output surface which lets us detect calls to ForceReclaimResources. | 8477 // A mock output surface which lets us detect calls to ForceReclaimResources. |
8478 class MockReclaimResourcesOutputSurface : public FakeOutputSurface { | 8478 class MockReclaimResourcesOutputSurface : public FakeOutputSurface { |
8479 public: | 8479 public: |
8480 static scoped_ptr<MockReclaimResourcesOutputSurface> Create3d() { | 8480 static scoped_ptr<MockReclaimResourcesOutputSurface> Create3d() { |
8481 return make_scoped_ptr(new MockReclaimResourcesOutputSurface( | 8481 return make_scoped_ptr(new MockReclaimResourcesOutputSurface( |
8482 TestContextProvider::Create(), TestContextProvider::CreateWorker(), | 8482 TestContextProvider::Create(), TestContextProvider::Create(), false)); |
8483 false)); | |
8484 } | 8483 } |
8485 | 8484 |
8486 MOCK_METHOD0(ForceReclaimResources, void()); | 8485 MOCK_METHOD0(ForceReclaimResources, void()); |
8487 | 8486 |
8488 protected: | 8487 protected: |
8489 MockReclaimResourcesOutputSurface( | 8488 MockReclaimResourcesOutputSurface( |
8490 scoped_refptr<ContextProvider> context_provider, | 8489 scoped_refptr<ContextProvider> context_provider, |
8491 scoped_refptr<ContextProvider> worker_context_provider, | 8490 scoped_refptr<ContextProvider> worker_context_provider, |
8492 bool delegated_rendering) | 8491 bool delegated_rendering) |
8493 : FakeOutputSurface(context_provider, | 8492 : FakeOutputSurface(context_provider, |
(...skipping 11 matching lines...) Expand all Loading... |
8505 // Hold an unowned pointer to the output surface to use for mock expectations. | 8504 // Hold an unowned pointer to the output surface to use for mock expectations. |
8506 MockReclaimResourcesOutputSurface* mock_output_surface = output_surface.get(); | 8505 MockReclaimResourcesOutputSurface* mock_output_surface = output_surface.get(); |
8507 | 8506 |
8508 CreateHostImpl(DefaultSettings(), output_surface.Pass()); | 8507 CreateHostImpl(DefaultSettings(), output_surface.Pass()); |
8509 EXPECT_CALL(*mock_output_surface, ForceReclaimResources()).Times(1); | 8508 EXPECT_CALL(*mock_output_surface, ForceReclaimResources()).Times(1); |
8510 host_impl_->BeginCommit(); | 8509 host_impl_->BeginCommit(); |
8511 } | 8510 } |
8512 | 8511 |
8513 } // namespace | 8512 } // namespace |
8514 } // namespace cc | 8513 } // namespace cc |
OLD | NEW |