| 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/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "base/synchronization/lock.h" | 10 #include "base/synchronization/lock.h" |
| (...skipping 4174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4185 void InitializeSettings(LayerTreeSettings* settings) override { | 4185 void InitializeSettings(LayerTreeSettings* settings) override { |
| 4186 settings->impl_side_painting = true; | 4186 settings->impl_side_painting = true; |
| 4187 settings->use_zero_copy = false; | 4187 settings->use_zero_copy = false; |
| 4188 settings->use_one_copy = false; | 4188 settings->use_one_copy = false; |
| 4189 } | 4189 } |
| 4190 | 4190 |
| 4191 scoped_ptr<FakeOutputSurface> CreateFakeOutputSurface( | 4191 scoped_ptr<FakeOutputSurface> CreateFakeOutputSurface( |
| 4192 bool fallback) override { | 4192 bool fallback) override { |
| 4193 scoped_refptr<TestContextProvider> context_provider = | 4193 scoped_refptr<TestContextProvider> context_provider = |
| 4194 TestContextProvider::Create(); | 4194 TestContextProvider::Create(); |
| 4195 context_provider->SetMaxTransferBufferUsageBytes(1024 * 1024); | 4195 context_provider->SetMaxTransferBufferUsageBytes(512 * 512); |
| 4196 if (delegating_renderer()) | 4196 if (delegating_renderer()) |
| 4197 return FakeOutputSurface::CreateDelegating3d(context_provider); | 4197 return FakeOutputSurface::CreateDelegating3d(context_provider); |
| 4198 else | 4198 else |
| 4199 return FakeOutputSurface::Create3d(context_provider); | 4199 return FakeOutputSurface::Create3d(context_provider); |
| 4200 } | 4200 } |
| 4201 | 4201 |
| 4202 void SetupTree() override { | 4202 void SetupTree() override { |
| 4203 client_.set_fill_with_nonsolid_color(true); | 4203 client_.set_fill_with_nonsolid_color(true); |
| 4204 scoped_refptr<FakePictureLayer> root_layer = | 4204 scoped_refptr<FakePictureLayer> root_layer = |
| 4205 FakePictureLayer::Create(&client_); | 4205 FakePictureLayer::Create(&client_); |
| 4206 root_layer->SetBounds(gfx::Size(6000, 6000)); | 4206 root_layer->SetBounds(gfx::Size(1024, 1024)); |
| 4207 root_layer->SetIsDrawable(true); | 4207 root_layer->SetIsDrawable(true); |
| 4208 | 4208 |
| 4209 layer_tree_host()->SetRootLayer(root_layer); | 4209 layer_tree_host()->SetRootLayer(root_layer); |
| 4210 LayerTreeHostTest::SetupTree(); | 4210 LayerTreeHostTest::SetupTree(); |
| 4211 } | 4211 } |
| 4212 | 4212 |
| 4213 void BeginTest() override { PostSetNeedsCommitToMainThread(); } | 4213 void BeginTest() override { PostSetNeedsCommitToMainThread(); } |
| 4214 | 4214 |
| 4215 void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override { | 4215 void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override { |
| 4216 TestWebGraphicsContext3D* context = TestContext(); | 4216 TestWebGraphicsContext3D* context = TestContext(); |
| 4217 | 4217 |
| 4218 // Expect that the transfer buffer memory used is equal to the | 4218 // Expect that the transfer buffer memory used is equal to the |
| 4219 // MaxTransferBufferUsageBytes value set in CreateOutputSurface. | 4219 // MaxTransferBufferUsageBytes value set in CreateOutputSurface. |
| 4220 EXPECT_EQ(1024 * 1024u, context->max_used_transfer_buffer_usage_bytes()); | 4220 EXPECT_EQ(512 * 512u, context->max_used_transfer_buffer_usage_bytes()); |
| 4221 EndTest(); | 4221 EndTest(); |
| 4222 } | 4222 } |
| 4223 | 4223 |
| 4224 void AfterTest() override {} | 4224 void AfterTest() override {} |
| 4225 | 4225 |
| 4226 private: | 4226 private: |
| 4227 FakeContentLayerClient client_; | 4227 FakeContentLayerClient client_; |
| 4228 }; | 4228 }; |
| 4229 | 4229 |
| 4230 // Impl-side painting is a multi-threaded compositor feature. | 4230 // Impl-side painting is a multi-threaded compositor feature. |
| (...skipping 968 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5199 void AfterTest() override { | 5199 void AfterTest() override { |
| 5200 EXPECT_TRUE(deltas_sent_to_client_); | 5200 EXPECT_TRUE(deltas_sent_to_client_); |
| 5201 } | 5201 } |
| 5202 | 5202 |
| 5203 ScrollAndScaleSet info_; | 5203 ScrollAndScaleSet info_; |
| 5204 bool deltas_sent_to_client_; | 5204 bool deltas_sent_to_client_; |
| 5205 }; | 5205 }; |
| 5206 | 5206 |
| 5207 MULTI_THREAD_TEST_F(LayerTreeHostAcceptsDeltasFromImplWithoutRootLayer); | 5207 MULTI_THREAD_TEST_F(LayerTreeHostAcceptsDeltasFromImplWithoutRootLayer); |
| 5208 } // namespace cc | 5208 } // namespace cc |
| OLD | NEW |