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); |