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

Unified Diff: content/renderer/media/android/webmediaplayer_android.cc

Issue 1418513016: 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
« no previous file with comments | « content/renderer/media/android/webmediaplayer_android.h ('k') | content/renderer/media/webmediaplayer_ms.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/android/webmediaplayer_android.cc
diff --git a/content/renderer/media/android/webmediaplayer_android.cc b/content/renderer/media/android/webmediaplayer_android.cc
index 69ec1a7c2a13991ceb884c0790df8f8350d1593c..4e6db8694bfc0730f3b2e3cf265ee2ca9dc854e1 100644
--- a/content/renderer/media/android/webmediaplayer_android.cc
+++ b/content/renderer/media/android/webmediaplayer_android.cc
@@ -635,11 +635,8 @@
unsigned textureId = static_cast<unsigned>(
(bitmap_.getTexture())->getTextureHandle());
- if (!copyVideoTextureToPlatformTexture(
- context3D,
- CopyVideoTextureParams(CopyVideoTextureParams::FullCopy,
- GL_TEXTURE_2D, textureId, GL_RGBA,
- GL_UNSIGNED_BYTE, 0, 0, 0, true, false))) {
+ if (!copyVideoTextureToPlatformTexture(context3D, textureId,
+ GL_RGBA, GL_UNSIGNED_BYTE, true, false)) {
return;
}
@@ -663,12 +660,12 @@
bool WebMediaPlayerAndroid::copyVideoTextureToPlatformTexture(
blink::WebGraphicsContext3D* web_graphics_context,
- const CopyVideoTextureParams& params) {
- DCHECK(main_thread_checker_.CalledOnValidThread());
- DCHECK((params.copyType == CopyVideoTextureParams::FullCopy &&
- !params.xoffset && !params.yoffset) ||
- (params.copyType == CopyVideoTextureParams::SubCopy &&
- !params.internalFormat && !params.type));
+ unsigned int texture,
+ unsigned int internal_format,
+ unsigned int type,
+ bool premultiply_alpha,
+ bool flip_y) {
+ DCHECK(main_thread_checker_.CalledOnValidThread());
// Don't allow clients to copy an encrypted video frame.
if (needs_external_surface_)
return false;
@@ -699,17 +696,9 @@
// value down to get the expected result.
// flip_y==true means to reverse the video orientation while
// flip_y==false means to keep the intrinsic orientation.
- if (params.copyType == CopyVideoTextureParams::FullCopy) {
- web_graphics_context->copyTextureCHROMIUM(
- params.target, src_texture, params.texture, params.internalFormat,
- params.type, params.flipY, params.premultiplyAlpha, false);
- } else {
- web_graphics_context->copySubTextureCHROMIUM(
- params.target, src_texture, params.texture, params.xoffset,
- params.yoffset, 0, 0, video_frame->natural_size().width(),
- video_frame->natural_size().height(), params.flipY,
- params.premultiplyAlpha, false);
- }
+ web_graphics_context->copyTextureCHROMIUM(
+ GL_TEXTURE_2D, src_texture, texture, internal_format, type,
+ flip_y, premultiply_alpha, false);
web_graphics_context->deleteTexture(src_texture);
web_graphics_context->flush();
« no previous file with comments | « content/renderer/media/android/webmediaplayer_android.h ('k') | content/renderer/media/webmediaplayer_ms.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698