| 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/texture_layer.h" | 5 #include "cc/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/layer_tree_host.h" | 10 #include "cc/layer_tree_host.h" |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 : callback_count_(0), | 270 : callback_count_(0), |
| 271 commit_count_(0) {} | 271 commit_count_(0) {} |
| 272 | 272 |
| 273 // Make sure callback is received on main and doesn't block the impl thread. | 273 // Make sure callback is received on main and doesn't block the impl thread. |
| 274 void ReleaseCallback(unsigned sync_point) { | 274 void ReleaseCallback(unsigned sync_point) { |
| 275 EXPECT_EQ(true, proxy()->IsMainThread()); | 275 EXPECT_EQ(true, proxy()->IsMainThread()); |
| 276 ++callback_count_; | 276 ++callback_count_; |
| 277 } | 277 } |
| 278 | 278 |
| 279 void SetMailbox(char mailbox_char) { | 279 void SetMailbox(char mailbox_char) { |
| 280 gpu::Mailbox name; |
| 281 memset(name.name, mailbox_char, sizeof(name.name)); |
| 280 TextureMailbox mailbox( | 282 TextureMailbox mailbox( |
| 281 std::string(64, mailbox_char), | 283 name, |
| 282 base::Bind( | 284 base::Bind( |
| 283 &TextureLayerImplWithMailboxThreadedCallback::ReleaseCallback, | 285 &TextureLayerImplWithMailboxThreadedCallback::ReleaseCallback, |
| 284 base::Unretained(this))); | 286 base::Unretained(this))); |
| 285 layer_->SetTextureMailbox(mailbox); | 287 layer_->SetTextureMailbox(mailbox); |
| 286 } | 288 } |
| 287 | 289 |
| 288 virtual void beginTest() OVERRIDE { | 290 virtual void beginTest() OVERRIDE { |
| 289 gfx::Size bounds(100, 100); | 291 gfx::Size bounds(100, 100); |
| 290 root_ = Layer::Create(); | 292 root_ = Layer::Create(); |
| 291 root_->SetAnchorPoint(gfx::PointF()); | 293 root_->SetAnchorPoint(gfx::PointF()); |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 462 EXPECT_CALL(test_data_.mock_callback_, Release(_, _)).Times(0); | 464 EXPECT_CALL(test_data_.mock_callback_, Release(_, _)).Times(0); |
| 463 provider->DeleteResource(id); | 465 provider->DeleteResource(id); |
| 464 Mock::VerifyAndClearExpectations(&test_data_.mock_callback_); | 466 Mock::VerifyAndClearExpectations(&test_data_.mock_callback_); |
| 465 EXPECT_CALL(test_data_.mock_callback_, Release(test_data_.mailbox_name1_, _)) | 467 EXPECT_CALL(test_data_.mock_callback_, Release(test_data_.mailbox_name1_, _)) |
| 466 .Times(1); | 468 .Times(1); |
| 467 provider->ReceiveFromParent(list); | 469 provider->ReceiveFromParent(list); |
| 468 } | 470 } |
| 469 | 471 |
| 470 } // namespace | 472 } // namespace |
| 471 } // namespace cc | 473 } // namespace cc |
| OLD | NEW |