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

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

Issue 1420843005: Revert of "webgl: optimize webgl.texSubImage2D(video) path." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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: third_party/WebKit/Source/platform/graphics/ImageBuffer.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/ImageBuffer.cpp b/third_party/WebKit/Source/platform/graphics/ImageBuffer.cpp
index 042495b9aff908c24cf009a27b54cf6223d81624..51465ee01b9e4dae52de954ec294657ae3c1f78c 100644
--- a/third_party/WebKit/Source/platform/graphics/ImageBuffer.cpp
+++ b/third_party/WebKit/Source/platform/graphics/ImageBuffer.cpp
@@ -178,25 +178,9 @@
return m_surface->layer();
}
-bool ImageBuffer::copyToPlatformTexture(WebGraphicsContext3D* context, GLenum target, Platform3DObject texture,
- GLenum internalFormat, GLenum destType, GLint level, bool premultiplyAlpha, bool flipY)
-{
- return copyToPlatformTextureInternal(true, context, target, texture, internalFormat,
- destType, level, 0, 0, 0, 0, premultiplyAlpha, flipY);
-}
-
-bool ImageBuffer::copySubToPlatformTexture(WebGraphicsContext3D* context, GLenum target, Platform3DObject texture,
- GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, bool premultiplyAlpha, bool flipY)
-{
- return copyToPlatformTextureInternal(false, context, target, texture, GL_FALSE, GL_FALSE, level,
- xoffset, yoffset, width, height, premultiplyAlpha, flipY);
-}
-
-bool ImageBuffer::copyToPlatformTextureInternal(bool isFullCopy, WebGraphicsContext3D* context, GLenum target,
- Platform3DObject texture, GLenum internalFormat, GLenum destType, GLint level, GLint xoffset, GLint yoffset,
- GLsizei width, GLsizei height, bool premultiplyAlpha, bool flipY)
-{
- if (!Extensions3DUtil::canUseCopyTextureCHROMIUM(target, internalFormat, destType, level))
+bool ImageBuffer::copyToPlatformTexture(WebGraphicsContext3D* context, Platform3DObject texture, GLenum internalFormat, GLenum destType, GLint level, bool premultiplyAlpha, bool flipY)
+{
+ if (!Extensions3DUtil::canUseCopyTextureCHROMIUM(GL_TEXTURE_2D, internalFormat, destType, level))
return false;
if (!isSurfaceValid())
@@ -235,16 +219,9 @@
context->waitSyncPoint(mailbox->syncPoint);
Platform3DObject sourceTexture = context->createAndConsumeTextureCHROMIUM(GL_TEXTURE_2D, mailbox->name);
- WGC3Dboolean glFlipY = flipY ? GL_FALSE : GL_TRUE;
- WGC3Dboolean glPremultiplyAlpha = premultiplyAlpha ? GL_FALSE : GL_TRUE;
-
// The canvas is stored in a premultiplied format, so unpremultiply if necessary.
// The canvas is stored in an inverted position, so the flip semantics are reversed.
- if (isFullCopy) {
- context->copyTextureCHROMIUM(target, sourceTexture, texture, internalFormat, destType, glFlipY, GL_FALSE, glPremultiplyAlpha);
- } else {
- context->copySubTextureCHROMIUM(target, sourceTexture, texture, xoffset, yoffset, 0, 0, width, height, glFlipY, GL_FALSE, glPremultiplyAlpha);
- }
+ context->copyTextureCHROMIUM(GL_TEXTURE_2D, sourceTexture, texture, internalFormat, destType, flipY ? GL_FALSE : GL_TRUE, GL_FALSE, premultiplyAlpha ? GL_FALSE : GL_TRUE);
context->deleteTexture(sourceTexture);

Powered by Google App Engine
This is Rietveld 408576698