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

Unified Diff: third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp

Issue 2820823003: Revert "Fix the size of video textures uploaded to WebGL." (Closed)
Patch Set: Created 3 years, 8 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/modules/webgl/WebGLRenderingContextBase.cpp
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
index aa46ba2ab78e4cf79535fc251785f1ef0bb510ec..c594194d9bee47b8477b97352cd34c4314254aa9 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
+++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
@@ -5277,17 +5277,9 @@ void WebGLRenderingContextBase::texImageHelperHTMLVideoElement(
// Go through the fast path doing a GPU-GPU textures copy without a readback
// to system memory if possible. Otherwise, it will fall back to the normal
// SW path.
-
- // Note that neither
- // HTMLVideoElement::copyVideoTextureToPlatformTexture nor
- // ImageBuffer::copyToPlatformTexture allocate the destination texture
- // any more.
- texImage2DBase(target, level, internalformat, video->videoWidth(),
- video->videoHeight(), 0, format, type, nullptr);
-
- if (video->copyVideoTextureToPlatformTexture(contextGL(), texture->object(),
- m_unpackPremultiplyAlpha,
- m_unpackFlipY)) {
+ if (video->copyVideoTextureToPlatformTexture(
+ contextGL(), texture->object(), internalformat, type,
+ m_unpackPremultiplyAlpha, m_unpackFlipY)) {
return;
}
@@ -5311,6 +5303,11 @@ void WebGLRenderingContextBase::texImageHelperHTMLVideoElement(
// This is a straight GPU-GPU copy, any necessary color space conversion
// was handled in the paintCurrentFrameInContext() call.
+ // Note that copyToPlatformTexture no longer allocates the destination
+ // texture.
+ texImage2DBase(target, level, internalformat, video->videoWidth(),
+ video->videoHeight(), 0, format, type, nullptr);
+
if (imageBuffer->copyToPlatformTexture(
functionIDToSnapshotReason(functionID), contextGL(),
texture->object(), internalformat, type, level,
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLVideoElement.cpp ('k') | third_party/WebKit/public/platform/WebMediaPlayer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698