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

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

Issue 430793002: Eliminate MediaPlayer abstraction(paint APIs) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed review comments Created 6 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 | « Source/core/html/HTMLVideoElement.h ('k') | Source/core/html/canvas/WebGLRenderingContextBase.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLVideoElement.cpp
diff --git a/Source/core/html/HTMLVideoElement.cpp b/Source/core/html/HTMLVideoElement.cpp
index 0e3fdaf353a24c4d6bae71b32974a06800e4b12d..11fc26286364b76f8c09e42c6dc23499f3a08b8a 100644
--- a/Source/core/html/HTMLVideoElement.cpp
+++ b/Source/core/html/HTMLVideoElement.cpp
@@ -40,6 +40,10 @@
#include "core/rendering/RenderImage.h"
#include "core/rendering/RenderVideo.h"
#include "platform/UserGestureIndicator.h"
+#include "platform/graphics/GraphicsContext.h"
+#include "platform/graphics/gpu/Extensions3DUtil.h"
+#include "public/platform/WebCanvas.h"
+#include "public/platform/WebGraphicsContext3D.h"
namespace blink {
@@ -197,17 +201,23 @@ void HTMLVideoElement::updateDisplayState()
void HTMLVideoElement::paintCurrentFrameInContext(GraphicsContext* context, const IntRect& destRect) const
{
- MediaPlayer* player = HTMLMediaElement::player();
- if (!player)
+ if (!webMediaPlayer())
return;
- player->paint(context, destRect);
+ if (!context->paintingDisabled()) {
+ WebCanvas* canvas = context->canvas();
+ webMediaPlayer()->paint(canvas, destRect, context->getNormalizedAlpha());
+ }
}
-bool HTMLVideoElement::copyVideoTextureToPlatformTexture(blink::WebGraphicsContext3D* context, Platform3DObject texture, GLint level, GLenum type, GLenum internalFormat, bool premultiplyAlpha, bool flipY)
+bool HTMLVideoElement::copyVideoTextureToPlatformTexture(WebGraphicsContext3D* context, Platform3DObject texture, GLint level, GLenum internalFormat, GLenum type, bool premultiplyAlpha, bool flipY)
{
- if (!player())
+ if (!webMediaPlayer())
return false;
- return player()->copyVideoTextureToPlatformTexture(context, texture, level, type, internalFormat, premultiplyAlpha, flipY);
+
+ if (!Extensions3DUtil::canUseCopyTextureCHROMIUM(internalFormat, type, level) || !context->makeContextCurrent())
+ return false;
+
+ return webMediaPlayer()->copyVideoTextureToPlatformTexture(context, texture, level, internalFormat, type, premultiplyAlpha, flipY);
}
bool HTMLVideoElement::hasAvailableVideoFrame() const
« no previous file with comments | « Source/core/html/HTMLVideoElement.h ('k') | Source/core/html/canvas/WebGLRenderingContextBase.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698