Title: [93724] trunk/Tools
- Revision
- 93724
- Author
- commit-qu...@webkit.org
- Date
- 2011-08-24 13:04:44 -0700 (Wed, 24 Aug 2011)
Log Message
Crash when restoring NSGraphicsContext when running the Chromium GPU layout tests on Mac
https://bugs.webkit.org/show_bug.cgi?id=66875
Patch by Avi Drissman <a...@google.com> on 2011-08-24
Reviewed by James Robinson.
* DumpRenderTree/chromium/WebThemeEngineDRTMac.mm:
(WebThemeEngineDRTMac::paintNSScrollerScrollbarThumb):
Modified Paths
Diff
Modified: trunk/Tools/ChangeLog (93723 => 93724)
--- trunk/Tools/ChangeLog 2011-08-24 20:02:37 UTC (rev 93723)
+++ trunk/Tools/ChangeLog 2011-08-24 20:04:44 UTC (rev 93724)
@@ -1,3 +1,13 @@
+2011-08-24 Avi Drissman <a...@google.com>
+
+ Crash when restoring NSGraphicsContext when running the Chromium GPU layout tests on Mac
+ https://bugs.webkit.org/show_bug.cgi?id=66875
+
+ Reviewed by James Robinson.
+
+ * DumpRenderTree/chromium/WebThemeEngineDRTMac.mm:
+ (WebThemeEngineDRTMac::paintNSScrollerScrollbarThumb):
+
2011-08-23 Dimitri Glazkov <dglaz...@chromium.org>
Make notifications appear in time order again.
Modified: trunk/Tools/DumpRenderTree/chromium/WebThemeEngineDRTMac.mm (93723 => 93724)
--- trunk/Tools/DumpRenderTree/chromium/WebThemeEngineDRTMac.mm 2011-08-24 20:02:37 UTC (rev 93723)
+++ trunk/Tools/DumpRenderTree/chromium/WebThemeEngineDRTMac.mm 2011-08-24 20:04:44 UTC (rev 93724)
@@ -160,6 +160,7 @@
const WebRect& rect,
const WebThemeEngine::ScrollbarInfo& scrollbarInfo)
{
+ [NSGraphicsContext saveGraphicsState];
NSScroller* scroller = [[NSScroller alloc] initWithFrame:NSMakeRect(rect.x, rect.y, rect.width, rect.height)];
[scroller setEnabled:state != WebThemeEngine::StateDisabled];
if (state == WebThemeEngine::StateInactive)
@@ -175,7 +176,6 @@
float knobProportion = float(scrollbarInfo.visibleSize) / float(scrollbarInfo.totalSize);
[scroller setKnobProportion: knobProportion];
- NSGraphicsContext* previousGraphicsContext = [NSGraphicsContext currentContext];
#if WEBKIT_USING_SKIA
gfx::SkiaBitLocker bitLocker(canvas);
CGContextRef cgContext = bitLocker.cgContext();
@@ -188,15 +188,15 @@
// Despite passing in frameRect() to the scroller, it always draws at (0, 0).
// Force it to draw in the right location by translating the whole graphics
// context.
- [nsGraphicsContext saveGraphicsState];
+ CGContextSaveGState(cgContext);
NSAffineTransform *transform = [NSAffineTransform transform];
[transform translateXBy:rect.x yBy:rect.y];
[transform concat];
[scroller drawKnob];
+ CGContextRestoreGState(cgContext);
[scroller release];
- [nsGraphicsContext restoreGraphicsState];
- [NSGraphicsContext setCurrentContext:previousGraphicsContext];
+ [NSGraphicsContext restoreGraphicsState];
}
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes