<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[38078] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/38078">38078</a></dd>
<dt>Author</dt> <dd>kdecker@apple.com</dd>
<dt>Date</dt> <dd>2008-11-03 12:52:50 -0800 (Mon, 03 Nov 2008)</dd>
</dl>

<h3>Log Message</h3>
<pre>        Reviewed by Anders Carlsson.

        https://bugs.webkit.org/show_bug.cgi?id=22053
        
        This patch adds initial support for the NPDrawingModelCoreAnimation drawing model. 
                
        * Plugins/WebBaseNetscapePluginView.h: Added _layer ivar.
        * Plugins/WebBaseNetscapePluginView.mm:
        (-[WebBaseNetscapePluginView saveAndSetNewPortStateForUpdate:]): ASSERT this is not a plug-in using NPDrawingModelCoreAnimation.
        (-[WebBaseNetscapePluginView restorePortState:]): Ditto.
        (-[WebBaseNetscapePluginView sendEvent:isDrawRect:]): Slightly refactored a small block of code which with the PortState.
        Plug-ins using the NPDrawingModelCoreAnimation drawing model have no PortState. 
        (-[WebBaseNetscapePluginView isNewWindowEqualToOldWindow]): ASSERT this is not a plug-in using NPDrawingModelCoreAnimation
        (-[WebBaseNetscapePluginView updateAndSetWindow]):  Ditto.
        (-[WebBaseNetscapePluginView setWindowIfNecessary]): Ditto.
        (-[WebBaseNetscapePluginView start]): If the plug-in is a plug-in using the Core Animation model, request a layer from it.
        (-[WebBaseNetscapePluginView drawRect:]): Return early for NPDrawingModelCoreAnimation plug-ins.
        (-[WebBaseNetscapePluginView getVariable:value:]): Tell plug-ins running on post-Tiger systems WebKit supports
         NPDrawingModelCoreAnimation.
        (-[WebBaseNetscapePluginView setVariable:value:]): Added the new NPDrawingModelCoreAnimation case, which initializes drawingMode.
        (-[WebBaseNetscapePluginView _viewHasMoved]): Reworded the conditional call to updateAndSetWindow to be specific to 
        CoreGraphics and QuickDraw plug-ins.

        Reviewed by Anders Carlsson.

        https://bugs.webkit.org/show_bug.cgi?id=22053

        Added additional support needed for the NPDrawingModelCoreAnimation drawing model. 

        * bridge/npapi.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkWebCoreChangeLog">trunk/WebCore/ChangeLog</a></li>
