diff options
Diffstat (limited to 'webkit/plugins/npapi')
-rw-r--r-- | webkit/plugins/npapi/webplugin_delegate_impl.h | 6 | ||||
-rw-r--r-- | webkit/plugins/npapi/webplugin_delegate_impl_mac.mm | 18 |
2 files changed, 23 insertions, 1 deletions
diff --git a/webkit/plugins/npapi/webplugin_delegate_impl.h b/webkit/plugins/npapi/webplugin_delegate_impl.h index b5156e3..b68d34c 100644 --- a/webkit/plugins/npapi/webplugin_delegate_impl.h +++ b/webkit/plugins/npapi/webplugin_delegate_impl.h @@ -177,6 +177,12 @@ class WebPluginDelegateImpl : public WebPluginDelegate { // Indicates that it's time to send the plugin a null event. void FireIdleEvent(); #endif + + // TODO(caryclark): This is a temporary workaround to allow the Darwin / Skia + // port to share code with the Darwin / CG port. Later, this will be removed + // and all callers will use the Paint defined above. + void CGPaint(CGContextRef context, const gfx::Rect& rect); + #endif // OS_MACOSX gfx::PluginWindowHandle windowed_handle() const { diff --git a/webkit/plugins/npapi/webplugin_delegate_impl_mac.mm b/webkit/plugins/npapi/webplugin_delegate_impl_mac.mm index 8d9351e..20db93a 100644 --- a/webkit/plugins/npapi/webplugin_delegate_impl_mac.mm +++ b/webkit/plugins/npapi/webplugin_delegate_impl_mac.mm @@ -37,6 +37,10 @@ #include "webkit/plugins/npapi/quickdraw_drawing_manager_mac.h" #endif +#if defined(USE_SKIA) +#include "skia/ext/skia_utils_mac.h" +#endif + using WebKit::WebCursorInfo; using WebKit::WebKeyboardEvent; using WebKit::WebInputEvent; @@ -457,7 +461,19 @@ void WebPluginDelegateImpl::UpdateGeometryAndContext( UpdateGeometry(window_rect, clip_rect); } -void WebPluginDelegateImpl::Paint(CGContextRef context, const gfx::Rect& rect) { +void WebPluginDelegateImpl::Paint(WebKit::WebCanvas* canvas, + const gfx::Rect& rect) { +#if defined(USE_SKIA) + gfx::SkiaBitLocker bit_locker(canvas); + CGContextRef context = bit_locker.cgContext(); +#else + CGContextRef context = canvas; +#endif + CGPaint(context, rect); +} + +void WebPluginDelegateImpl::CGPaint(CGContextRef context, + const gfx::Rect& rect) { WindowlessPaint(context, rect); #ifndef NP_NO_QUICKDRAW |