diff options
author | stuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-12 15:38:44 +0000 |
---|---|---|
committer | stuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-12 15:38:44 +0000 |
commit | 4491a7825cc754614cf849def41be8c83a082a0e (patch) | |
tree | 162d4082ceb74b3409369cb5b755e210fff197ad /webkit/glue/plugins | |
parent | f42e1ec303aaee3ef0eb4a9ac924633435a087d4 (diff) | |
download | chromium_src-4491a7825cc754614cf849def41be8c83a082a0e.zip chromium_src-4491a7825cc754614cf849def41be8c83a082a0e.tar.gz chromium_src-4491a7825cc754614cf849def41be8c83a082a0e.tar.bz2 |
Move details of QuickDraw plugin drawing into a helper class
This hides a bunch of ugly details of the QuickDraw plugin support in a helper class.
BUG=none
TEST=QuickDraw plugins (especially QuickTime on 10.5) should continue to work as before.
Review URL: http://codereview.chromium.org/1582021
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44247 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/plugins')
-rw-r--r-- | webkit/glue/plugins/quickdraw_drawing_manager_mac.cc | 150 | ||||
-rw-r--r-- | webkit/glue/plugins/quickdraw_drawing_manager_mac.h | 83 | ||||
-rw-r--r-- | webkit/glue/plugins/webplugin_delegate_impl.h | 19 | ||||
-rw-r--r-- | webkit/glue/plugins/webplugin_delegate_impl_mac.mm | 157 |
4 files changed, 261 insertions, 148 deletions
diff --git a/webkit/glue/plugins/quickdraw_drawing_manager_mac.cc b/webkit/glue/plugins/quickdraw_drawing_manager_mac.cc new file mode 100644 index 0000000..185d4db --- /dev/null +++ b/webkit/glue/plugins/quickdraw_drawing_manager_mac.cc @@ -0,0 +1,150 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef NP_NO_QUICKDRAW + +#include "webkit/glue/plugins/quickdraw_drawing_manager_mac.h" + +#include "webkit/glue/plugins/coregraphics_private_symbols_mac.h" + +// Turn off GCC warnings about deprecated functions (since QuickDraw is a +// deprecated API). According to the GCC documentation, this can only be done +// per file, not pushed and popped like some options can be. +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + +QuickDrawDrawingManager::QuickDrawDrawingManager() + : plugin_window_(NULL), target_context_(NULL), fast_path_enabled_(false), + current_port_(NULL), target_world_(NULL), plugin_world_(NULL) {} + +QuickDrawDrawingManager::~QuickDrawDrawingManager() { + DestroyGWorlds(); +} + +void QuickDrawDrawingManager::SetFastPathEnabled(bool enabled) { + if (fast_path_enabled_ == enabled) + return; + + fast_path_enabled_ = enabled; + if (enabled) { + if (!target_world_) + UpdateGWorlds(); + // Copy our last window snapshot into our new source, since the plugin + // may not repaint everything. + CopyGWorldBits(target_world_, plugin_world_, plugin_size_); + current_port_ = plugin_world_; + } else { + current_port_ = GetWindowPort(plugin_window_); + } +} + +void QuickDrawDrawingManager::SetTargetContext(CGContextRef context, + const gfx::Size& plugin_size) { + target_context_ = context; + plugin_size_ = plugin_size; + // Pitch the old GWorlds, since they are the wrong size now. + DestroyGWorlds(); + if (fast_path_enabled_) + UpdateGWorlds(); +} + +void QuickDrawDrawingManager::SetPluginWindow(WindowRef window) { + plugin_window_ = window; + if (!fast_path_enabled_) + current_port_ = GetWindowPort(window); +} + +void QuickDrawDrawingManager::UpdateContext() { + if (fast_path_enabled_) + CopyGWorldBits(plugin_world_, target_world_, plugin_size_); + else + ScrapeWindow(plugin_window_, target_context_, plugin_size_); +} + +bool QuickDrawDrawingManager::IsFastPathEnabled() { + return fast_path_enabled_; +} + +void QuickDrawDrawingManager::MakePortCurrent() { + if (fast_path_enabled_) + SetGWorld(current_port_, NULL); + else + SetPort(current_port_); +} + +void QuickDrawDrawingManager::DestroyGWorlds() { + if (plugin_world_) { + DisposeGWorld(plugin_world_); + plugin_world_ = NULL; + } + if (target_world_) { + DisposeGWorld(target_world_); + target_world_ = NULL; + } +} + +void QuickDrawDrawingManager::UpdateGWorlds() { + DestroyGWorlds(); + if (!target_context_) + return; + + Rect window_bounds = { + 0, 0, plugin_size_.height(), plugin_size_.width() + }; + // Create a GWorld pointing at the same bits as our target context. + if (target_context_) { + NewGWorldFromPtr( + &target_world_, k32BGRAPixelFormat, &window_bounds, NULL, NULL, 0, + static_cast<Ptr>(CGBitmapContextGetData(target_context_)), + static_cast<SInt32>(CGBitmapContextGetBytesPerRow(target_context_))); + } + // Create a GWorld for the plugin to paint into whenever it wants; since + // QuickDraw plugins don't draw at known times, they can't be allowed to draw + // directly into the shared memory. + NewGWorld(&plugin_world_, k32ARGBPixelFormat, &window_bounds, + NULL, NULL, kNativeEndianPixMap); +} + +void QuickDrawDrawingManager::ScrapeWindow(WindowRef window, + CGContextRef target_context, + const gfx::Size& plugin_size) { + if (!target_context) + return; + + CGRect window_bounds = CGRectMake(0, 0, + plugin_size.width(), + plugin_size.height()); + CGWindowID window_id = HIWindowGetCGWindowID(window); + CGContextSaveGState(target_context); + CGContextTranslateCTM(target_context, 0, plugin_size.height()); + CGContextScaleCTM(target_context, 1.0, -1.0); + CGContextCopyWindowCaptureContentsToRect(target_context, window_bounds, + _CGSDefaultConnection(), + window_id, 0); + CGContextRestoreGState(target_context); +} + +void QuickDrawDrawingManager::CopyGWorldBits(GWorldPtr source, GWorldPtr dest, + const gfx::Size& plugin_size) { + if (!(source && dest)) + return; + + Rect window_bounds = { 0, 0, plugin_size.height(), plugin_size.width() }; + PixMapHandle source_pixmap = GetGWorldPixMap(source); + if (LockPixels(source_pixmap)) { + PixMapHandle dest_pixmap = GetGWorldPixMap(dest); + if (LockPixels(dest_pixmap)) { + SetGWorld(dest, NULL); + // Set foreground and background colors to avoid "colorizing" the image. + ForeColor(blackColor); + BackColor(whiteColor); + CopyBits(reinterpret_cast<BitMap*>(*source_pixmap), + reinterpret_cast<BitMap*>(*dest_pixmap), + &window_bounds, &window_bounds, srcCopy, NULL); + UnlockPixels(dest_pixmap); + } + UnlockPixels(source_pixmap); + } +} + +#endif // !NP_NO_QUICKDRAW diff --git a/webkit/glue/plugins/quickdraw_drawing_manager_mac.h b/webkit/glue/plugins/quickdraw_drawing_manager_mac.h new file mode 100644 index 0000000..8163f92 --- /dev/null +++ b/webkit/glue/plugins/quickdraw_drawing_manager_mac.h @@ -0,0 +1,83 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef WEBKIT_GLUE_QUICKDRAW_DRAWING_MANAGER_MAC_H_ +#define WEBKIT_GLUE_QUICKDRAW_DRAWING_MANAGER_MAC_H_ + +#ifndef NP_NO_QUICKDRAW + +#import <Carbon/Carbon.h> + +#include "gfx/rect.h" + +// Plugin helper class encapsulating the details of capturing what a QuickDraw +// drawing model plugin draws, then drawing it into a CGContext. +class QuickDrawDrawingManager { + public: + QuickDrawDrawingManager(); + ~QuickDrawDrawingManager(); + + // Sets the mode used for plugin drawing. If enabled is true the plugin draws + // into a GWorld that's not connected to a window, otherwise the plugin draws + // into our the plugin's dummy window (which is slower, since the call we use + // to scrape the window contents is much more expensive than copying between + // GWorlds). + void SetFastPathEnabled(bool enabled); + + // Returns true if the fast path is currently enabled. + bool IsFastPathEnabled(); + + // Sets the context that the plugin bits should be copied into when + // UpdateContext is called. This object does not retain |context|, so the + // caller must call SetTargetContext again if the context changes. + // If the fast path is currently enabled, this call will cause the port to + // change. + void SetTargetContext(CGContextRef context, const gfx::Size& plugin_size); + + // Sets the window that is used by the plugin. This object does not own the + // window, so the caler must call SetPluginWindow again if the window changes. + void SetPluginWindow(WindowRef window); + + // Updates the target context with the current plugin bits. + void UpdateContext(); + + // Returns the port that the plugin should draw into. This returned port is + // only valid until the next call to SetFastPathEnabled (or SetTargetContext + // while the fast path is enabled). + CGrafPtr port() { return current_port_; } + + // Makes the QuickDraw port current; should be called before calls where the + // plugin might draw. + void MakePortCurrent(); + + private: + // Updates the GWorlds used by the faster path. + void UpdateGWorlds(); + + // Deletes the GWorlds used by the faster path. + void DestroyGWorlds(); + + // Scrapes the contents of the window into the given context. + // Used for the slower path. + static void ScrapeWindow(WindowRef window, CGContextRef target_context, + const gfx::Size& plugin_size); + + // Copies the source GWorld's bits into the target GWorld. + // Used for the faster path. + static void CopyGWorldBits(GWorldPtr source, GWorldPtr dest, + const gfx::Size& plugin_size); + + WindowRef plugin_window_; // Weak reference. + CGContextRef target_context_; // Weak reference. + gfx::Size plugin_size_; + bool fast_path_enabled_; + CGrafPtr current_port_; + // Variables used for the faster path: + GWorldPtr target_world_; // Created lazily; may be NULL. + GWorldPtr plugin_world_; // Created lazily; may be NULL. +}; + +#endif // !NP_NO_QUICKDRAW + +#endif // QUICKDRAW_DRAWING_MANAGER_MAC diff --git a/webkit/glue/plugins/webplugin_delegate_impl.h b/webkit/glue/plugins/webplugin_delegate_impl.h index 82ef74c..039223c4 100644 --- a/webkit/glue/plugins/webplugin_delegate_impl.h +++ b/webkit/glue/plugins/webplugin_delegate_impl.h @@ -39,6 +39,9 @@ class WebMouseEvent; } #if defined(OS_MACOSX) +#ifndef NP_NO_QUICKDRAW +class QuickDrawDrawingManager; +#endif class CoreAnimationRedrawTimerSource; #ifdef __OBJC__ @class CALayer; @@ -325,11 +328,8 @@ class WebPluginDelegateImpl : public webkit_glue::WebPluginDelegate { NP_CGContext np_cg_context_; #endif #ifndef NP_NO_QUICKDRAW + scoped_ptr<QuickDrawDrawingManager> qd_manager_; NP_Port qd_port_; - // Variables used for the faster QuickDraw path: - GWorldPtr qd_buffer_world_; // Created lazily; may be NULL. - GWorldPtr qd_plugin_world_; // Created lazily; may be NULL. - bool qd_fast_path_enabled_; base::TimeTicks fast_path_enable_tick_; #endif CALayer* layer_; // Used for CA drawing mode. Weak, retained by plug-in. @@ -409,17 +409,6 @@ class WebPluginDelegateImpl : public webkit_glue::WebPluginDelegate { void UpdateDummyWindowBounds(const gfx::Point& plugin_origin); #ifndef NP_NO_QUICKDRAW - // Scrapes the contents of our dummy window into the given context. - // Used for the slower QuickDraw path. - void ScrapeDummyWindowIntoContext(CGContextRef context); - - // Copies the source GWorld's bits into the target GWorld. - // Used for the faster QuickDraw path. - void CopyGWorldBits(GWorldPtr source, GWorldPtr dest); - - // Updates the GWorlds used by the faster QuickDraw path. - void UpdateGWorlds(CGContextRef context); - // Sets the mode used for QuickDraw plugin drawing. If enabled is true the // plugin draws into a GWorld that's not connected to a window (the faster // path), otherwise the plugin draws into our invisible dummy window (which is diff --git a/webkit/glue/plugins/webplugin_delegate_impl_mac.mm b/webkit/glue/plugins/webplugin_delegate_impl_mac.mm index 6a9dc07..64e7513 100644 --- a/webkit/glue/plugins/webplugin_delegate_impl_mac.mm +++ b/webkit/glue/plugins/webplugin_delegate_impl_mac.mm @@ -19,7 +19,6 @@ #include "base/string_util.h" #include "third_party/WebKit/WebKit/chromium/public/WebInputEvent.h" #include "webkit/default_plugin/plugin_impl.h" -#include "webkit/glue/plugins/coregraphics_private_symbols_mac.h" #include "webkit/glue/plugins/plugin_instance.h" #include "webkit/glue/plugins/plugin_lib.h" #include "webkit/glue/plugins/plugin_list.h" @@ -32,12 +31,8 @@ #include "webkit/glue/plugins/carbon_plugin_window_tracker_mac.h" #endif -// If we're compiling support for the QuickDraw drawing model, turn off GCC -// warnings about deprecated functions (since QuickDraw is a deprecated API). -// According to the GCC documentation, this can only be done per file, not -// pushed and popped like some options can be. #ifndef NP_NO_QUICKDRAW -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#include "webkit/glue/plugins/quickdraw_drawing_manager_mac.h" #endif using webkit_glue::WebPlugin; @@ -184,11 +179,6 @@ WebPluginDelegateImpl::WebPluginDelegateImpl( instance_(instance), parent_(containing_view), buffer_context_(NULL), -#ifndef NP_NO_QUICKDRAW - qd_buffer_world_(NULL), - qd_plugin_world_(NULL), - qd_fast_path_enabled_(false), -#endif layer_(nil), surface_(NULL), renderer_(nil), @@ -225,10 +215,6 @@ WebPluginDelegateImpl::~WebPluginDelegateImpl() { CarbonPluginWindowTracker::SharedInstance()->DestroyDummyWindowForDelegate( this, reinterpret_cast<WindowRef>(np_cg_context_.window)); } -#ifndef NP_NO_QUICKDRAW - if (quirks_ & PLUGIN_QUIRK_ALLOW_FASTER_QUICKDRAW_PATH) - UpdateGWorlds(NULL); -#endif #endif } @@ -274,10 +260,6 @@ bool WebPluginDelegateImpl::PlatformInitialize() { np_cg_context_.window = window_tracker->CreateDummyWindowForDelegate(this); np_cg_context_.context = NULL; UpdateDummyWindowBounds(gfx::Point(0, 0)); -#ifndef NP_NO_QUICKDRAW - qd_port_.port = - GetWindowPort(reinterpret_cast<WindowRef>(np_cg_context_.window)); -#endif } #endif @@ -286,6 +268,10 @@ bool WebPluginDelegateImpl::PlatformInitialize() { case NPDrawingModelQuickDraw: if (instance()->event_model() != NPEventModelCarbon) return false; + qd_manager_.reset(new QuickDrawDrawingManager()); + qd_manager_->SetPluginWindow( + reinterpret_cast<WindowRef>(np_cg_context_.window)); + qd_port_.port = qd_manager_->port(); window_.window = &qd_port_; window_.type = NPWindowTypeDrawable; break; @@ -391,6 +377,10 @@ void WebPluginDelegateImpl::UpdateGeometryAndContext( np_cg_context_.context = context; } #endif +#ifndef NP_NO_QUICKDRAW + if (instance()->drawing_model() == NPDrawingModelQuickDraw) + qd_manager_->SetTargetContext(context, window_rect.size()); +#endif UpdateGeometry(window_rect, clip_rect); } @@ -398,16 +388,10 @@ void WebPluginDelegateImpl::Paint(CGContextRef context, const gfx::Rect& rect) { WindowlessPaint(context, rect); #ifndef NP_NO_QUICKDRAW - // Paint events are our cue to scrape the dummy window into the real context - // (slow path) or copy the offscreen GWorld bits into the context (fast path) - // if we are dealing with a QuickDraw plugin. - // Note that we use buffer_context_ rather than |context| because the buffer - // might have changed during the NPP_HandleEvent call in WindowlessPaint. + // Paint events are our cue to dump the current plugin bits into the buffer + // context if we are dealing with a QuickDraw plugin. if (instance()->drawing_model() == NPDrawingModelQuickDraw) { - if (qd_fast_path_enabled_) - CopyGWorldBits(qd_plugin_world_, qd_buffer_world_); - else - ScrapeDummyWindowIntoContext(buffer_context_); + qd_manager_->UpdateContext(); } #endif } @@ -467,10 +451,8 @@ void WebPluginDelegateImpl::WindowlessUpdateGeometry( SetPluginRect(window_rect); #ifndef NP_NO_QUICKDRAW - if (window_rect_changed && qd_fast_path_enabled_) { - // Pitch the old GWorlds, since they are the wrong size now; they will be - // re-created on demand. - UpdateGWorlds(NULL); + if (window_rect_changed && qd_manager_.get() && + qd_manager_->IsFastPathEnabled()) { // If the window size has changed, we need to turn off the fast path so that // the full redraw goes to the window and we get a correct baseline paint. SetQuickDrawFastPathEnabled(false); @@ -516,12 +498,8 @@ void WebPluginDelegateImpl::WindowlessPaint(gfx::NativeDrawingContext context, ScopedActiveDelegate active_delegate(this); #ifndef NP_NO_QUICKDRAW - if (instance()->drawing_model() == NPDrawingModelQuickDraw) { - if (qd_fast_path_enabled_) - SetGWorld(qd_port_.port, NULL); - else - SetPort(qd_port_.port); - } + if (instance()->drawing_model() == NPDrawingModelQuickDraw) + qd_manager_->MakePortCurrent(); #endif CGContextSaveGState(context); @@ -587,7 +565,7 @@ void WebPluginDelegateImpl::WindowlessSetWindow(bool force_set_window) { #ifndef NP_NO_QUICKDRAW if ((quirks_ & PLUGIN_QUIRK_ALLOW_FASTER_QUICKDRAW_PATH) && - !qd_fast_path_enabled_ && clip_rect_.IsEmpty()) { + !qd_manager_->IsFastPathEnabled() && clip_rect_.IsEmpty()) { // Give the plugin a few seconds to stabilize so we get a good initial paint // to use as a baseline, then switch to the fast path. fast_path_enable_tick_ = base::TimeTicks::Now() + @@ -662,7 +640,7 @@ void WebPluginDelegateImpl::SetWindowHasFocus(bool has_focus) { #ifndef NP_NO_QUICKDRAW // Make sure controls repaint with the correct look. - if (qd_fast_path_enabled_) + if (quirks_ & PLUGIN_QUIRK_ALLOW_FASTER_QUICKDRAW_PATH) SetQuickDrawFastPathEnabled(false); #endif @@ -833,76 +811,6 @@ void WebPluginDelegateImpl::UpdateDummyWindowBounds( } #ifndef NP_NO_QUICKDRAW -void WebPluginDelegateImpl::ScrapeDummyWindowIntoContext(CGContextRef context) { - if (!context) - return; - - CGRect window_bounds = CGRectMake(0, 0, - window_rect_.width(), - window_rect_.height()); - CGWindowID window_id = HIWindowGetCGWindowID( - reinterpret_cast<WindowRef>(np_cg_context_.window)); - CGContextSaveGState(context); - CGContextTranslateCTM(context, 0, window_rect_.height()); - CGContextScaleCTM(context, 1.0, -1.0); - CGContextCopyWindowCaptureContentsToRect(context, window_bounds, - _CGSDefaultConnection(), - window_id, 0); - CGContextRestoreGState(context); -} - -void WebPluginDelegateImpl::CopyGWorldBits(GWorldPtr source, GWorldPtr dest) { - if (!(source && dest)) - return; - - Rect window_bounds = { 0, 0, window_rect_.height(), window_rect_.width() }; - PixMapHandle source_pixmap = GetGWorldPixMap(source); - if (LockPixels(source_pixmap)) { - PixMapHandle dest_pixmap = GetGWorldPixMap(dest); - if (LockPixels(dest_pixmap)) { - SetGWorld(qd_buffer_world_, NULL); - // Set foreground and background colors to avoid "colorizing" the image. - ForeColor(blackColor); - BackColor(whiteColor); - CopyBits(reinterpret_cast<BitMap*>(*source_pixmap), - reinterpret_cast<BitMap*>(*dest_pixmap), - &window_bounds, &window_bounds, srcCopy, NULL); - UnlockPixels(dest_pixmap); - } - UnlockPixels(source_pixmap); - } -} - -void WebPluginDelegateImpl::UpdateGWorlds(CGContextRef context) { - if (qd_plugin_world_) { - DisposeGWorld(qd_plugin_world_); - qd_plugin_world_ = NULL; - } - if (qd_buffer_world_) { - DisposeGWorld(qd_buffer_world_); - qd_buffer_world_ = NULL; - } - if (!context) - return; - - gfx::Size dimensions = window_rect_.size(); - Rect window_bounds = { - 0, 0, dimensions.height(), dimensions.width() - }; - // Create a GWorld pointing at the same bits as our buffer context. - if (context) { - NewGWorldFromPtr( - &qd_buffer_world_, k32BGRAPixelFormat, &window_bounds, - NULL, NULL, 0, static_cast<Ptr>(CGBitmapContextGetData(context)), - static_cast<SInt32>(CGBitmapContextGetBytesPerRow(context))); - } - // Create a GWorld for the plugin to paint into whenever it wants. - NewGWorld(&qd_plugin_world_, k32ARGBPixelFormat, &window_bounds, - NULL, NULL, kNativeEndianPixMap); - if (qd_fast_path_enabled_) - qd_port_.port = qd_plugin_world_; -} - void WebPluginDelegateImpl::SetQuickDrawFastPathEnabled(bool enabled) { if (!enabled) { // Wait a couple of seconds, then turn the fast path back on. If we're @@ -915,7 +823,7 @@ void WebPluginDelegateImpl::SetQuickDrawFastPathEnabled(bool enabled) { base::TimeDelta::FromSeconds(2); } - if (enabled == qd_fast_path_enabled_) + if (enabled == qd_manager_->IsFastPathEnabled()) return; if (enabled && clip_rect_.IsEmpty()) { // Don't switch to the fast path while the plugin is completely clipped; @@ -924,18 +832,8 @@ void WebPluginDelegateImpl::SetQuickDrawFastPathEnabled(bool enabled) { return; } - qd_fast_path_enabled_ = enabled; - if (enabled) { - if (!qd_plugin_world_) - UpdateGWorlds(buffer_context_); - qd_port_.port = qd_plugin_world_; - // Copy our last window snapshot into our new source, since the plugin - // may not repaint everything. - CopyGWorldBits(qd_buffer_world_, qd_plugin_world_); - } else { - qd_port_.port = - GetWindowPort(reinterpret_cast<WindowRef>(np_cg_context_.window)); - } + qd_manager_->SetFastPathEnabled(enabled); + qd_port_.port = qd_manager_->port(); WindowlessSetWindow(true); // Send a paint event so that the new buffer gets updated immediately. WindowlessPaint(buffer_context_, clip_rect_); @@ -1070,10 +968,7 @@ bool WebPluginDelegateImpl::PlatformHandleInputEvent( } } - if (qd_fast_path_enabled_) - SetGWorld(qd_port_.port, NULL); - else - SetPort(qd_port_.port); + qd_manager_->MakePortCurrent(); } #endif @@ -1189,12 +1084,8 @@ void WebPluginDelegateImpl::FireIdleEvent() { ScopedActiveDelegate active_delegate(this); #ifndef NP_NO_QUICKDRAW - if (instance()->drawing_model() == NPDrawingModelQuickDraw) { - if (qd_fast_path_enabled_) - SetGWorld(qd_port_.port, NULL); - else - SetPort(qd_port_.port); - } + if (instance()->drawing_model() == NPDrawingModelQuickDraw) + qd_manager_->MakePortCurrent(); #endif // Send an idle event so that the plugin can do background work |