Chromium Code Reviews| 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 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 506 Canvas2DLayerManager::get().layerDidDraw(this); | 506 Canvas2DLayerManager::get().layerDidDraw(this); |
| 507 } | 507 } |
| 508 | 508 |
| 509 void Canvas2DLayerBridge::finalizeFrame(const FloatRect &dirtyRect) | 509 void Canvas2DLayerBridge::finalizeFrame(const FloatRect &dirtyRect) |
| 510 { | 510 { |
| 511 ASSERT(!m_destructionInProgress); | 511 ASSERT(!m_destructionInProgress); |
| 512 m_layer->layer()->invalidateRect(enclosingIntRect(dirtyRect)); | 512 m_layer->layer()->invalidateRect(enclosingIntRect(dirtyRect)); |
| 513 m_didRecordDrawCommand = true; | 513 m_didRecordDrawCommand = true; |
| 514 } | 514 } |
| 515 | 515 |
| 516 Platform3DObject Canvas2DLayerBridge::getBackingTexture() | 516 PassRefPtr<SkImage> Canvas2DLayerBridge::getBackingTextureImage() |
| 517 { | 517 { |
| 518 ASSERT(!m_destructionInProgress); | |
| 519 if (!checkSurfaceValid()) | 518 if (!checkSurfaceValid()) |
|
f(malita)
2015/06/18 16:33:00
This is the only place where getBackingTextureImag
Justin Novosad
2015/06/22 18:22:03
The check is necessary here, and does not make sen
| |
| 520 return 0; | 519 return nullptr; |
| 521 m_canvas->flush(); | 520 |
| 522 context()->flush(); | 521 context()->flush(); |
| 523 GrRenderTarget* renderTarget = m_canvas->getDevice()->accessRenderTarget(); | 522 |
| 524 if (renderTarget) { | 523 return adoptRef(m_canvas->newImageSnapshot()); |
| 525 return renderTarget->asTexture()->getTextureHandle(); | |
| 526 } | |
| 527 return 0; | |
| 528 } | 524 } |
| 529 | 525 |
| 530 PassRefPtr<SkImage> Canvas2DLayerBridge::newImageSnapshot() | 526 PassRefPtr<SkImage> Canvas2DLayerBridge::newImageSnapshot() |
| 531 { | 527 { |
| 532 return adoptRef(m_canvas->newImageSnapshot()); | 528 return adoptRef(m_canvas->newImageSnapshot()); |
| 533 } | 529 } |
| 534 | 530 |
| 535 Canvas2DLayerBridge::MailboxInfo::MailboxInfo(const MailboxInfo& other) { | 531 Canvas2DLayerBridge::MailboxInfo::MailboxInfo(const MailboxInfo& other) { |
| 536 memcpy(&m_mailbox, &other.m_mailbox, sizeof(m_mailbox)); | 532 memcpy(&m_mailbox, &other.m_mailbox, sizeof(m_mailbox)); |
| 537 m_image = other.m_image; | 533 m_image = other.m_image; |
| 538 m_parentLayerBridge = other.m_parentLayerBridge; | 534 m_parentLayerBridge = other.m_parentLayerBridge; |
| 539 } | 535 } |
| 540 | 536 |
| 541 } // namespace blink | 537 } // namespace blink |
| OLD | NEW |