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

Unified Diff: webkit/media/android/webmediaplayer_android.cc

Issue 13620008: Enable 2D Canvas painting for Chrome on Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and addressing xhwang's comments. 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
« no previous file with comments | « webkit/media/android/webmediaplayer_android.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/media/android/webmediaplayer_android.cc
diff --git a/webkit/media/android/webmediaplayer_android.cc b/webkit/media/android/webmediaplayer_android.cc
index 5a0382204ce6439723150262f17cff3727ace428..78461cec7b36f2b7a7ea4832addd9dc08138cf44 100644
--- a/webkit/media/android/webmediaplayer_android.cc
+++ b/webkit/media/android/webmediaplayer_android.cc
@@ -9,6 +9,7 @@
#include "base/logging.h"
#include "base/strings/string_number_conversions.h"
#include "cc/layers/video_layer.h"
+#include "gpu/GLES2/gl2extchromium.h"
#include "media/base/android/media_player_bridge.h"
#include "media/base/video_frame.h"
#include "net/base/mime_util.h"
@@ -270,6 +271,34 @@ void WebMediaPlayerAndroid::paint(WebKit::WebCanvas* canvas,
NOTIMPLEMENTED();
}
+bool WebMediaPlayerAndroid::copyVideoTextureToPlatformTexture(
+ WebKit::WebGraphicsContext3D* web_graphics_context,
+ unsigned int texture,
+ unsigned int level,
+ unsigned int internal_format,
+ bool premultiply_alpha,
+ bool flip_y) {
+ if (!texture_id_)
+ return false;
+
+ // The video is stored in an unmultiplied format, so premultiply if
+ // necessary.
+ web_graphics_context->pixelStorei(GL_UNPACK_PREMULTIPLY_ALPHA_CHROMIUM,
+ premultiply_alpha);
+
+ // Application itself needs to take care of setting the right flip_y
+ // value down to get the expected result.
+ // flip_y==true means to reverse the video orientation while
+ // flip_y==false means to keep the intrinsic orientation.
+ web_graphics_context->pixelStorei(GL_UNPACK_FLIP_Y_CHROMIUM, flip_y);
+ web_graphics_context->copyTextureCHROMIUM(GL_TEXTURE_2D, texture_id_,
+ texture, level, internal_format);
+ web_graphics_context->pixelStorei(GL_UNPACK_FLIP_Y_CHROMIUM, false);
+ web_graphics_context->pixelStorei(GL_UNPACK_PREMULTIPLY_ALPHA_CHROMIUM,
+ false);
+ return true;
+}
+
bool WebMediaPlayerAndroid::hasSingleSecurityOrigin() const {
return false;
}
« no previous file with comments | « webkit/media/android/webmediaplayer_android.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698