OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
451 webContext->bindTexture(GL_TEXTURE_2D, 0); | 451 webContext->bindTexture(GL_TEXTURE_2D, 0); |
452 // Because we are changing the texture binding without going through skia, | 452 // Because we are changing the texture binding without going through skia, |
453 // we must dirty the context. | 453 // we must dirty the context. |
454 m_contextProvider->grContext()->resetContext(kTextureBinding_GrGLBackendStat
e); | 454 m_contextProvider->grContext()->resetContext(kTextureBinding_GrGLBackendStat
e); |
455 | 455 |
456 // set m_parentLayerBridge to make sure 'this' stays alive as long as it has | 456 // set m_parentLayerBridge to make sure 'this' stays alive as long as it has |
457 // live mailboxes | 457 // live mailboxes |
458 ASSERT(!mailboxInfo->m_parentLayerBridge); | 458 ASSERT(!mailboxInfo->m_parentLayerBridge); |
459 mailboxInfo->m_parentLayerBridge = this; | 459 mailboxInfo->m_parentLayerBridge = this; |
460 *outMailbox = mailboxInfo->m_mailbox; | 460 *outMailbox = mailboxInfo->m_mailbox; |
| 461 |
| 462 if (m_imageBuffer) |
| 463 m_imageBuffer->didPresent(); |
| 464 |
461 return true; | 465 return true; |
462 } | 466 } |
463 | 467 |
464 Canvas2DLayerBridge::MailboxInfo* Canvas2DLayerBridge::createMailboxInfo() { | 468 Canvas2DLayerBridge::MailboxInfo* Canvas2DLayerBridge::createMailboxInfo() { |
465 ASSERT(!m_destructionInProgress); | 469 ASSERT(!m_destructionInProgress); |
466 MailboxInfo* mailboxInfo; | 470 MailboxInfo* mailboxInfo; |
467 for (mailboxInfo = m_mailboxes.begin(); mailboxInfo < m_mailboxes.end(); mai
lboxInfo++) { | 471 for (mailboxInfo = m_mailboxes.begin(); mailboxInfo < m_mailboxes.end(); mai
lboxInfo++) { |
468 if (mailboxInfo->m_status == MailboxAvailable) { | 472 if (mailboxInfo->m_status == MailboxAvailable) { |
469 return mailboxInfo; | 473 return mailboxInfo; |
470 } | 474 } |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
544 Canvas2DLayerBridge::MailboxInfo::MailboxInfo(const MailboxInfo& other) { | 548 Canvas2DLayerBridge::MailboxInfo::MailboxInfo(const MailboxInfo& other) { |
545 // This copy constructor should only be used for Vector reallocation | 549 // This copy constructor should only be used for Vector reallocation |
546 // Assuming 'other' is to be destroyed, we transfer m_image ownership | 550 // Assuming 'other' is to be destroyed, we transfer m_image ownership |
547 // rather than do a refcount dance. | 551 // rather than do a refcount dance. |
548 memcpy(&m_mailbox, &other.m_mailbox, sizeof(m_mailbox)); | 552 memcpy(&m_mailbox, &other.m_mailbox, sizeof(m_mailbox)); |
549 m_image = const_cast<MailboxInfo*>(&other)->m_image.release(); | 553 m_image = const_cast<MailboxInfo*>(&other)->m_image.release(); |
550 m_status = other.m_status; | 554 m_status = other.m_status; |
551 } | 555 } |
552 | 556 |
553 } | 557 } |
OLD | NEW |