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

Side by Side Diff: cc/layer_tree_host_impl_unittest.cc

Issue 11886091: cc: Fix resource eviction with impl-side painting. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix enforceManagedMemoryPolicy. It's possible we have pending tree when this is called. Created 7 years, 11 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
« no previous file with comments | « cc/layer_tree_host_impl.cc ('k') | cc/layer_tree_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/layer_tree_host_impl.h" 5 #include "cc/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 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 m_onCanDrawStateChangedCalled = false; 276 m_onCanDrawStateChangedCalled = false;
277 277
278 // Toggle contents textures purged to make sure it toggles canDraw. 278 // Toggle contents textures purged to make sure it toggles canDraw.
279 setReduceMemoryResult(true); 279 setReduceMemoryResult(true);
280 m_hostImpl->setManagedMemoryPolicy(ManagedMemoryPolicy( 280 m_hostImpl->setManagedMemoryPolicy(ManagedMemoryPolicy(
281 m_hostImpl->memoryAllocationLimitBytes() - 1)); 281 m_hostImpl->memoryAllocationLimitBytes() - 1));
282 EXPECT_FALSE(m_hostImpl->canDraw()); 282 EXPECT_FALSE(m_hostImpl->canDraw());
283 EXPECT_TRUE(m_onCanDrawStateChangedCalled); 283 EXPECT_TRUE(m_onCanDrawStateChangedCalled);
284 m_onCanDrawStateChangedCalled = false; 284 m_onCanDrawStateChangedCalled = false;
285 285
286 m_hostImpl->resetContentsTexturesPurged(); 286 m_hostImpl->activeTree()->ResetContentsTexturesPurged();
287 EXPECT_TRUE(m_hostImpl->canDraw()); 287 EXPECT_TRUE(m_hostImpl->canDraw());
288 EXPECT_TRUE(m_onCanDrawStateChangedCalled); 288 EXPECT_TRUE(m_onCanDrawStateChangedCalled);
289 m_onCanDrawStateChangedCalled = false; 289 m_onCanDrawStateChangedCalled = false;
290 } 290 }
291 291
292 TEST_P(LayerTreeHostImplTest, scrollDeltaNoLayers) 292 TEST_P(LayerTreeHostImplTest, scrollDeltaNoLayers)
293 { 293 {
294 ASSERT_FALSE(m_hostImpl->rootLayer()); 294 ASSERT_FALSE(m_hostImpl->rootLayer());
295 295
296 scoped_ptr<ScrollAndScaleSet> scrollInfo = m_hostImpl->processScrollDeltas() ; 296 scoped_ptr<ScrollAndScaleSet> scrollInfo = m_hostImpl->processScrollDeltas() ;
(...skipping 4387 matching lines...) Expand 10 before | Expand all | Expand 10 after
4684 m_hostImpl->didDrawAllLayers(frame); 4684 m_hostImpl->didDrawAllLayers(frame);
4685 } 4685 }
4686 } 4686 }
4687 4687
4688 INSTANTIATE_TEST_CASE_P(LayerTreeHostImplTests, 4688 INSTANTIATE_TEST_CASE_P(LayerTreeHostImplTests,
4689 LayerTreeHostImplTest, 4689 LayerTreeHostImplTest,
4690 ::testing::Values(false, true)); 4690 ::testing::Values(false, true));
4691 4691
4692 } // namespace 4692 } // namespace
4693 } // namespace cc 4693 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layer_tree_host_impl.cc ('k') | cc/layer_tree_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698