| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/texture_layer.h" | 5 #include "cc/layers/texture_layer.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "cc/base/thread.h" | 10 #include "cc/base/thread.h" |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 root_->SetAnchorPoint(gfx::PointF()); | 294 root_->SetAnchorPoint(gfx::PointF()); |
| 295 root_->SetBounds(bounds); | 295 root_->SetBounds(bounds); |
| 296 | 296 |
| 297 layer_ = TextureLayer::CreateForMailbox(); | 297 layer_ = TextureLayer::CreateForMailbox(); |
| 298 layer_->SetIsDrawable(true); | 298 layer_->SetIsDrawable(true); |
| 299 layer_->SetAnchorPoint(gfx::PointF()); | 299 layer_->SetAnchorPoint(gfx::PointF()); |
| 300 layer_->SetBounds(bounds); | 300 layer_->SetBounds(bounds); |
| 301 | 301 |
| 302 root_->AddChild(layer_); | 302 root_->AddChild(layer_); |
| 303 layer_tree_host()->SetRootLayer(root_); | 303 layer_tree_host()->SetRootLayer(root_); |
| 304 layer_tree_host()->SetViewportSize(bounds, bounds); | 304 layer_tree_host()->SetViewportSize(bounds); |
| 305 SetMailbox('1'); | 305 SetMailbox('1'); |
| 306 EXPECT_EQ(0, callback_count_); | 306 EXPECT_EQ(0, callback_count_); |
| 307 | 307 |
| 308 // Case #1: change mailbox before the commit. The old mailbox should be | 308 // Case #1: change mailbox before the commit. The old mailbox should be |
| 309 // released immediately. | 309 // released immediately. |
| 310 SetMailbox('2'); | 310 SetMailbox('2'); |
| 311 EXPECT_EQ(1, callback_count_); | 311 EXPECT_EQ(1, callback_count_); |
| 312 PostSetNeedsCommitToMainThread(); | 312 PostSetNeedsCommitToMainThread(); |
| 313 } | 313 } |
| 314 | 314 |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 581 | 581 |
| 582 // Used on either thread, protected by lock_. | 582 // Used on either thread, protected by lock_. |
| 583 base::Lock lock_; | 583 base::Lock lock_; |
| 584 unsigned expected_used_textures_on_commit_; | 584 unsigned expected_used_textures_on_commit_; |
| 585 }; | 585 }; |
| 586 | 586 |
| 587 SINGLE_AND_MULTI_THREAD_TEST_F(TextureLayerClientTest); | 587 SINGLE_AND_MULTI_THREAD_TEST_F(TextureLayerClientTest); |
| 588 | 588 |
| 589 } // namespace | 589 } // namespace |
| 590 } // namespace cc | 590 } // namespace cc |
| OLD | NEW |