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

Unified Diff: Source/WebCore/platform/graphics/MediaPlayer.h

Issue 13685002: Enable video painting on Canvas for Chrome on Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 8 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: Source/WebCore/platform/graphics/MediaPlayer.h
diff --git a/Source/WebCore/platform/graphics/MediaPlayer.h b/Source/WebCore/platform/graphics/MediaPlayer.h
index 86ea40278c2456dfd391d544dfdc128545e73ef7..d9023b96e543ef2928a19381457e7a8d870bdaa6 100644
--- a/Source/WebCore/platform/graphics/MediaPlayer.h
+++ b/Source/WebCore/platform/graphics/MediaPlayer.h
@@ -334,6 +334,17 @@ public:
void paint(GraphicsContext*, const IntRect&);
void paintCurrentFrameInContext(GraphicsContext*, const IntRect&);
+ // copyVideoTextureToCanvas() is a hardware accelerated version of paintCurrentFrameInContext when video is hardware decoded.
+ // It is used to do a GPU-GPU textures copy without readback to system memory if possible. When the Canvas is hardware accelerated, it
+ // will copy the video texture to the canvas texture. But when the Canvas is software based, it will still readback the video
+ // texture to system memory, then draw it onto the Canvas.
+
+ // Each platform port can have its own implementation on this function. The default implementation for it is a single "return false" in MediaPlayerPrivate.h.
+ // In chromium, the implementation is based on GL_CHROMIUM_copy_texture extension which is documented at
+ // http://src.chromium.org/viewvc/chrome/trunk/src/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_copy_texture.txt and implemented at
+ // http://src.chromium.org/viewvc/chrome/trunk/src/gpu/command_buffer/service/gles2_cmd_copy_texture_chromium.cc via shaders.
+ bool copyVideoTextureToCanvas(GraphicsContext*, GraphicsContext3D*);
+
// copyVideoTextureToPlatformTexture() is used to do the GPU-GPU textures copy without a readback to system memory.
// The first five parameters denote the corresponding GraphicsContext, destination texture, requested level, requested type and the required internalFormat for destination texture.
// The last two parameters premultiplyAlpha and flipY denote whether addtional premultiplyAlpha and flip operation are required during the copy.

Powered by Google App Engine
This is Rietveld 408576698