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

Unified Diff: Source/platform/graphics/gpu/DrawingBuffer.cpp

Issue 309933004: Fix imageSourceURL() for WebGL elements. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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/DrawingBuffer.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/DrawingBuffer.cpp
diff --git a/Source/platform/graphics/gpu/DrawingBuffer.cpp b/Source/platform/graphics/gpu/DrawingBuffer.cpp
index 2ce8d6740f5969428a694da08ded3566827bda62..b4a63147cb5f8dce3d8b71410f12bb9e671709bd 100644
--- a/Source/platform/graphics/gpu/DrawingBuffer.cpp
+++ b/Source/platform/graphics/gpu/DrawingBuffer.cpp
@@ -429,10 +429,15 @@ bool DrawingBuffer::initialize(const IntSize& size)
return true;
}
-bool DrawingBuffer::copyToPlatformTexture(blink::WebGraphicsContext3D* context, Platform3DObject texture, GLenum internalFormat, GLenum destType, GLint level, bool premultiplyAlpha, bool flipY)
+bool DrawingBuffer::copyToPlatformTexture(blink::WebGraphicsContext3D* context, Platform3DObject texture, GLenum internalFormat, GLenum destType, GLint level, bool premultiplyAlpha, bool flipY, bool fromFrontBuffer)
{
if (!m_context->makeContextCurrent())
return false;
+
+ GLint textureId = m_colorBuffer.textureId;
+ if (fromFrontBuffer)
+ textureId = m_frontColorBuffer.textureId;
+
if (m_contentsChanged) {
if (m_multisampleMode != None) {
commit();
@@ -450,7 +455,7 @@ bool DrawingBuffer::copyToPlatformTexture(blink::WebGraphicsContext3D* context,
// Contexts may be in a different share group. We must transfer the texture through a mailbox first
RefPtr<MailboxInfo> bufferMailbox = adoptRef(new MailboxInfo());
m_context->genMailboxCHROMIUM(bufferMailbox->mailbox.name);
- m_context->bindTexture(GL_TEXTURE_2D, m_colorBuffer.textureId);
+ m_context->bindTexture(GL_TEXTURE_2D, textureId);
m_context->produceTextureCHROMIUM(GL_TEXTURE_2D, bufferMailbox->mailbox.name);
m_context->flush();
« no previous file with comments | « Source/platform/graphics/gpu/DrawingBuffer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698