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

Side by Side Diff: cc/layers/picture_layer_unittest.cc

Issue 2846653002: cc : Stop pushing layers from hidden subtrees at commit
Patch Set: rebase Created 3 years, 6 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
« no previous file with comments | « cc/layers/layer_unittest.cc ('k') | cc/trees/draw_property_utils.cc » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/layers/picture_layer.h" 5 #include "cc/layers/picture_layer.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/threading/thread_task_runner_handle.h" 10 #include "base/threading/thread_task_runner_handle.h"
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 EXPECT_EQ(1, host1->SourceFrameNumber()); 402 EXPECT_EQ(1, host1->SourceFrameNumber());
403 EXPECT_EQ(gfx::Size(500, 500), layer->bounds()); 403 EXPECT_EQ(gfx::Size(500, 500), layer->bounds());
404 404
405 // Then moved to another LayerTreeHost. 405 // Then moved to another LayerTreeHost.
406 host1->SetRootLayer(nullptr); 406 host1->SetRootLayer(nullptr);
407 scoped_refptr<Layer> root = Layer::Create(); 407 scoped_refptr<Layer> root = Layer::Create();
408 host2->SetRootLayer(root); 408 host2->SetRootLayer(root);
409 root->AddChild(layer); 409 root->AddChild(layer);
410 410
411 // Make the layer not update. 411 // Make the layer not update.
412 layer->SetHideLayerAndSubtree(true); 412 layer->SetOpacity(0.f);
413 EXPECT_EQ(gfx::Size(500, 500), 413 EXPECT_EQ(gfx::Size(500, 500),
414 layer->GetRecordingSourceForTesting()->GetSize()); 414 layer->GetRecordingSourceForTesting()->GetSize());
415 415
416 // Change its bounds while it's in a state that can't update. 416 // Change its bounds while it's in a state that can't update.
417 layer->SetBounds(gfx::Size(600, 600)); 417 layer->SetBounds(gfx::Size(600, 600));
418 host2->Composite(base::TimeTicks::Now()); 418 host2->Composite(base::TimeTicks::Now());
419 419
420 // This layer should not have been updated because it is invisible. 420 // This layer should not have been updated because it is invisible.
421 EXPECT_EQ(1, layer->update_count()); 421 EXPECT_EQ(1, layer->update_count());
422 EXPECT_EQ(1, host2->SourceFrameNumber()); 422 EXPECT_EQ(1, host2->SourceFrameNumber());
423 423
424 // This layer should also drop its recording source because it was resized 424 // This layer should also drop its recording source because it was resized
425 // and not recorded. 425 // and not recorded.
426 EXPECT_EQ(gfx::Size(), layer->GetRecordingSourceForTesting()->GetSize()); 426 EXPECT_EQ(gfx::Size(), layer->GetRecordingSourceForTesting()->GetSize());
427 } 427 }
428 428
429 } // namespace 429 } // namespace
430 } // namespace cc 430 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/layer_unittest.cc ('k') | cc/trees/draw_property_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698