| 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 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 } | 532 } |
| 533 } | 533 } |
| 534 | 534 |
| 535 WebLayer* Canvas2DLayerBridge::layer() const | 535 WebLayer* Canvas2DLayerBridge::layer() const |
| 536 { | 536 { |
| 537 ASSERT(!m_destructionInProgress); | 537 ASSERT(!m_destructionInProgress); |
| 538 ASSERT(m_layer); | 538 ASSERT(m_layer); |
| 539 return m_layer->layer(); | 539 return m_layer->layer(); |
| 540 } | 540 } |
| 541 | 541 |
| 542 void Canvas2DLayerBridge::finalizeFrame(const FloatRect &dirtyRect) | 542 void Canvas2DLayerBridge::finalizeFrame() |
| 543 { | 543 { |
| 544 ASSERT(!m_destructionInProgress); | 544 ASSERT(!m_destructionInProgress); |
| 545 Canvas2DLayerManager::get().layerDidDraw(this); | 545 Canvas2DLayerManager::get().layerDidDraw(this); |
| 546 m_layer->layer()->invalidateRect(dirtyRect); | |
| 547 m_didRecordDrawCommand = true; | 546 m_didRecordDrawCommand = true; |
| 548 } | 547 } |
| 549 | 548 |
| 550 Platform3DObject Canvas2DLayerBridge::getBackingTexture() | 549 Platform3DObject Canvas2DLayerBridge::getBackingTexture() |
| 551 { | 550 { |
| 552 ASSERT(!m_destructionInProgress); | 551 ASSERT(!m_destructionInProgress); |
| 553 if (!checkSurfaceValid()) | 552 if (!checkSurfaceValid()) |
| 554 return 0; | 553 return 0; |
| 555 m_canvas->flush(); | 554 m_canvas->flush(); |
| 556 context()->flush(); | 555 context()->flush(); |
| 557 GrRenderTarget* renderTarget = m_canvas->getTopDevice()->accessRenderTarget(
); | 556 GrRenderTarget* renderTarget = m_canvas->getTopDevice()->accessRenderTarget(
); |
| 558 if (renderTarget) { | 557 if (renderTarget) { |
| 559 return renderTarget->asTexture()->getTextureHandle(); | 558 return renderTarget->asTexture()->getTextureHandle(); |
| 560 } | 559 } |
| 561 return 0; | 560 return 0; |
| 562 } | 561 } |
| 563 | 562 |
| 564 Canvas2DLayerBridge::MailboxInfo::MailboxInfo(const MailboxInfo& other) { | 563 Canvas2DLayerBridge::MailboxInfo::MailboxInfo(const MailboxInfo& other) { |
| 565 // This copy constructor should only be used for Vector reallocation | 564 // This copy constructor should only be used for Vector reallocation |
| 566 // Assuming 'other' is to be destroyed, we transfer m_image and | 565 // Assuming 'other' is to be destroyed, we transfer m_image and |
| 567 // m_parentLayerBridge ownership rather than do a refcount dance. | 566 // m_parentLayerBridge ownership rather than do a refcount dance. |
| 568 memcpy(&m_mailbox, &other.m_mailbox, sizeof(m_mailbox)); | 567 memcpy(&m_mailbox, &other.m_mailbox, sizeof(m_mailbox)); |
| 569 m_image = const_cast<MailboxInfo*>(&other)->m_image.release(); | 568 m_image = const_cast<MailboxInfo*>(&other)->m_image.release(); |
| 570 m_parentLayerBridge = const_cast<MailboxInfo*>(&other)->m_parentLayerBridge.
release(); | 569 m_parentLayerBridge = const_cast<MailboxInfo*>(&other)->m_parentLayerBridge.
release(); |
| 571 m_status = other.m_status; | 570 m_status = other.m_status; |
| 572 } | 571 } |
| 573 | 572 |
| 574 } // namespace blink | 573 } // namespace blink |
| OLD | NEW |