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)); |
296 TextureMailbox mailbox( | 298 TextureMailbox mailbox( |
297 std::string(64, mailbox_char), | 299 name, |
298 base::Bind( | 300 base::Bind( |
299 &TextureLayerImplWithMailboxThreadedCallback::releaseCallback, | 301 &TextureLayerImplWithMailboxThreadedCallback::releaseCallback, |
300 base::Unretained(this))); | 302 base::Unretained(this))); |
301 m_layer->setTextureMailbox(mailbox); | 303 m_layer->setTextureMailbox(mailbox); |
302 } | 304 } |
303 | 305 |
304 virtual void beginTest() OVERRIDE | 306 virtual void beginTest() OVERRIDE |
305 { | 307 { |
306 gfx::Size bounds(100, 100); | 308 gfx::Size bounds(100, 100); |
307 m_root = Layer::create(); | 309 m_root = Layer::create(); |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 EXPECT_CALL(m_testData.m_mockCallback, Release(_, _)).Times(0); | 488 EXPECT_CALL(m_testData.m_mockCallback, Release(_, _)).Times(0); |
487 provider->deleteResource(id); | 489 provider->deleteResource(id); |
488 Mock::VerifyAndClearExpectations(&m_testData.m_mockCallback); | 490 Mock::VerifyAndClearExpectations(&m_testData.m_mockCallback); |
489 EXPECT_CALL(m_testData.m_mockCallback, | 491 EXPECT_CALL(m_testData.m_mockCallback, |
490 Release(m_testData.m_mailboxName1, _)).Times(1); | 492 Release(m_testData.m_mailboxName1, _)).Times(1); |
491 provider->receiveFromParent(list); | 493 provider->receiveFromParent(list); |
492 } | 494 } |
493 | 495 |
494 } // namespace | 496 } // namespace |
495 } // namespace cc | 497 } // namespace cc |
OLD | NEW |