Index: cc/layers/texture_layer_unittest.cc |
diff --git a/cc/layers/texture_layer_unittest.cc b/cc/layers/texture_layer_unittest.cc |
index 4a1e76d7e4985ee2943c656cbf9e10b5dfdf9196..c3c6fd5110e11a3ceaa6ed2ea0c50ff158569bdc 100644 |
--- a/cc/layers/texture_layer_unittest.cc |
+++ b/cc/layers/texture_layer_unittest.cc |
@@ -211,11 +211,12 @@ class TextureLayerTest : public testing::Test { |
TestTaskGraphRunner task_graph_runner_; |
FakeLayerTreeHostImpl host_impl_; |
CommonMailboxObjects test_data_; |
+ LayerSettings layer_settings_; |
}; |
TEST_F(TextureLayerTest, CheckPropertyChangeCausesCorrectBehavior) { |
scoped_refptr<TextureLayer> test_layer = |
- TextureLayer::CreateForMailbox(nullptr); |
+ TextureLayer::CreateForMailbox(layer_settings_, nullptr); |
EXPECT_SET_NEEDS_COMMIT(1, layer_tree_host_->SetRootLayer(test_layer)); |
// Test properties that should call SetNeedsCommit. All properties need to |
@@ -235,7 +236,8 @@ TEST_F(TextureLayerTest, VisibleContentOpaqueRegion) { |
const gfx::Rect layer_rect(layer_bounds); |
const Region layer_region(layer_rect); |
- scoped_refptr<TextureLayer> layer = TextureLayer::CreateForMailbox(nullptr); |
+ scoped_refptr<TextureLayer> layer = |
+ TextureLayer::CreateForMailbox(layer_settings_, nullptr); |
layer->SetBounds(layer_bounds); |
layer->draw_properties().visible_content_rect = layer_rect; |
layer->SetBlendBackgroundColor(true); |
@@ -259,8 +261,8 @@ TEST_F(TextureLayerTest, VisibleContentOpaqueRegion) { |
TEST_F(TextureLayerTest, RateLimiter) { |
FakeTextureLayerClient client; |
- scoped_refptr<TextureLayer> test_layer = TextureLayer::CreateForMailbox( |
- &client); |
+ scoped_refptr<TextureLayer> test_layer = |
+ TextureLayer::CreateForMailbox(layer_settings_, &client); |
test_layer->SetIsDrawable(true); |
EXPECT_CALL(*layer_tree_host_, SetNeedsCommit()).Times(AnyNumber()); |
layer_tree_host_->SetRootLayer(test_layer); |
@@ -288,8 +290,7 @@ TEST_F(TextureLayerTest, RateLimiter) { |
Mock::VerifyAndClearExpectations(layer_tree_host_.get()); |
// Reset to a layer with a client, that started the rate limiter. |
- test_layer = TextureLayer::CreateForMailbox( |
- &client); |
+ test_layer = TextureLayer::CreateForMailbox(layer_settings_, &client); |
test_layer->SetIsDrawable(true); |
test_layer->SetRateLimitContext(true); |
EXPECT_CALL(*layer_tree_host_, SetNeedsCommit()).Times(AnyNumber()); |
@@ -329,7 +330,7 @@ class TextureLayerWithMailboxTest : public TextureLayerTest { |
TEST_F(TextureLayerWithMailboxTest, ReplaceMailboxOnMainThreadBeforeCommit) { |
scoped_refptr<TextureLayer> test_layer = |
- TextureLayer::CreateForMailbox(nullptr); |
+ TextureLayer::CreateForMailbox(layer_settings_, nullptr); |
ASSERT_TRUE(test_layer.get()); |
EXPECT_CALL(*layer_tree_host_, SetNeedsCommit()).Times(AnyNumber()); |
@@ -387,7 +388,7 @@ TEST_F(TextureLayerWithMailboxTest, ReplaceMailboxOnMainThreadBeforeCommit) { |
TEST_F(TextureLayerTest, SetTextureMailboxWithoutReleaseCallback) { |
scoped_refptr<TextureLayer> test_layer = |
- TextureLayer::CreateForMailbox(nullptr); |
+ TextureLayer::CreateForMailbox(layer_settings_, nullptr); |
ASSERT_TRUE(test_layer.get()); |
// These use the same gpu::Mailbox, but different sync points. |
@@ -467,7 +468,7 @@ class TextureLayerMailboxHolderTest : public TextureLayerTest { |
TEST_F(TextureLayerMailboxHolderTest, TwoCompositors_BothReleaseThenMain) { |
scoped_refptr<TextureLayer> test_layer = |
- TextureLayer::CreateForMailbox(nullptr); |
+ TextureLayer::CreateForMailbox(layer_settings_, nullptr); |
ASSERT_TRUE(test_layer.get()); |
main_thread_.message_loop()->task_runner()->PostTask( |
@@ -517,7 +518,7 @@ TEST_F(TextureLayerMailboxHolderTest, TwoCompositors_BothReleaseThenMain) { |
TEST_F(TextureLayerMailboxHolderTest, TwoCompositors_MainReleaseBetween) { |
scoped_refptr<TextureLayer> test_layer = |
- TextureLayer::CreateForMailbox(nullptr); |
+ TextureLayer::CreateForMailbox(layer_settings_, nullptr); |
ASSERT_TRUE(test_layer.get()); |
main_thread_.message_loop()->task_runner()->PostTask( |
@@ -568,7 +569,7 @@ TEST_F(TextureLayerMailboxHolderTest, TwoCompositors_MainReleaseBetween) { |
TEST_F(TextureLayerMailboxHolderTest, TwoCompositors_MainReleasedFirst) { |
scoped_refptr<TextureLayer> test_layer = |
- TextureLayer::CreateForMailbox(nullptr); |
+ TextureLayer::CreateForMailbox(layer_settings_, nullptr); |
ASSERT_TRUE(test_layer.get()); |
main_thread_.message_loop()->task_runner()->PostTask( |
@@ -619,7 +620,7 @@ TEST_F(TextureLayerMailboxHolderTest, TwoCompositors_MainReleasedFirst) { |
TEST_F(TextureLayerMailboxHolderTest, TwoCompositors_SecondImplRefShortcut) { |
scoped_refptr<TextureLayer> test_layer = |
- TextureLayer::CreateForMailbox(nullptr); |
+ TextureLayer::CreateForMailbox(layer_settings_, nullptr); |
ASSERT_TRUE(test_layer.get()); |
main_thread_.message_loop()->task_runner()->PostTask( |
@@ -717,10 +718,10 @@ class TextureLayerImplWithMailboxThreadedCallback : public LayerTreeTest { |
EXPECT_EQ(true, main_thread_.CalledOnValidThread()); |
gfx::Size bounds(100, 100); |
- root_ = Layer::Create(); |
+ root_ = Layer::Create(layer_settings()); |
root_->SetBounds(bounds); |
- layer_ = TextureLayer::CreateForMailbox(nullptr); |
+ layer_ = TextureLayer::CreateForMailbox(layer_settings(), nullptr); |
layer_->SetIsDrawable(true); |
layer_->SetBounds(bounds); |
@@ -838,10 +839,10 @@ class TextureLayerMailboxIsActivatedDuringCommit : public LayerTreeTest { |
void BeginTest() override { |
gfx::Size bounds(100, 100); |
- root_ = Layer::Create(); |
+ root_ = Layer::Create(layer_settings()); |
root_->SetBounds(bounds); |
- layer_ = TextureLayer::CreateForMailbox(nullptr); |
+ layer_ = TextureLayer::CreateForMailbox(layer_settings(), nullptr); |
layer_->SetIsDrawable(true); |
layer_->SetBounds(bounds); |
@@ -1139,11 +1140,11 @@ class TextureLayerNoExtraCommitForMailboxTest |
} |
void SetupTree() override { |
- scoped_refptr<Layer> root = Layer::Create(); |
+ scoped_refptr<Layer> root = Layer::Create(layer_settings()); |
root->SetBounds(gfx::Size(10, 10)); |
root->SetIsDrawable(true); |
- texture_layer_ = TextureLayer::CreateForMailbox(this); |
+ texture_layer_ = TextureLayer::CreateForMailbox(layer_settings(), this); |
texture_layer_->SetBounds(gfx::Size(10, 10)); |
texture_layer_->SetIsDrawable(true); |
root->AddChild(texture_layer_); |
@@ -1234,22 +1235,22 @@ class TextureLayerChangeInvisibleMailboxTest |
} |
void SetupTree() override { |
- scoped_refptr<Layer> root = Layer::Create(); |
+ scoped_refptr<Layer> root = Layer::Create(layer_settings()); |
root->SetBounds(gfx::Size(10, 10)); |
root->SetIsDrawable(true); |
- solid_layer_ = SolidColorLayer::Create(); |
+ solid_layer_ = SolidColorLayer::Create(layer_settings()); |
solid_layer_->SetBounds(gfx::Size(10, 10)); |
solid_layer_->SetIsDrawable(true); |
solid_layer_->SetBackgroundColor(SK_ColorWHITE); |
root->AddChild(solid_layer_); |
- parent_layer_ = Layer::Create(); |
+ parent_layer_ = Layer::Create(layer_settings()); |
parent_layer_->SetBounds(gfx::Size(10, 10)); |
parent_layer_->SetIsDrawable(true); |
root->AddChild(parent_layer_); |
- texture_layer_ = TextureLayer::CreateForMailbox(this); |
+ texture_layer_ = TextureLayer::CreateForMailbox(layer_settings(), this); |
texture_layer_->SetBounds(gfx::Size(10, 10)); |
texture_layer_->SetIsDrawable(true); |
parent_layer_->AddChild(texture_layer_); |
@@ -1364,7 +1365,7 @@ class TextureLayerReleaseResourcesBase |
LayerTreeTest::SetupTree(); |
scoped_refptr<TextureLayer> texture_layer = |
- TextureLayer::CreateForMailbox(this); |
+ TextureLayer::CreateForMailbox(layer_settings(), this); |
texture_layer->SetBounds(gfx::Size(10, 10)); |
texture_layer->SetIsDrawable(true); |
@@ -1428,10 +1429,10 @@ class TextureLayerWithMailboxMainThreadDeleted : public LayerTreeTest { |
void SetupTree() override { |
gfx::Size bounds(100, 100); |
- root_ = Layer::Create(); |
+ root_ = Layer::Create(layer_settings()); |
root_->SetBounds(bounds); |
- layer_ = TextureLayer::CreateForMailbox(nullptr); |
+ layer_ = TextureLayer::CreateForMailbox(layer_settings(), nullptr); |
layer_->SetIsDrawable(true); |
layer_->SetBounds(bounds); |
@@ -1497,10 +1498,10 @@ class TextureLayerWithMailboxImplThreadDeleted : public LayerTreeTest { |
void SetupTree() override { |
gfx::Size bounds(100, 100); |
- root_ = Layer::Create(); |
+ root_ = Layer::Create(layer_settings()); |
root_->SetBounds(bounds); |
- layer_ = TextureLayer::CreateForMailbox(nullptr); |
+ layer_ = TextureLayer::CreateForMailbox(layer_settings(), nullptr); |
layer_->SetIsDrawable(true); |
layer_->SetBounds(bounds); |