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

Unified Diff: Source/core/html/HTMLVideoElement.cpp

Issue 1284603003: WebGL: optimize webgl.texSubImage2D(video) path. (Blink side) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase to ToT Created 5 years, 3 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/core/html/HTMLVideoElement.h ('k') | Source/modules/webgl/WebGLRenderingContextBase.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLVideoElement.cpp
diff --git a/Source/core/html/HTMLVideoElement.cpp b/Source/core/html/HTMLVideoElement.cpp
index e64a10fd0aa63fa70bd7c1a0daedc0f29a5d553a..32be735be660d39aef8bea234be034e3466b1d8b 100644
--- a/Source/core/html/HTMLVideoElement.cpp
+++ b/Source/core/html/HTMLVideoElement.cpp
@@ -206,13 +206,25 @@ void HTMLVideoElement::paintCurrentFrame(SkCanvas* canvas, const IntRect& destRe
webMediaPlayer()->paint(canvas, destRect, paint ? paint->getAlpha() : 0xFF, mode);
}
-bool HTMLVideoElement::copyVideoTextureToPlatformTexture(WebGraphicsContext3D* context, Platform3DObject texture, GLenum internalFormat, GLenum type, bool premultiplyAlpha, bool flipY)
+bool HTMLVideoElement::copyVideoTextureToPlatformTexture(WebGraphicsContext3D* context, GLenum target,
+ Platform3DObject texture, GLenum internalFormat, GLenum type, GLint level, bool premultiplyAlpha, bool flipY)
{
if (!webMediaPlayer())
return false;
- ASSERT(Extensions3DUtil::canUseCopyTextureCHROMIUM(GL_TEXTURE_2D, internalFormat, type, 0));
- return webMediaPlayer()->copyVideoTextureToPlatformTexture(context, texture, internalFormat, type, premultiplyAlpha, flipY);
+ ASSERT(Extensions3DUtil::canUseCopyTextureCHROMIUM(target, internalFormat, type, level));
+ return webMediaPlayer()->copyVideoTextureToPlatformTexture(context, target, texture, internalFormat, type, level, premultiplyAlpha, flipY);
+}
+
+bool HTMLVideoElement::copyVideoSubTextureToPlatformTexture(WebGraphicsContext3D* context, GLenum target,
+ Platform3DObject texture, GLint level, GLint xoffset, GLint yoffset, bool premultiplyAlpha, bool flipY)
+{
+ if (!webMediaPlayer())
+ return false;
+
+ ASSERT(Extensions3DUtil::canUseCopyTextureCHROMIUM(target, GL_RGBA, GL_UNSIGNED_BYTE, level));
+ return webMediaPlayer()->copyVideoSubTextureToPlatformTexture(context, target, texture, level,
+ xoffset, yoffset, premultiplyAlpha, flipY);
}
bool HTMLVideoElement::hasAvailableVideoFrame() const
« no previous file with comments | « Source/core/html/HTMLVideoElement.h ('k') | Source/modules/webgl/WebGLRenderingContextBase.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698