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

Unified Diff: Source/platform/graphics/gpu/AcceleratedImageBufferSurface.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
« no previous file with comments | « Source/platform/graphics/gpu/AcceleratedImageBufferSurface.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/gpu/AcceleratedImageBufferSurface.cpp
diff --git a/Source/platform/graphics/gpu/AcceleratedImageBufferSurface.cpp b/Source/platform/graphics/gpu/AcceleratedImageBufferSurface.cpp
index 1afc42b6296406bee31ff617ba81a2eabc6af477..a44fc98340361260fc306ecc0e16868a6e9b7de0 100644
--- a/Source/platform/graphics/gpu/AcceleratedImageBufferSurface.cpp
+++ b/Source/platform/graphics/gpu/AcceleratedImageBufferSurface.cpp
@@ -62,15 +62,11 @@ AcceleratedImageBufferSurface::AcceleratedImageBufferSurface(const IntSize& size
clear();
}
-Platform3DObject AcceleratedImageBufferSurface::getBackingTexture() const
+// This is a duplicate of newImageSnapshot(), but we need different entry points to
+// support Canvas2DLayerBridge's slightly divergent semantics.
reed1 2015/06/23 14:38:09 Lets document somewhere what those slightly diverg
+PassRefPtr<SkImage> AcceleratedImageBufferSurface::getBackingTextureImage() const
{
- // Before returning the texture, all drawing operations must be completed.
- m_surface->getCanvas()->flush();
- GrRenderTarget* renderTarget = m_surface->getCanvas()->getTopDevice()->accessRenderTarget();
- if (renderTarget) {
- return renderTarget->asTexture()->getTextureHandle();
- }
- return 0;
+ return adoptRef(m_surface->newImageSnapshot());
}
void AcceleratedImageBufferSurface::didModifyBackingTexture()
« no previous file with comments | « Source/platform/graphics/gpu/AcceleratedImageBufferSurface.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698