Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2388)

Unified Diff: Source/platform/graphics/Canvas2DLayerBridge.cpp

Issue 1195513002: Use SkImage snapshots for ImageBufferSurface texture access (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: review comments Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/platform/graphics/Canvas2DLayerBridge.cpp
diff --git a/Source/platform/graphics/Canvas2DLayerBridge.cpp b/Source/platform/graphics/Canvas2DLayerBridge.cpp
index a44254c41b5313410576d54207fc2ae432a9f873..1b2abc1ea9a423408b573c85161671c7816b1119 100644
--- a/Source/platform/graphics/Canvas2DLayerBridge.cpp
+++ b/Source/platform/graphics/Canvas2DLayerBridge.cpp
@@ -513,18 +513,14 @@ void Canvas2DLayerBridge::finalizeFrame(const FloatRect &dirtyRect)
m_didRecordDrawCommand = true;
}
-Platform3DObject Canvas2DLayerBridge::getBackingTexture()
+PassRefPtr<SkImage> Canvas2DLayerBridge::getBackingTextureImage()
{
- ASSERT(!m_destructionInProgress);
if (!checkSurfaceValid())
- return 0;
- m_canvas->flush();
+ return nullptr;
+
context()->flush();
- GrRenderTarget* renderTarget = m_canvas->getDevice()->accessRenderTarget();
- if (renderTarget) {
- return renderTarget->asTexture()->getTextureHandle();
- }
- return 0;
+
+ return adoptRef(m_canvas->newImageSnapshot());
}
PassRefPtr<SkImage> Canvas2DLayerBridge::newImageSnapshot()

Powered by Google App Engine
This is Rietveld 408576698