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 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 { | 286 { |
287 } | 287 } |
288 | 288 |
289 // Make sure callback is received on main and doesn't block the impl thread. | 289 // Make sure callback is received on main and doesn't block the impl thread. |
290 void releaseCallback(unsigned syncPoint) { | 290 void releaseCallback(unsigned syncPoint) { |
291 EXPECT_EQ(true, proxy()->isMainThread()); | 291 EXPECT_EQ(true, proxy()->isMainThread()); |
292 ++m_callbackCount; | 292 ++m_callbackCount; |
293 } | 293 } |
294 | 294 |
295 void setMailbox(char mailbox_char) { | 295 void setMailbox(char mailbox_char) { |
296 gpu::Mailbox name; | |
297 memset(name.name, mailbox_char, sizeof(name.name)); | |
298 TextureMailbox mailbox( | 296 TextureMailbox mailbox( |
299 name, | 297 std::string(64, mailbox_char), |
300 base::Bind( | 298 base::Bind( |
301 &TextureLayerImplWithMailboxThreadedCallback::releaseCallback, | 299 &TextureLayerImplWithMailboxThreadedCallback::releaseCallback, |
302 base::Unretained(this))); | 300 base::Unretained(this))); |
303 m_layer->setTextureMailbox(mailbox); | 301 m_layer->setTextureMailbox(mailbox); |
304 } | 302 } |
305 | 303 |
306 virtual void beginTest() OVERRIDE | 304 virtual void beginTest() OVERRIDE |
307 { | 305 { |
308 gfx::Size bounds(100, 100); | 306 gfx::Size bounds(100, 100); |
309 m_root = Layer::create(); | 307 m_root = Layer::create(); |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 EXPECT_CALL(m_testData.m_mockCallback, Release(_, _)).Times(0); | 486 EXPECT_CALL(m_testData.m_mockCallback, Release(_, _)).Times(0); |
489 provider->DeleteResource(id); | 487 provider->DeleteResource(id); |
490 Mock::VerifyAndClearExpectations(&m_testData.m_mockCallback); | 488 Mock::VerifyAndClearExpectations(&m_testData.m_mockCallback); |
491 EXPECT_CALL(m_testData.m_mockCallback, | 489 EXPECT_CALL(m_testData.m_mockCallback, |
492 Release(m_testData.m_mailboxName1, _)).Times(1); | 490 Release(m_testData.m_mailboxName1, _)).Times(1); |
493 provider->ReceiveFromParent(list); | 491 provider->ReceiveFromParent(list); |
494 } | 492 } |
495 | 493 |
496 } // namespace | 494 } // namespace |
497 } // namespace cc | 495 } // namespace cc |
OLD | NEW |