<li><a href="#trunkWebCorebridgenpapih">trunk/WebCore/bridge/npapi.h</a></li>
<li><a href="#trunkWebKitmacChangeLog">trunk/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkWebKitmacPluginsWebBaseNetscapePluginViewh">trunk/WebKit/mac/Plugins/WebBaseNetscapePluginView.h</a></li>
<li><a href="#trunkWebKitmacPluginsWebBaseNetscapePluginViewmm">trunk/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/ChangeLog (38077 => 38078)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/ChangeLog        2008-11-03 20:47:20 UTC (rev 38077)
+++ trunk/WebCore/ChangeLog        2008-11-03 20:52:50 UTC (rev 38078)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2008-11-03  Kevin Decker  &lt;kdecker@apple.com&gt;
+
+        Reviewed by Anders Carlsson.
+
+        https://bugs.webkit.org/show_bug.cgi?id=22053
+
+        Added additional support needed for the NPDrawingModelCoreAnimation drawing model. 
+
+        * bridge/npapi.h:
+
</ins><span class="cx"> 2008-11-03  Xan Lopez  &lt;xan@gnome.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Alp Toker.
</span></span></pre></div>
<a id="trunkWebCorebridgenpapih"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/bridge/npapi.h (38077 => 38078)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/bridge/npapi.h        2008-11-03 20:47:20 UTC (rev 38077)
+++ trunk/WebCore/bridge/npapi.h        2008-11-03 20:52:50 UTC (rev 38078)
</span><span class="lines">@@ -350,6 +350,8 @@
</span><span class="cx">     NPPVpluginEventModel = 1001,
</span><span class="cx">     /* The plug-in text input vtable */
</span><span class="cx">     NPPVpluginTextInputFuncs = 1002,
</span><ins>+    /* In the NPDrawingModelCoreAnimation drawing model, the browser asks the plug-in for a Core Animation layer. */
+    NPPVpluginCoreAnimationLayer = 1003
</ins><span class="cx"> #endif
</span><span class="cx"> } NPPVariable;
</span><span class="cx"> 
</span><span class="lines">@@ -418,7 +420,8 @@
</span><span class="cx">     NPDrawingModelQuickDraw = 0,
</span><span class="cx"> #endif
</span><span class="cx">     NPDrawingModelCoreGraphics = 1,
</span><del>-    NPDrawingModelOpenGL = 2
</del><ins>+    NPDrawingModelOpenGL = 2,
+    NPDrawingModelCoreAnimation
</ins><span class="cx"> } NPDrawingModel;
</span><span class="cx"> 
</span><span class="cx"> /*
</span><span class="lines">@@ -448,7 +451,6 @@
</span><span class="cx">     NPCocoaEventScrollWheel,
</span><span class="cx"> } NPCocoaEventType;
</span><span class="cx"> 
</span><del>-typedef struct _NPCALayer NPCALayer;
</del><span class="cx"> typedef struct _NPNSString NPNSString;
</span><span class="cx"> typedef struct _NPNSWindow NPNSWindow;
</span><span class="cx"> typedef struct _NPNSMenu NPNSMenu;
</span><span class="lines">@@ -608,17 +610,6 @@
</span><span class="cx"> #endif
</span><span class="cx"> } NP_GLContext;
</span><span class="cx"> 
</span><del>-/* 
- * NP_CALayer is the type of the NPWindow's 'window' when the plugin specifies NPDrawingModelCoreAnimation as its
- * drawing model.
- */
-
-typedef struct NP_CALayer
-{
-    NPCALayer *layer;
-    NPNSWindow *window;
-} NP_CALayer;
-
</del><span class="cx"> #endif /* XP_MACOSX */
</span><span class="cx"> 
</span><span class="cx"> #if defined(XP_MAC) || defined(XP_MACOSX)
</span></span></pre></div>
<a id="trunkWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/mac/ChangeLog (38077 => 38078)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/mac/ChangeLog        2008-11-03 20:47:20 UTC (rev 38077)
+++ trunk/WebKit/mac/ChangeLog        2008-11-03 20:52:50 UTC (rev 38078)
</span><span class="lines">@@ -1,3 +1,28 @@
</span><ins>+2008-11-03  Kevin Decker  &lt;kdecker@apple.com&gt;
+
+        Reviewed by Anders Carlsson.
+
+        https://bugs.webkit.org/show_bug.cgi?id=22053
+        
+        This patch adds initial support for the NPDrawingModelCoreAnimation drawing model. 
+                
+        * Plugins/WebBaseNetscapePluginView.h: Added _layer ivar.
+        * Plugins/WebBaseNetscapePluginView.mm:
+        (-[WebBaseNetscapePluginView saveAndSetNewPortStateForUpdate:]): ASSERT this is not a plug-in using NPDrawingModelCoreAnimation.
+        (-[WebBaseNetscapePluginView restorePortState:]): Ditto.
+        (-[WebBaseNetscapePluginView sendEvent:isDrawRect:]): Slightly refactored a small block of code which with the PortState.
+        Plug-ins using the NPDrawingModelCoreAnimation drawing model have no PortState. 
+        (-[WebBaseNetscapePluginView isNewWindowEqualToOldWindow]): ASSERT this is not a plug-in using NPDrawingModelCoreAnimation
+        (-[WebBaseNetscapePluginView updateAndSetWindow]):  Ditto.
+        (-[WebBaseNetscapePluginView setWindowIfNecessary]): Ditto.
+        (-[WebBaseNetscapePluginView start]): If the plug-in is a plug-in using the Core Animation model, request a layer from it.
+        (-[WebBaseNetscapePluginView drawRect:]): Return early for NPDrawingModelCoreAnimation plug-ins.
+        (-[WebBaseNetscapePluginView getVariable:value:]): Tell plug-ins running on post-Tiger systems WebKit supports
+         NPDrawingModelCoreAnimation.
+        (-[WebBaseNetscapePluginView setVariable:value:]): Added the new NPDrawingModelCoreAnimation case, which initializes drawingMode.
+        (-[WebBaseNetscapePluginView _viewHasMoved]): Reworded the conditional call to updateAndSetWindow to be specific to 
+        CoreGraphics and QuickDraw plug-ins.
+
</ins><span class="cx"> 2008-10-31  Cameron Zwarich  &lt;zwarich@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Darin Adler.
</span></span></pre></div>
<a id="trunkWebKitmacPluginsWebBaseNetscapePluginViewh"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/mac/Plugins/WebBaseNetscapePluginView.h (38077 => 38078)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/mac/Plugins/WebBaseNetscapePluginView.h        2008-11-03 20:47:20 UTC (rev 38077)
+++ trunk/WebKit/mac/Plugins/WebBaseNetscapePluginView.h        2008-11-03 20:52:50 UTC (rev 38078)
</span><span class="lines">@@ -68,6 +68,9 @@
</span><span class="cx">     
</span><span class="cx">     BOOL _loadManually;
</span><span class="cx">     RefPtr&lt;WebNetscapePluginStream&gt; _manualStream;
</span><ins>+#ifndef BUILDING_ON_TIGER
+    CALayer *_layer;
+#endif
</ins><span class="cx">     unsigned _dataLengthReceived;
</span><span class="cx">     NSError *_error;
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkWebKitmacPluginsWebBaseNetscapePluginViewmm"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm (38077 => 38078)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm        2008-11-03 20:47:20 UTC (rev 38077)
+++ trunk/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm        2008-11-03 20:52:50 UTC (rev 38078)
</span><span class="lines">@@ -288,6 +288,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (PortState)saveAndSetNewPortStateForUpdate:(BOOL)forUpdate
</span><span class="cx"> {
</span><ins>+    ASSERT(drawingModel != NPDrawingModelCoreAnimation);
</ins><span class="cx">     ASSERT([self currentWindow] != nil);
</span><span class="cx"> 
</span><span class="cx"> #ifndef NP_NO_QUICKDRAW
</span><span class="lines">@@ -545,7 +546,7 @@
</span><span class="cx"> 
</span><span class="cx">             break;
</span><span class="cx">         }
</span><del>-
</del><ins>+        
</ins><span class="cx">         default:
</span><span class="cx">             ASSERT_NOT_REACHED();
</span><span class="cx">             portState = NULL;
</span><span class="lines">@@ -562,6 +563,9 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)restorePortState:(PortState)portState
</span><span class="cx"> {
</span><ins>+    if (drawingModel == NPDrawingModelCoreAnimation)
+        return;
+
</ins><span class="cx">     ASSERT([self currentWindow]);
</span><span class="cx">     ASSERT(portState);
</span><span class="cx">     
</span><span class="lines">@@ -597,7 +601,7 @@
</span><span class="cx">             ASSERT(((PortState_CG *)portState)-&gt;context == nPort.cgPort.context);
</span><span class="cx">             CGContextRestoreGState(nPort.cgPort.context);
</span><span class="cx">             break;
</span><del>-                
</del><ins>+
</ins><span class="cx">         default:
</span><span class="cx">             ASSERT_NOT_REACHED();
</span><span class="cx">             break;
</span><span class="lines">@@ -637,15 +641,18 @@
</span><span class="cx">     ASSERT((drawingModel != NPDrawingModelCoreGraphics) || !eventIsDrawRect || [NSView focusView] == self);
</span><span class="cx">     
</span><span class="cx">     PortState portState;
</span><del>-    if ((drawingModel != NPDrawingModelCoreGraphics) || eventIsDrawRect) {
-        // In CoreGraphics mode, the port state only needs to be saved/set when redrawing the plug-in view.  The plug-in is not
-        // allowed to draw at any other time.
-        portState = [self saveAndSetNewPortStateForUpdate:eventIsDrawRect];
-        
-        // We may have changed the window, so inform the plug-in.
-        [self setWindowIfNecessary];
-    } else
</del><ins>+    
+    if (drawingModel == NPDrawingModelCoreAnimation) {
</ins><span class="cx">         portState = NULL;
</span><ins>+    } else {
+        if ((drawingModel == NPDrawingModelQuickDraw) || eventIsDrawRect) {
+            // In CoreGraphics mode, the port state only needs to be saved/set when redrawing the plug-in view.
+            // The plug-in is not allowed to draw at any other time.
+            portState = [self saveAndSetNewPortStateForUpdate:eventIsDrawRect];
+            // We may have changed the window, so inform the plug-in.
+            [self setWindowIfNecessary];
+        }
+    }
</ins><span class="cx">     
</span><span class="cx"> #if !defined(NDEBUG) &amp;&amp; !defined(NP_NO_QUICKDRAW)
</span><span class="cx">     // Draw green to help debug.
</span><span class="lines">@@ -912,6 +919,8 @@
</span><span class="cx"> 
</span><span class="cx"> - (BOOL)isNewWindowEqualToOldWindow
</span><span class="cx"> {
</span><ins>+    ASSERT(drawingModel != NPDrawingModelCoreAnimation);
+        
</ins><span class="cx">     if (window.x != lastSetWindow.x)
</span><span class="cx">         return NO;
</span><span class="cx">     if (window.y != lastSetWindow.y)
</span><span class="lines">@@ -960,6 +969,8 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)updateAndSetWindow
</span><span class="cx"> {
</span><ins>+    ASSERT(drawingModel != NPDrawingModelCoreAnimation);
+
</ins><span class="cx">     // A plug-in can only update if it's (1) already been started (2) isn't stopped
</span><span class="cx">     // and (3) is able to draw on-screen. To meet condition (3) the plug-in must not
</span><span class="cx">     // be hidden and be attached to a window. QuickDraw plug-ins are an important
</span><span class="lines">@@ -977,6 +988,15 @@
</span><span class="cx"> #endif // NP_NO_QUICKDRAW
</span><span class="cx">     
</span><span class="cx">     BOOL didLockFocus = [NSView focusView] != self &amp;&amp; [self lockFocusIfCanDraw];
</span><ins>+    
+    if (drawingModel == NPDrawingModelCoreGraphics || drawingModel == NPDrawingModelQuickDraw) {
+        [self setWindowIfNecessary];
+        if (didLockFocus)
+            [self unlockFocus];
+
+        return;
+    }
+    
</ins><span class="cx">     PortState portState = [self saveAndSetNewPortState];
</span><span class="cx">     if (portState) {
</span><span class="cx">         [self setWindowIfNecessary];
</span><span class="lines">@@ -989,6 +1009,8 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)setWindowIfNecessary
</span><span class="cx"> {
</span><ins>+    ASSERT(drawingModel != NPDrawingModelCoreAnimation);
+           
</ins><span class="cx">     if (!isStarted) {
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="lines">@@ -1027,7 +1049,7 @@
</span><span class="cx">                 LOG(Plugins, &quot;NPP_SetWindow (CoreGraphics): %d, window=%p, context=%p, window.x:%d window.y:%d window.width:%d window.height:%d&quot;,
</span><span class="cx">                 npErr, nPort.cgPort.window, nPort.cgPort.context, (int)window.x, (int)window.y, (int)window.width, (int)window.height);
</span><span class="cx">             break;
</span><del>-            
</del><ins>+                        
</ins><span class="cx">             default:
</span><span class="cx">                 ASSERT_NOT_REACHED();
</span><span class="cx">             break;
</span><span class="lines">@@ -1196,6 +1218,20 @@
</span><span class="cx">     }        
</span><span class="cx"> #endif // NP_NO_CARBON
</span><span class="cx">     
</span><ins>+#ifndef BUILDING_ON_TIGER
+    if (drawingModel == NPDrawingModelCoreAnimation) {
+        void *value = 0;
+        if (NPP_GetValue(plugin, NPPVpluginCoreAnimationLayer, &amp;value) == NPERR_NO_ERROR &amp;&amp; value) {
+            _layer = (CALayer *)value;
+            [self setWantsLayer:YES];
+            [self setLayer:_layer];
+            LOG(Plugins, &quot;%@ is using Core Animation drawing model with layer %@&quot;, pluginPackage, _layer);
+        }
+
+        ASSERT(_layer);
+    }
+#endif
+    
</ins><span class="cx">     // Create the event handler
</span><span class="cx">     eventHandler = WebNetscapePluginEventHandler::create(self);
</span><span class="cx">     
</span><span class="lines">@@ -1214,7 +1250,8 @@
</span><span class="cx">     isStarted = YES;
</span><span class="cx">     [[self webView] addPluginInstanceView:self];
</span><span class="cx">         
</span><del>-    [self updateAndSetWindow];
</del><ins>+    if (drawingModel == NPDrawingModelCoreGraphics || drawingModel == NPDrawingModelQuickDraw)
+        [self updateAndSetWindow];
</ins><span class="cx"> 
</span><span class="cx">     if ([self window]) {
</span><span class="cx">         [self addWindowObservers];
</span><span class="lines">@@ -1439,7 +1476,6 @@
</span><span class="cx">         [self setMode:NP_EMBED];
</span><span class="cx">     
</span><span class="cx">     _loadManually = loadManually;
</span><del>-    
</del><span class="cx">     return self;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1509,6 +1545,9 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)drawRect:(NSRect)rect
</span><span class="cx"> {
</span><ins>+    if (drawingModel == NPDrawingModelCoreAnimation)
+        return;
+
</ins><span class="cx">     if (!isStarted)
</span><span class="cx">         return;
</span><span class="cx">     
</span><span class="lines">@@ -2486,6 +2525,16 @@
</span><span class="cx">             return NPERR_NO_ERROR;
</span><span class="cx">         }
</span><span class="cx">         
</span><ins>+        case NPNVsupportsCoreAnimationBool:
+        {
+#ifdef BUILDING_ON_TIGER
+            *(NPBool *)value = FALSE;
+#else
+            *(NPBool *)value = TRUE;
+#endif
+            return NPERR_NO_ERROR;
+        }
+            
</ins><span class="cx"> #ifndef NP_NO_CARBON
</span><span class="cx">         case NPNVsupportsCarbonBool:
</span><span class="cx">         {
</span><span class="lines">@@ -2557,6 +2606,11 @@
</span><span class="cx">                 case NPDrawingModelCoreGraphics:
</span><span class="cx">                     drawingModel = newDrawingModel;
</span><span class="cx">                     return NPERR_NO_ERROR;
</span><ins>+                    
+                case NPDrawingModelCoreAnimation:
+                    drawingModel = newDrawingModel;
+                    return NPERR_NO_ERROR;
+                    
</ins><span class="cx"> 
</span><span class="cx">                 // Unsupported (or unknown) drawing models:
</span><span class="cx">                 default:
</span><span class="lines">@@ -2745,7 +2799,9 @@
</span><span class="cx">     if (drawingModel == NPDrawingModelQuickDraw)
</span><span class="cx">         [self tellQuickTimeToChill];
</span><span class="cx"> #endif
</span><del>-    [self updateAndSetWindow];
</del><ins>+    if (drawingModel == NPDrawingModelCoreGraphics || drawingModel == NPDrawingModelQuickDraw)
+        [self updateAndSetWindow];
+    
</ins><span class="cx">     [self resetTrackingRect];
</span><span class="cx">     
</span><span class="cx">     // Check to see if the plugin view is completely obscured (scrolled out of view, for example).
</span></span></pre>
</div>
</div>

</body>
</html>