diff options
author | Derek Sollenberger <djsollen@google.com> | 2011-01-26 09:58:09 -0500 |
---|---|---|
committer | Derek Sollenberger <djsollen@google.com> | 2011-01-26 09:58:09 -0500 |
commit | 35b48db52f4434b8a07ac3529efbb17b994769a1 (patch) | |
tree | 8149b6e2ce7a0537a9cc3d476ab8970d28b38c04 /WebKit | |
parent | 5db24b8cfc8994f0d6f5118ed8dca23028c74fed (diff) | |
download | external_webkit-35b48db52f4434b8a07ac3529efbb17b994769a1.zip external_webkit-35b48db52f4434b8a07ac3529efbb17b994769a1.tar.gz external_webkit-35b48db52f4434b8a07ac3529efbb17b994769a1.tar.bz2 |
Plugin API to allow for y-axis inversion during rendering.
bug: 3393314
Change-Id: I913a6c073fe9ba56c14cdbcaa523b6e5a5af5219
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 |