Changeset 21322 in webkit
- Timestamp:
- May 8, 2007 9:09:24 PM (17 years ago)
- Location:
- trunk/WebKit
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit/ChangeLog
r21318 r21322 1 2007-05-08 Bruce Q Hammond <bruceq@apple.com> 2 3 Reviewed by Darin. 4 5 http://bugs.webkit.org/show_bug.cgi?id=13578 6 Bug 13578: When QD plugins draw to an offscreen bitmap the origin is not correct 7 8 Now we have correct handling of the origin when QD plugins draw to 9 offscreen bitmaps. 10 Also the clipping code for this path was doing unnecessary work which 11 caused incorrect results; it has been removed. 12 13 This change should not affect Safari and in general will only affect 14 plugins (e.g. Flash) drawing to a CGBitmapContext. 15 16 * Plugins/WebBaseNetscapePluginView.mm: 17 (-[WebBaseNetscapePluginView saveAndSetNewPortStateForUpdate:]): 18 1 19 2007-05-08 Steve Falkenburg <sfalken@apple.com> 2 20 … … 1918 1936 (HIWebViewEventHandler): Don't leak the NSEvent. 1919 1937 1920 2007-03-08 Bruce Q Hammond <bruceq@apple. om>1938 2007-03-08 Bruce Q Hammond <bruceq@apple.com> 1921 1939 1922 1940 Reviewed by Darin. -
trunk/WebKit/Plugins/WebBaseNetscapePluginView.mm
r21223 r21322 445 445 nPort.qdPort.port = port; 446 446 boundsInWindow = [self bounds]; 447 nPort.qdPort.portx = (int32)-boundsInWindow.origin.x; 448 nPort.qdPort.porty = (int32)-boundsInWindow.origin.y; 447 448 // Generate a QD origin based on the current affine transform for currentContext. 449 CGAffineTransform offscreenMatrix = CGContextGetCTM(currentContext); 450 CGPoint origin = {0,0}; 451 CGPoint axisFlip = {1,1}; 452 origin = CGPointApplyAffineTransform(origin, offscreenMatrix); 453 axisFlip = CGPointApplyAffineTransform(axisFlip, offscreenMatrix); 454 455 // Quartz bitmaps have origins at the bottom left, but the axes may be inverted, so handle that. 456 origin.x = offscreenBounds.left - origin.x * (axisFlip.x - origin.x); 457 origin.y = offscreenBounds.bottom + origin.y * (axisFlip.y - origin.y); 458 459 nPort.qdPort.portx = (int32)-boundsInWindow.origin.x + origin.x; 460 nPort.qdPort.porty = (int32)-boundsInWindow.origin.y + origin.y; 449 461 window.x = 0; 450 462 window.y = 0; … … 464 476 // Clip to dirty region so plug-in does not draw over already-drawn regions of the window that are 465 477 // not going to be redrawn this update. This forces plug-ins to play nice with z-index ordering. 466 Rect clipBounds;467 478 if (forUpdate) { 468 479 RgnHandle viewClipRegion = NewRgn(); … … 492 503 SectRgn(clipRegion, viewClipRegion, clipRegion); 493 504 DisposeRgn(viewClipRegion); 494 if (port == offscreenGWorld) {495 GetRegionBounds(clipRegion, &clipBounds);496 OffsetRgn(clipRegion, -clipBounds.left, -clipBounds.top);497 }498 505 } 499 506 … … 511 518 // We reset the port's visible region to counteract what BeginUpdate did. 512 519 SetPortVisibleRegion(nPort.qdPort.port, clipRegion); 513 514 // Some plugins do their own BeginUpdate/EndUpdate.515 // For those, we must make sure that the update region contains the area we want to draw.516 if (port == offscreenGWorld)517 OffsetRgn(clipRegion, clipBounds.left, clipBounds.top);518 520 InvalWindowRgn(windowRef, clipRegion); 519 521 }
Note: See TracChangeset
for help on using the changeset viewer.