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

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

Issue 1195963006: Removing getBackingTextureImage from ImageBufferSurface (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix unit test 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/Canvas2DLayerBridgeTest.cpp ('k') | Source/platform/graphics/ImageBufferSurface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/ImageBuffer.cpp
diff --git a/Source/platform/graphics/ImageBuffer.cpp b/Source/platform/graphics/ImageBuffer.cpp
index fc8b628f5296cccf1cf002047157c4fc571542a4..eca83d0a6cce9cb70e8da014c14cd6487c7c04b8 100644
--- a/Source/platform/graphics/ImageBuffer.cpp
+++ b/Source/platform/graphics/ImageBuffer.cpp
@@ -178,11 +178,11 @@ bool ImageBuffer::copyToPlatformTexture(WebGraphicsContext3D* context, Platform3
if (!Extensions3DUtil::canUseCopyTextureCHROMIUM(GL_TEXTURE_2D, internalFormat, destType, level))
return false;
- RefPtr<const SkImage> textureImage = m_surface->getBackingTextureImage();
+ RefPtr<const SkImage> textureImage = m_surface->newImageSnapshot();
if (!textureImage)
return false;
- ASSERT(textureImage->isTextureBacked());
+ ASSERT(textureImage->isTextureBacked()); // isAccelerated() check above should guarantee this
// Get the texture ID, flushing pending operations if needed.
Platform3DObject textureId = textureImage->getTextureHandle(true);
if (!textureId)
@@ -230,13 +230,13 @@ bool ImageBuffer::copyToPlatformTexture(WebGraphicsContext3D* context, Platform3
bool ImageBuffer::copyRenderingResultsFromDrawingBuffer(DrawingBuffer* drawingBuffer, SourceDrawingBuffer sourceBuffer)
{
- if (!drawingBuffer)
+ if (!drawingBuffer || !m_surface->isAccelerated())
return false;
OwnPtr<WebGraphicsContext3DProvider> provider = adoptPtr(Platform::current()->createSharedOffscreenGraphicsContext3DProvider());
if (!provider)
return false;
WebGraphicsContext3D* context3D = provider->context3d();
- RefPtr<SkImage> textureImage = m_surface->getBackingTextureImage();
+ RefPtr<SkImage> textureImage = m_surface->newImageSnapshot();
if (!context3D || !textureImage)
return false;
ASSERT(textureImage->isTextureBacked());
@@ -245,6 +245,8 @@ bool ImageBuffer::copyRenderingResultsFromDrawingBuffer(DrawingBuffer* drawingBu
if (!textureId)
return false;
+ context3D->flush();
+
m_surface->invalidateCachedBitmap();
bool result = drawingBuffer->copyToPlatformTexture(context3D, textureId, GL_RGBA,
GL_UNSIGNED_BYTE, 0, true, false, sourceBuffer);
« no previous file with comments | « Source/platform/graphics/Canvas2DLayerBridgeTest.cpp ('k') | Source/platform/graphics/ImageBufferSurface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698