diff options
author | Derek Sollenberger <djsollen@google.com> | 2011-01-26 08:14:27 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-01-26 08:14:27 -0800 |
commit | 9d071845bbad7f9b73a17de59ad8b564e6ce39e4 (patch) | |
tree | 97760d790f52757308d6d6ddeeef0519d6521a7b /WebKit | |
parent | 85e27b62cf6f85f2e8d5694b285be78a3a090b22 (diff) | |
parent | 35b48db52f4434b8a07ac3529efbb17b994769a1 (diff) | |
download | external_webkit-9d071845bbad7f9b73a17de59ad8b564e6ce39e4.zip external_webkit-9d071845bbad7f9b73a17de59ad8b564e6ce39e4.tar.gz external_webkit-9d071845bbad7f9b73a17de59ad8b564e6ce39e4.tar.bz2 |
Merge "Plugin API to allow for y-axis inversion during rendering." into honeycomb
Diffstat (limited to 'WebKit')
-rw-r--r-- | WebKit/android/plugins/ANPOpenGLInterface.cpp | 21 | ||||
-rw-r--r-- | WebKit/android/plugins/ANPOpenGL_npapi.h | 6 |
2 files changed, 27 insertions, 0 deletions
diff --git a/WebKit/android/plugins/ANPOpenGLInterface.cpp b/WebKit/android/plugins/ANPOpenGLInterface.cpp index 55eb3e0..8f5f9b4 100644 --- a/WebKit/android/plugins/ANPOpenGLInterface.cpp +++ b/WebKit/android/plugins/ANPOpenGLInterface.cpp @@ -30,6 +30,11 @@ #include "PluginView.h" #include "PluginWidgetAndroid.h" #include "MediaLayer.h" +#include "WebViewCore.h" +#include "Frame.h" +#include "Page.h" +#include "Chrome.h" +#include "ChromeClient.h" using namespace android; @@ -84,6 +89,21 @@ static void anp_releaseTexture(NPP instance, const ANPTextureInfo* textureInfo) texture->producerReleaseAndSwap(); } +static void anp_invertPluginContent(NPP instance, bool isContentInverted) { + WebCore::PluginView* pluginView = pluginViewForInstance(instance); + PluginWidgetAndroid* pluginWidget = pluginView->platformPluginWidget(); + WebCore::MediaLayer* mediaLayer = pluginWidget->getLayer(); + + mediaLayer->invertContents(isContentInverted); + + //force the layer to sync to the UI thread + WebViewCore* wvc = pluginWidget->webViewCore(); + if (wvc) + wvc->mainFrame()->page()->chrome()->client()->scheduleCompositingLayerSync(); +} + + + /////////////////////////////////////////////////////////////////////////////// #define ASSIGN(obj, name) (obj)->name = anp_##name @@ -94,4 +114,5 @@ void ANPOpenGLInterfaceV0_Init(ANPInterface* v) { ASSIGN(i, acquireContext); ASSIGN(i, lockTexture); ASSIGN(i, releaseTexture); + ASSIGN(i, invertPluginContent); } diff --git a/WebKit/android/plugins/ANPOpenGL_npapi.h b/WebKit/android/plugins/ANPOpenGL_npapi.h index bfca0dd..5aabbc4 100644 --- a/WebKit/android/plugins/ANPOpenGL_npapi.h +++ b/WebKit/android/plugins/ANPOpenGL_npapi.h @@ -52,6 +52,12 @@ struct ANPOpenGLInterfaceV0 : ANPInterface { /** */ void (*releaseTexture)(NPP instance, const ANPTextureInfo*); + + /** + * Invert the contents of the plugin on the y-axis. + * default is to not be inverted (i.e. use OpenGL coordinates) + */ + void (*invertPluginContent)(NPP instance, bool isContentInverted); }; #endif //ANPOpenGL_npapi_H |