Changeset 20152 in webkit
- Timestamp:
- Mar 13, 2007 11:22:43 AM (17 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r20151 r20152 1 2007-03-13 Darin Adler <darin@apple.com> 2 3 Reviewed by Tim Hatcher and John Sullivan. 4 5 - fix <rdar://problem/4915303> CrashTracer: 36 crashes in Safari at 6 com.apple.AppKit: -[NSView getRectsBeingDrawn:count:] + 502 7 8 * page/mac/FrameMac.mm: (WebCore::Frame::imageFromRect): 9 This was calling drawRect: directly, but NSView's getRectsBeingDrawn:count: 10 method was never really safe to call unless it was AppKit that called your 11 drawRect: method. Changed it to call drawSingleRect: instead. A little ugly, 12 but seems to work and will almost certainly fix the bug. 13 1 14 2007-03-13 Nikolas Zimmermann <zimmermann@kde.org> 2 15 -
trunk/WebCore/page/mac/FrameMac.mm
r20108 r20152 1 1 /* 2 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc.All rights reserved.2 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. 3 3 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com) 4 4 * Copyright (C) 2007 Trolltech ASA … … 100 100 @end 101 101 102 @interface NSView (WebCoreHTMLDocumentView) 103 - (void)drawSingleRect:(NSRect)rect; 104 @end 105 102 106 using namespace std; 103 107 using namespace KJS::Bindings; … … 325 329 if (!view) 326 330 return nil; 331 if (![view respondsToSelector:@selector(drawSingleRect:)]) 332 return nil; 327 333 328 334 NSImage* resultImage; … … 342 348 [resultImage setFlipped:YES]; 343 349 [resultImage lockFocus]; 344 345 350 CGContextRef context = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort]; 346 347 351 CGContextSaveGState(context); 348 352 CGContextTranslateCTM(context, bounds.origin.x - rect.origin.x, bounds.origin.y - rect.origin.y); 349 [view drawRect:rect]; 353 354 // Note: Must not call drawRect: here, because drawRect: assumes that it's called from AppKit's 355 // display machinery. It calls getRectsBeingDrawn:count:, which can only be called inside 356 // when a real AppKit display is underway. 357 [view drawSingleRect:rect]; 358 350 359 CGContextRestoreGState(context); 351 360 [resultImage unlockFocus];
Note: See TracChangeset
for help on using the changeset viewer.