[webkit-changes] cvs commit: WebKit/Plugins.subproj WebBaseNetscapePluginView.m

Adele adele at opensource.apple.com
Mon Aug 8 16:51:48 PDT 2005


adele       05/08/08 16:51:47

  Modified:    .        Tag: Safari-2-0-branch ChangeLog
               Plugins.subproj Tag: Safari-2-0-branch
                        WebBaseNetscapePluginView.m
  Log:
          Merged fix from TOT to Safari-2-0-branch
  
      2005-08-04  Justin Garcia  <justin.garcia at apple.com>
  
          Reviewed by darin
  
          Fix for:
          <rdar://problem/3167884> Shockwave: 3D sprites rendered in OpenGL draw over the browser (3447)
          also as <http://bugzilla.opendarwin.org/show_bug.cgi?id=3447>
  
          The WindowRef created by -[NSWindow windowRef] has a QuickDraw GrafPort that covers
          the entire window frame (or structure region in Carbon parlance) rather then just the window content.
  
          We filed this as an NSWindow bug <rdar://problem/4201099>
  
          To work around, we modify the CGrafPort to only cover the content area before we let the plug-in draw.
  
          * Plugins.subproj/WebBaseNetscapePluginView.m:
          (-[WebBaseNetscapePluginView fixWindowPort]):
          (-[WebBaseNetscapePluginView saveAndSetPortStateForUpdate:]):
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.3118.4.36 +23 -0     WebKit/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebKit/ChangeLog,v
  retrieving revision 1.3118.4.35
  retrieving revision 1.3118.4.36
  diff -u -r1.3118.4.35 -r1.3118.4.36
  --- ChangeLog	6 Aug 2005 01:37:00 -0000	1.3118.4.35
  +++ ChangeLog	8 Aug 2005 23:51:43 -0000	1.3118.4.36
  @@ -1,3 +1,26 @@
  +2005-08-08  Adele Peterson  <adele at apple.com>
  +
  +        Merged fix from TOT to Safari-2-0-branch
  +
  +    2005-08-04  Justin Garcia  <justin.garcia at apple.com>
  +
  +        Reviewed by darin
  +
  +        Fix for:
  +        <rdar://problem/3167884> Shockwave: 3D sprites rendered in OpenGL draw over the browser (3447)
  +        also as <http://bugzilla.opendarwin.org/show_bug.cgi?id=3447>
  +
  +        The WindowRef created by -[NSWindow windowRef] has a QuickDraw GrafPort that covers
  +        the entire window frame (or structure region in Carbon parlance) rather then just the window content.
  +
  +        We filed this as an NSWindow bug <rdar://problem/4201099>
  +
  +        To work around, we modify the CGrafPort to only cover the content area before we let the plug-in draw.
  +
  +        * Plugins.subproj/WebBaseNetscapePluginView.m:
  +        (-[WebBaseNetscapePluginView fixWindowPort]):
  +        (-[WebBaseNetscapePluginView saveAndSetPortStateForUpdate:]):
  +
   === Safari-416 ===
   
   2005-08-05  Adele Peterson  <adele at apple.com>
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.127.8.2 +29 -2     WebKit/Plugins.subproj/WebBaseNetscapePluginView.m
  
  Index: WebBaseNetscapePluginView.m
  ===================================================================
  RCS file: /cvs/root/WebKit/Plugins.subproj/WebBaseNetscapePluginView.m,v
  retrieving revision 1.127.8.1
  retrieving revision 1.127.8.2
  diff -u -r1.127.8.1 -r1.127.8.2
  --- WebBaseNetscapePluginView.m	12 Jul 2005 18:23:37 -0000	1.127.8.1
  +++ WebBaseNetscapePluginView.m	8 Aug 2005 23:51:47 -0000	1.127.8.2
  @@ -38,6 +38,8 @@
   // This is not yet in QuickdrawPriv.h, although it's supposed to be.
   void CallDrawingNotifications(CGrafPtr port, Rect *mayDrawIntoThisRect, int drawingType);
   
  +#import <objc/objc-runtime.h>
  +
   // Send null events 50 times a second when active, so plug-ins like Flash get high frame rates.
   #define NullEventIntervalActive 	0.02
   #define NullEventIntervalNotActive	0.25
  @@ -171,13 +173,38 @@
       return NO;
   }
   
  +// The WindowRef created by -[NSWindow windowRef] has a QuickDraw GrafPort that covers 
  +// the entire window frame (or structure region to use the Carbon term) rather then just the window content.
  +// We can remove this when <rdar://problem/4201099> is fixed.
  +- (void)fixWindowPort
  +{
  +    NSWindow *currentWindow = [self currentWindow];
  +    if ([currentWindow isKindOfClass:objc_getClass("NSCarbonWindow")])
  +        return;
  +    
  +    float windowHeight = [currentWindow frame].size.height;
  +    NSView *contentView = [currentWindow contentView];
  +    NSRect contentRect = [contentView convertRect:[contentView frame] toView:nil]; // convert to window-relative coordinates
  +    
  +    CGrafPtr oldPort;
  +    GetPort(&oldPort);    
  +    SetPort(GetWindowPort([currentWindow windowRef]));
  +    
  +    MovePortTo(contentRect.origin.x, /* Flip Y */ windowHeight - NSMaxY(contentRect));
  +    PortSize(contentRect.size.width, contentRect.size.height);
  +    
  +    SetPort(oldPort);
  +}
  +
   - (PortState)saveAndSetPortStateForUpdate:(BOOL)forUpdate
   {
       ASSERT([self currentWindow] != nil);
  -    
  + 
  +    [self fixWindowPort];
  +   
       WindowRef windowRef = [[self currentWindow] windowRef];
       CGrafPtr port = GetWindowPort(windowRef);
  -
  +        
       Rect portBounds;
       GetPortBounds(port, &portBounds);
   
  
  
  



More information about the webkit-changes mailing list