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

Unified Diff: Source/WebCore/html/HTMLVideoElement.cpp

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/html/HTMLVideoElement.cpp
diff --git a/Source/WebCore/html/HTMLVideoElement.cpp b/Source/WebCore/html/HTMLVideoElement.cpp
index 02ec2c41fc2c6e32e470d811693d68bc2ac75e60..5fd1a0f4ab6bf6f46a50baaf6f70a11ef8d20d44 100644
--- a/Source/WebCore/html/HTMLVideoElement.cpp
+++ b/Source/WebCore/html/HTMLVideoElement.cpp
@@ -34,6 +34,7 @@
#include "Document.h"
#include "ExceptionCode.h"
#include "Frame.h"
+#include "GraphicsContext3D.h"
#include "HTMLImageLoader.h"
#include "HTMLNames.h"
#include "HTMLParserIdioms.h"
@@ -42,6 +43,7 @@
#include "RenderVideo.h"
#include "ScriptController.h"
#include "Settings.h"
+#include "SharedGraphicsContext3D.h"
namespace WebCore {
@@ -241,6 +243,14 @@ void HTMLVideoElement::paintCurrentFrameInContext(GraphicsContext* context, cons
return;
player->setVisible(true); // Make player visible or it won't draw.
+
+ // Go through the fast path trying to do a GPU-GPU texture copy without a readback to system memory if possible.
+ // Otherwise, it will fallback to the normal SW path.
+ RefPtr<GraphicsContext3D> context3D = SharedGraphicsContext3D::get();
+ if (context3D && player->copyVideoTextureToCanvas(context, context3D.get()))
scherkus (not reviewing) 2013/04/05 20:47:09 this seems strange there are other callers of pai
Ken Russell (switch to Gerrit) 2013/04/05 22:40:38 I'll be more blunt and say that there is no way th
hkuang 2013/04/09 17:46:10 Done.
hkuang 2013/04/09 17:46:10 Fix the naming issue when addressing Ken's comment
+ return;
+
+ // Normal pure SW path
player->paintCurrentFrameInContext(context, destRect);
}
« no previous file with comments | « no previous file | Source/WebCore/platform/graphics/MediaPlayer.h » ('j') | Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698