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

Unified Diff: third_party/WebKit/public/platform/WebMediaPlayer.h

Issue 1315323006: webgl: optimize webgl.texSubImage2D(video) path. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge Blink change to here. Unify full copy and sub copy path using struct. 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/public/platform/WebMediaPlayer.h
diff --git a/third_party/WebKit/public/platform/WebMediaPlayer.h b/third_party/WebKit/public/platform/WebMediaPlayer.h
index 31d6e5bd7e81f90c207f54c9253c8932870214a1..72c15419c27abd8dc9593e909481f5482217115d 100644
--- a/third_party/WebKit/public/platform/WebMediaPlayer.h
+++ b/third_party/WebKit/public/platform/WebMediaPlayer.h
@@ -164,17 +164,24 @@ public:
virtual void paint(WebCanvas*, const WebRect&, unsigned char alpha, SkXfermode::Mode) = 0;
- // TODO(dshwang): remove non-|target| version. crbug.com/349871
- virtual bool copyVideoTextureToPlatformTexture(WebGraphicsContext3D*, unsigned texture, unsigned internalFormat, unsigned type, bool premultiplyAlpha, bool flipY) { return false; }
-
// Do a GPU-GPU textures copy. If the copy is impossible or fails, it returns false.
- virtual bool copyVideoTextureToPlatformTexture(WebGraphicsContext3D*, unsigned target,
- unsigned texture, unsigned internalFormat, unsigned type, int level,
- bool premultiplyAlpha, bool flipY) { return false; }
- // Copy sub video frame texture to |texture|. If the copy is impossible or fails, it returns false.
- virtual bool copyVideoSubTextureToPlatformTexture(WebGraphicsContext3D*, unsigned target,
- unsigned texture, int level, int xoffset, int yoffset, bool premultiplyAlpha,
- bool flipY) { return false; }
+ // Copy the video frame texture to full texture or sub texture depending on |copyType|.
+ // If FullCopy, |xoffset| and |yoffset| must be 0.
+ // If SubCopy, |internalFormat| and |type| must be GL_FALSE.
+ struct CopyVideoTextureParams {
+ enum CopyType { FullCopy, SubCopy };
+ CopyType copyType;
+ unsigned target;
+ unsigned texture;
+ unsigned internalFormat;
+ unsigned type;
+ int level;
+ int xoffset;
+ int yoffset;
+ bool premultiplyAlpha;
+ bool flipY;
+ };
+ virtual bool copyVideoTextureToPlatformTexture(WebGraphicsContext3D*, const CopyVideoTextureParams&) = 0;
virtual WebAudioSourceProvider* audioSourceProvider() { return nullptr; }

Powered by Google App Engine
This is Rietveld 408576698