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 5035 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5046 EXPECT_FALSE(layer_tree_host()->UseGpuRasterization()); | 5046 EXPECT_FALSE(layer_tree_host()->UseGpuRasterization()); |
5047 | 5047 |
5048 PostSetNeedsCommitToMainThread(); | 5048 PostSetNeedsCommitToMainThread(); |
5049 } | 5049 } |
5050 | 5050 |
5051 virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) OVERRIDE { | 5051 virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) OVERRIDE { |
5052 LayerImpl* root = host_impl->pending_tree()->root_layer(); | 5052 LayerImpl* root = host_impl->pending_tree()->root_layer(); |
5053 PictureLayerImpl* layer_impl = | 5053 PictureLayerImpl* layer_impl = |
5054 static_cast<PictureLayerImpl*>(root->children()[0]); | 5054 static_cast<PictureLayerImpl*>(root->children()[0]); |
5055 | 5055 |
5056 EXPECT_FALSE(layer_impl->ShouldUseGpuRasterization()); | 5056 EXPECT_FALSE(layer_impl->use_gpu_rasterization()); |
5057 } | 5057 } |
5058 | 5058 |
5059 virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) OVERRIDE { | 5059 virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) OVERRIDE { |
5060 LayerImpl* root = host_impl->active_tree()->root_layer(); | 5060 LayerImpl* root = host_impl->active_tree()->root_layer(); |
5061 PictureLayerImpl* layer_impl = | 5061 PictureLayerImpl* layer_impl = |
5062 static_cast<PictureLayerImpl*>(root->children()[0]); | 5062 static_cast<PictureLayerImpl*>(root->children()[0]); |
5063 | 5063 |
5064 EXPECT_FALSE(layer_impl->ShouldUseGpuRasterization()); | 5064 EXPECT_FALSE(layer_impl->use_gpu_rasterization()); |
5065 EndTest(); | 5065 EndTest(); |
5066 } | 5066 } |
5067 | 5067 |
5068 virtual void AfterTest() OVERRIDE {} | 5068 virtual void AfterTest() OVERRIDE {} |
5069 | 5069 |
5070 FakeContentLayerClient layer_client_; | 5070 FakeContentLayerClient layer_client_; |
5071 }; | 5071 }; |
5072 | 5072 |
5073 MULTI_THREAD_TEST_F(LayerTreeHostTestGpuRasterizationDefault); | 5073 MULTI_THREAD_TEST_F(LayerTreeHostTestGpuRasterizationDefault); |
5074 | 5074 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5117 // make sure that the layer gets a chance to update. | 5117 // make sure that the layer gets a chance to update. |
5118 layer->SetNeedsDisplay(); | 5118 layer->SetNeedsDisplay(); |
5119 PostSetNeedsCommitToMainThread(); | 5119 PostSetNeedsCommitToMainThread(); |
5120 } | 5120 } |
5121 | 5121 |
5122 virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) OVERRIDE { | 5122 virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) OVERRIDE { |
5123 LayerImpl* root = host_impl->pending_tree()->root_layer(); | 5123 LayerImpl* root = host_impl->pending_tree()->root_layer(); |
5124 PictureLayerImpl* layer_impl = | 5124 PictureLayerImpl* layer_impl = |
5125 static_cast<PictureLayerImpl*>(root->children()[0]); | 5125 static_cast<PictureLayerImpl*>(root->children()[0]); |
5126 | 5126 |
5127 EXPECT_FALSE(layer_impl->ShouldUseGpuRasterization()); | 5127 EXPECT_FALSE(layer_impl->use_gpu_rasterization()); |
5128 } | 5128 } |
5129 | 5129 |
5130 virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) OVERRIDE { | 5130 virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) OVERRIDE { |
5131 LayerImpl* root = host_impl->active_tree()->root_layer(); | 5131 LayerImpl* root = host_impl->active_tree()->root_layer(); |
5132 PictureLayerImpl* layer_impl = | 5132 PictureLayerImpl* layer_impl = |
5133 static_cast<PictureLayerImpl*>(root->children()[0]); | 5133 static_cast<PictureLayerImpl*>(root->children()[0]); |
5134 | 5134 |
5135 EXPECT_FALSE(layer_impl->ShouldUseGpuRasterization()); | 5135 EXPECT_FALSE(layer_impl->use_gpu_rasterization()); |
5136 EndTest(); | 5136 EndTest(); |
5137 } | 5137 } |
5138 | 5138 |
5139 virtual void AfterTest() OVERRIDE {} | 5139 virtual void AfterTest() OVERRIDE {} |
5140 | 5140 |
5141 FakeContentLayerClient layer_client_; | 5141 FakeContentLayerClient layer_client_; |
5142 }; | 5142 }; |
5143 | 5143 |
5144 MULTI_THREAD_TEST_F(LayerTreeHostTestGpuRasterizationEnabled); | 5144 MULTI_THREAD_TEST_F(LayerTreeHostTestGpuRasterizationEnabled); |
5145 | 5145 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5188 // make sure that the layer gets a chance to update. | 5188 // make sure that the layer gets a chance to update. |
5189 layer->SetNeedsDisplay(); | 5189 layer->SetNeedsDisplay(); |
5190 PostSetNeedsCommitToMainThread(); | 5190 PostSetNeedsCommitToMainThread(); |
5191 } | 5191 } |
5192 | 5192 |
5193 virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) OVERRIDE { | 5193 virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) OVERRIDE { |
5194 LayerImpl* root = host_impl->pending_tree()->root_layer(); | 5194 LayerImpl* root = host_impl->pending_tree()->root_layer(); |
5195 PictureLayerImpl* layer_impl = | 5195 PictureLayerImpl* layer_impl = |
5196 static_cast<PictureLayerImpl*>(root->children()[0]); | 5196 static_cast<PictureLayerImpl*>(root->children()[0]); |
5197 | 5197 |
5198 EXPECT_TRUE(layer_impl->ShouldUseGpuRasterization()); | 5198 EXPECT_TRUE(layer_impl->use_gpu_rasterization()); |
5199 } | 5199 } |
5200 | 5200 |
5201 virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) OVERRIDE { | 5201 virtual void DidActivateTreeOnThread(LayerTreeHostImpl* host_impl) OVERRIDE { |
5202 LayerImpl* root = host_impl->active_tree()->root_layer(); | 5202 LayerImpl* root = host_impl->active_tree()->root_layer(); |
5203 PictureLayerImpl* layer_impl = | 5203 PictureLayerImpl* layer_impl = |
5204 static_cast<PictureLayerImpl*>(root->children()[0]); | 5204 static_cast<PictureLayerImpl*>(root->children()[0]); |
5205 | 5205 |
5206 EXPECT_TRUE(layer_impl->ShouldUseGpuRasterization()); | 5206 EXPECT_TRUE(layer_impl->use_gpu_rasterization()); |
5207 EndTest(); | 5207 EndTest(); |
5208 } | 5208 } |
5209 | 5209 |
5210 virtual void AfterTest() OVERRIDE {} | 5210 virtual void AfterTest() OVERRIDE {} |
5211 | 5211 |
5212 FakeContentLayerClient layer_client_; | 5212 FakeContentLayerClient layer_client_; |
5213 }; | 5213 }; |
5214 | 5214 |
5215 MULTI_THREAD_TEST_F(LayerTreeHostTestGpuRasterizationForced); | 5215 MULTI_THREAD_TEST_F(LayerTreeHostTestGpuRasterizationForced); |
5216 | 5216 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5287 const gfx::Size bounds_; | 5287 const gfx::Size bounds_; |
5288 FakeContentLayerClient client_; | 5288 FakeContentLayerClient client_; |
5289 scoped_refptr<ContentLayerWithUpdateTracking> content_layer_; | 5289 scoped_refptr<ContentLayerWithUpdateTracking> content_layer_; |
5290 scoped_refptr<FakePictureLayer> picture_layer_; | 5290 scoped_refptr<FakePictureLayer> picture_layer_; |
5291 Layer* child_layer_; | 5291 Layer* child_layer_; |
5292 }; | 5292 }; |
5293 | 5293 |
5294 MULTI_THREAD_TEST_F(LayerTreeHostTestContinuousPainting); | 5294 MULTI_THREAD_TEST_F(LayerTreeHostTestContinuousPainting); |
5295 | 5295 |
5296 } // namespace cc | 5296 } // namespace cc |
OLD | NEW |