Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(38)

Side by Side Diff: cc/trees/layer_tree_host_impl_unittest.cc

Issue 287553003: cc: Set requires high res upon becoming visible (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: +test Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 5722 matching lines...) Expand 10 before | Expand all | Expand 10 after
5733 host_impl_->SetVisible(true); 5733 host_impl_->SetVisible(true);
5734 host_impl_->SetMemoryPolicy(policy1); 5734 host_impl_->SetMemoryPolicy(policy1);
5735 EXPECT_EQ(policy1.bytes_limit_when_visible, current_limit_bytes_); 5735 EXPECT_EQ(policy1.bytes_limit_when_visible, current_limit_bytes_);
5736 EXPECT_EQ(allow_nice_to_have_cutoff_value, current_priority_cutoff_value_); 5736 EXPECT_EQ(allow_nice_to_have_cutoff_value, current_priority_cutoff_value_);
5737 5737
5738 host_impl_->SetVisible(false); 5738 host_impl_->SetVisible(false);
5739 EXPECT_EQ(0u, current_limit_bytes_); 5739 EXPECT_EQ(0u, current_limit_bytes_);
5740 EXPECT_EQ(nothing_cutoff_value, current_priority_cutoff_value_); 5740 EXPECT_EQ(nothing_cutoff_value, current_priority_cutoff_value_);
5741 } 5741 }
5742 5742
5743 TEST_F(LayerTreeHostImplTest, RequireHighResWhenVisible) {
5744 ASSERT_TRUE(host_impl_->active_tree());
5745
danakj 2014/05/13 18:14:26 can you verify the state of RequiresHighResToDraw
5746 host_impl_->SetVisible(false);
5747 EXPECT_FALSE(host_impl_->active_tree()->RequiresHighResToDraw());
5748 host_impl_->SetVisible(true);
5749 EXPECT_TRUE(host_impl_->active_tree()->RequiresHighResToDraw());
5750 host_impl_->SetVisible(false);
5751 EXPECT_TRUE(host_impl_->active_tree()->RequiresHighResToDraw());
5752
5753 host_impl_->CreatePendingTree();
5754 host_impl_->ActivatePendingTree();
5755
5756 EXPECT_FALSE(host_impl_->active_tree()->RequiresHighResToDraw());
5757 host_impl_->SetVisible(true);
5758 EXPECT_TRUE(host_impl_->active_tree()->RequiresHighResToDraw());
5759 }
5760
5743 class LayerTreeHostImplTestManageTiles : public LayerTreeHostImplTest { 5761 class LayerTreeHostImplTestManageTiles : public LayerTreeHostImplTest {
5744 public: 5762 public:
5745 virtual void SetUp() OVERRIDE { 5763 virtual void SetUp() OVERRIDE {
5746 LayerTreeSettings settings; 5764 LayerTreeSettings settings;
5747 settings.impl_side_painting = true; 5765 settings.impl_side_painting = true;
5748 5766
5749 fake_host_impl_ = new FakeLayerTreeHostImpl( 5767 fake_host_impl_ = new FakeLayerTreeHostImpl(
5750 settings, &proxy_, shared_bitmap_manager_.get()); 5768 settings, &proxy_, shared_bitmap_manager_.get());
5751 host_impl_.reset(fake_host_impl_); 5769 host_impl_.reset(fake_host_impl_);
5752 host_impl_->InitializeRenderer(CreateOutputSurface()); 5770 host_impl_->InitializeRenderer(CreateOutputSurface());
(...skipping 814 matching lines...) Expand 10 before | Expand all | Expand 10 after
6567 FakePictureLayerImpl* active_mask_content = 6585 FakePictureLayerImpl* active_mask_content =
6568 static_cast<FakePictureLayerImpl*>( 6586 static_cast<FakePictureLayerImpl*>(
6569 host_impl_->active_tree()->root_layer()->children()[0]->mask_layer()); 6587 host_impl_->active_tree()->root_layer()->children()[0]->mask_layer());
6570 gfx::Rect r2 = active_mask_content->visible_rect_for_tile_priority(); 6588 gfx::Rect r2 = active_mask_content->visible_rect_for_tile_priority();
6571 6589
6572 ASSERT_TRUE(!r2.IsEmpty()); 6590 ASSERT_TRUE(!r2.IsEmpty());
6573 } 6591 }
6574 6592
6575 } // namespace 6593 } // namespace
6576 } // namespace cc 6594 } // namespace cc
OLDNEW
« cc/trees/layer_tree_host_impl.cc ('K') | « cc/trees/layer_tree_host_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698