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

Unified Diff: media/renderers/skcanvas_video_renderer.h

Issue 2127053004: Optimize webgl texImage2D from YUV video textures. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@skianocopy
Patch Set: remove unnecessary change Created 4 years, 5 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.cc ('k') | media/renderers/skcanvas_video_renderer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/renderers/skcanvas_video_renderer.h
diff --git a/media/renderers/skcanvas_video_renderer.h b/media/renderers/skcanvas_video_renderer.h
index 3bd2f13929d84d11133154a2fea85881b62a4d0a..ff2a9195db5d7dc22fe4b44526642c27f735d119 100644
--- a/media/renderers/skcanvas_video_renderer.h
+++ b/media/renderers/skcanvas_video_renderer.h
@@ -78,6 +78,22 @@ class MEDIA_EXPORT SkCanvasVideoRenderer {
bool premultiply_alpha,
bool flip_y);
+ // Copy the contents of texture of |video_frame| to texture |texture| in
+ // context |destination_gl|.
+ // |level|, |internal_format|, |type| specify target texture |texture|.
+ // The format of |video_frame| must be VideoFrame::NATIVE_TEXTURE.
+ // |context_3d| has a GrContext that may be used during the copy.
+ // Returns true on success.
+ bool CopyVideoFrameTexturesToGLTexture(
+ const Context3D& context_3d,
+ gpu::gles2::GLES2Interface* destination_gl,
+ const scoped_refptr<VideoFrame>& video_frame,
+ unsigned int texture,
+ unsigned int internal_format,
+ unsigned int type,
+ bool premultiply_alpha,
+ bool flip_y);
+
// In general, We hold the most recently painted frame to increase the
// performance for the case that the same frame needs to be painted
// repeatedly. Call this function if you are sure the most recent frame will
@@ -85,6 +101,11 @@ class MEDIA_EXPORT SkCanvasVideoRenderer {
void ResetCache();
private:
+ // Update the cache holding the most-recently-painted frame. Returns false
+ // if the image couldn't be updated.
+ bool UpdateLastImage(const scoped_refptr<VideoFrame>& video_frame,
+ const Context3D& context_3d);
+
// Last image used to draw to the canvas.
sk_sp<SkImage> last_image_;
// Timestamp of the videoframe used to generate |last_image_|.
« no previous file with comments | « media/blink/webmediaplayer_impl.cc ('k') | media/renderers/skcanvas_video_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698