diff options
author | Patrick Scott <phanna@android.com> | 2009-07-17 16:40:38 -0400 |
---|---|---|
committer | Patrick Scott <phanna@android.com> | 2009-07-20 11:01:37 -0400 |
commit | e661c6da169832b46b6db967a09adb4459db003a (patch) | |
tree | d0bc69d4e5c6379a665e22db2a71c7046c49e42e /WebKit/android/plugins/android_npapi.h | |
parent | 54c7b5fa917905784d2d3d5c1ca6a914a6e86334 (diff) | |
download | external_webkit-e661c6da169832b46b6db967a09adb4459db003a.zip external_webkit-e661c6da169832b46b6db967a09adb4459db003a.tar.gz external_webkit-e661c6da169832b46b6db967a09adb4459db003a.tar.bz2 |
Add Plugin APIs for creating and manipulating a Surface.
SurfaceCallback: An interface used to receive the surface change events. The
PluginSurface then sends those events to the actual plugin.
PluginSurface: A wrapper around the native Surface object obtained from the Java
SurfaceView. This object can lock and unlock the surface and takes care of
creating, positioning and destroying the Java SurfaceView.
Changed PluginWidgetAndroid to not use SkFlipPixelRef when the drawing model is
Surface.
Diffstat (limited to 'WebKit/android/plugins/android_npapi.h')
-rw-r--r-- | WebKit/android/plugins/android_npapi.h | 45 |
1 files changed, 40 insertions, 5 deletions
diff --git a/WebKit/android/plugins/android_npapi.h b/WebKit/android/plugins/android_npapi.h index 41c1080..2d86b9c 100644 --- a/WebKit/android/plugins/android_npapi.h +++ b/WebKit/android/plugins/android_npapi.h @@ -200,11 +200,6 @@ struct ANPBitmapInterfaceV0 : ANPInterface { bool (*getPixelPacking)(ANPBitmapFormat, ANPPixelPacking* packing); }; -/** The ANPSurface acts as a handle between the plugin and the native libraries - that render the surface to the screen. - */ -struct ANPSurface; - /** The surfaceType is the mechanism by which the plugin informs the native libraries which type of surface view it wishes to use. */ @@ -213,6 +208,11 @@ enum ANPSurfaceTypes { }; typedef int32_t ANPSurfaceType; +/** The ANPSurface acts as a handle between the plugin and the native libraries + that render the surface to the screen. + */ +struct ANPSurface; + struct ANPSurfaceInterfaceV0 : ANPInterface { /** Creates a new surface handle based on the given surface type. If the given surface type is not supported then NULL is returned. @@ -717,6 +717,7 @@ enum ANPEventTypes { kDraw_ANPEventType = 4, kLifecycle_ANPEventType = 5, kVisibleRect_ANPEventType = 6, + kSurface_ANPEventType = 7, }; typedef int32_t ANPEventType; @@ -759,6 +760,23 @@ enum ANPLifecycleActions { }; typedef uint32_t ANPLifecycleAction; +enum ANPSurfaceActions { + /** The surface has been created and is ready to be used. Any calls to + lock/unlock before this action will fail. + */ + kCreated_ANPSurfaceAction = 0, + /** The surface has changed format or dimensions. + */ + kChanged_ANPSurfaceAction = 1, + /** The surface has been destroyed. This happens when the view system has + remove the surface (possibly due to the plugin being offscreen). Calls + to lock/unlock will fail after this action and before + kCreate_ANPSurfaceAction. + */ + kDestroyed_ANPSurfaceAction = 2, +}; +typedef uint32_t ANPSurfaceAction; + /* This is what is passed to NPP_HandleEvent() */ struct ANPEvent { uint32_t inSize; // size of this struct in bytes @@ -800,6 +818,23 @@ struct ANPEvent { ANPRectI rect; // in global document coordinates float zoomScale; // 1.0 means no zoom scale } visibleRect; + struct { + ANPSurfaceAction action; + /** This union is based on the value of action and contains data + specific to the given action. + */ + union { + /** This struct is filled in only during the + kChanged_ANPSurfaceAction action. For all other actions, + this struct is undefined. + */ + struct { + int32_t format; + int32_t width; + int32_t height; + } changed; + } data; + } surface; int32_t other[8]; } data; }; |