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

Unified Diff: media/blink/webmediaplayer_impl.cc

Issue 1413833006: Reland of "webgl: optimize webgl.texSubImage2D(video) path." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add TODO comments 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
« no previous file with comments | « media/blink/webmediaplayer_impl.h ('k') | media/renderers/skcanvas_video_renderer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/blink/webmediaplayer_impl.cc
diff --git a/media/blink/webmediaplayer_impl.cc b/media/blink/webmediaplayer_impl.cc
index 5be9452d38f572d1cd0acb5b9da0f1a7499771ce..ff25e22913d34e80798c66211e49631b9f604a3c 100644
--- a/media/blink/webmediaplayer_impl.cc
+++ b/media/blink/webmediaplayer_impl.cc
@@ -652,12 +652,12 @@ unsigned WebMediaPlayerImpl::videoDecodedByteCount() const {
bool WebMediaPlayerImpl::copyVideoTextureToPlatformTexture(
blink::WebGraphicsContext3D* web_graphics_context,
- unsigned int texture,
- unsigned int internal_format,
- unsigned int type,
- bool premultiply_alpha,
- bool flip_y) {
+ const CopyVideoTextureParams& params) {
TRACE_EVENT0("media", "WebMediaPlayerImpl:copyVideoTextureToPlatformTexture");
+ DCHECK((params.copyType == CopyVideoTextureParams::FullCopy &&
+ !params.xoffset && !params.yoffset) ||
+ (params.copyType == CopyVideoTextureParams::SubCopy &&
+ !params.internalFormat && !params.type));
scoped_refptr<VideoFrame> video_frame = GetCurrentFrameFromCompositor();
@@ -671,9 +671,15 @@ bool WebMediaPlayerImpl::copyVideoTextureToPlatformTexture(
gpu::gles2::GLES2Interface* gl =
static_cast<gpu_blink::WebGraphicsContext3DImpl*>(web_graphics_context)
->GetGLInterface();
+ typedef SkCanvasVideoRenderer::CopyFrameSingleTextureParams CopyParams;
SkCanvasVideoRenderer::CopyVideoFrameSingleTextureToGLTexture(
- gl, video_frame.get(), texture, internal_format, type, premultiply_alpha,
- flip_y);
+ gl, video_frame.get(),
+ CopyParams(params.copyType == CopyVideoTextureParams::FullCopy
+ ? CopyParams::FullCopy
+ : CopyParams::SubCopy,
+ params.target, params.texture, params.internalFormat,
+ params.type, params.level, params.xoffset, params.yoffset,
+ params.premultiplyAlpha, params.flipY));
return true;
}
« no previous file with comments | « media/blink/webmediaplayer_impl.h ('k') | media/renderers/skcanvas_video_renderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698