| 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 <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 4301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4312 // should still be generated. | 4312 // should still be generated. |
| 4313 gfx::Rect small_damage = gfx::Rect(0, 0, 1, 1); | 4313 gfx::Rect small_damage = gfx::Rect(0, 0, 1, 1); |
| 4314 host_impl_->active_tree()->root_layer()->SetUpdateRect(small_damage); | 4314 host_impl_->active_tree()->root_layer()->SetUpdateRect(small_damage); |
| 4315 DrawFrameAndTestDamage(small_damage); | 4315 DrawFrameAndTestDamage(small_damage); |
| 4316 | 4316 |
| 4317 // The third frame should have no damage, so no quads should be generated. | 4317 // The third frame should have no damage, so no quads should be generated. |
| 4318 gfx::Rect no_damage; | 4318 gfx::Rect no_damage; |
| 4319 DrawFrameAndTestDamage(no_damage); | 4319 DrawFrameAndTestDamage(no_damage); |
| 4320 } | 4320 } |
| 4321 | 4321 |
| 4322 // TODO(reveman): Remove this test and the ability to prevent on demand raster |
| 4323 // when delegating renderer supports PictureDrawQuads. crbug.com/342121 |
| 4324 TEST_F(LayerTreeHostImplTestWithDelegatingRenderer, PreventRasterizeOnDemand) { |
| 4325 LayerTreeSettings settings; |
| 4326 CreateHostImpl(settings, CreateOutputSurface()); |
| 4327 EXPECT_FALSE(host_impl_->GetRendererCapabilities().allow_rasterize_on_demand); |
| 4328 } |
| 4329 |
| 4322 class FakeMaskLayerImpl : public LayerImpl { | 4330 class FakeMaskLayerImpl : public LayerImpl { |
| 4323 public: | 4331 public: |
| 4324 static scoped_ptr<FakeMaskLayerImpl> Create(LayerTreeImpl* tree_impl, | 4332 static scoped_ptr<FakeMaskLayerImpl> Create(LayerTreeImpl* tree_impl, |
| 4325 int id) { | 4333 int id) { |
| 4326 return make_scoped_ptr(new FakeMaskLayerImpl(tree_impl, id)); | 4334 return make_scoped_ptr(new FakeMaskLayerImpl(tree_impl, id)); |
| 4327 } | 4335 } |
| 4328 | 4336 |
| 4329 virtual ResourceProvider::ResourceId ContentsResourceId() const OVERRIDE { | 4337 virtual ResourceProvider::ResourceId ContentsResourceId() const OVERRIDE { |
| 4330 return 0; | 4338 return 0; |
| 4331 } | 4339 } |
| (...skipping 1440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5772 &set_needs_redraw_count)); | 5780 &set_needs_redraw_count)); |
| 5773 // Empty damage rect won't signal the monitor. | 5781 // Empty damage rect won't signal the monitor. |
| 5774 host_impl_->SetNeedsRedrawRect(gfx::Rect()); | 5782 host_impl_->SetNeedsRedrawRect(gfx::Rect()); |
| 5775 EXPECT_EQ(0, set_needs_commit_count); | 5783 EXPECT_EQ(0, set_needs_commit_count); |
| 5776 EXPECT_EQ(2, set_needs_redraw_count); | 5784 EXPECT_EQ(2, set_needs_redraw_count); |
| 5777 } | 5785 } |
| 5778 } | 5786 } |
| 5779 | 5787 |
| 5780 } // namespace | 5788 } // namespace |
| 5781 } // namespace cc | 5789 } // namespace cc |
| OLD | NEW |