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

Unified Diff: media/renderers/skcanvas_video_renderer.h

Issue 2791813003: Fix broken draw/upload paths from videos to 2D canvas and WebGL. (Closed)
Patch Set: Rebased. Created 3 years, 9 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: media/renderers/skcanvas_video_renderer.h
diff --git a/media/renderers/skcanvas_video_renderer.h b/media/renderers/skcanvas_video_renderer.h
index 3831139c03cc49e8c1fbe1c687daa191921cb9eb..b5bca6dd52bae09f3d083ef93c70076eb49ae601 100644
--- a/media/renderers/skcanvas_video_renderer.h
+++ b/media/renderers/skcanvas_video_renderer.h
@@ -64,16 +64,33 @@ class MEDIA_EXPORT SkCanvasVideoRenderer {
void* rgb_pixels,
size_t row_bytes);
+ // CopyTexture uses CopyTextureCHROMIUM internally; CopySubTexture
+ // uses CopySubTextureCHROMIUM. The two options are provided because
+ // this is on the performance-critical path, and CopyTextureCHROMIUM
+ // is more efficient in the situation where new textures are being
+ // allocated often. (This currently happens on macOS where the
+ // source textures are rectangular.)
+ enum SingleFrameCopyMode {
+ SingleFrameCopyTexture,
+ SingleFrameCopySubTexture
+ };
+
// Copy the contents of texture of |video_frame| to texture |texture|.
// |level|, |internal_format|, |type| specify target texture |texture|.
// The format of |video_frame| must be VideoFrame::NATIVE_TEXTURE.
- // Assumes |texture| has already been allocated with the appropriate
- // size and a compatible format, internal format and type; this is
- // effectively a "TexSubImage" operation.
+ //
+ // |internal_format| and |type| are used if |mode| is
+ // SingleFrameCopyTexture. Otherwise assumes |texture| has already
+ // been allocated with the appropriate size and a compatible format,
+ // internal format and type, and is effectively a "TexSubImage"
+ // operation.
static void CopyVideoFrameSingleTextureToGLTexture(
gpu::gles2::GLES2Interface* gl,
VideoFrame* video_frame,
+ SingleFrameCopyMode mode,
unsigned int texture,
+ unsigned int internal_format,
+ unsigned int type,
bool premultiply_alpha,
bool flip_y);
« no previous file with comments | « no previous file | media/renderers/skcanvas_video_renderer.cc » ('j') | media/renderers/skcanvas_video_renderer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698