Title: [93653] trunk/Tools
Revision
93653
Author
[email protected]
Date
2011-08-23 16:18:34 -0700 (Tue, 23 Aug 2011)

Log Message

Turn WebCanvas into CGContext before drawing scrollbar (DRT using Skia on Mac)
https://bugs.webkit.org/show_bug.cgi?id=66803

This fixes the WebKit Canaries, in particular avoids a crash on tests
like css1/basic/comments.html.

Reviewed by James Robinson.

* DumpRenderTree/chromium/WebThemeEngineDRTMac.mm:
(WebThemeEngineDRTMac::paintNSScrollerScrollbarThumb):
The NSGraphicsContext call graphicsContextWithGraphicsPort takes a void*
parameter, so it took a WebCanvas* (mapped to SkCanvas* in Skia-land)
and treated it as if it were a CGContextRef.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (93652 => 93653)


--- trunk/Tools/ChangeLog	2011-08-23 23:12:27 UTC (rev 93652)
+++ trunk/Tools/ChangeLog	2011-08-23 23:18:34 UTC (rev 93653)
@@ -1,3 +1,19 @@
+2011-08-23  Cary Clark  <[email protected]>
+
+        Turn WebCanvas into CGContext before drawing scrollbar (DRT using Skia on Mac)
+        https://bugs.webkit.org/show_bug.cgi?id=66803
+
+        This fixes the WebKit Canaries, in particular avoids a crash on tests
+        like css1/basic/comments.html.
+
+        Reviewed by James Robinson.
+
+        * DumpRenderTree/chromium/WebThemeEngineDRTMac.mm:
+        (WebThemeEngineDRTMac::paintNSScrollerScrollbarThumb):
+        The NSGraphicsContext call graphicsContextWithGraphicsPort takes a void*
+        parameter, so it took a WebCanvas* (mapped to SkCanvas* in Skia-land)
+        and treated it as if it were a CGContextRef.
+
 2011-08-23  Patrick Gansterer  <[email protected]>
 
         Fix mergeChangeLogs test on native windows

Modified: trunk/Tools/DumpRenderTree/chromium/WebThemeEngineDRTMac.mm (93652 => 93653)


--- trunk/Tools/DumpRenderTree/chromium/WebThemeEngineDRTMac.mm	2011-08-23 23:12:27 UTC (rev 93652)
+++ trunk/Tools/DumpRenderTree/chromium/WebThemeEngineDRTMac.mm	2011-08-23 23:18:34 UTC (rev 93653)
@@ -176,7 +176,13 @@
     [scroller setKnobProportion: knobProportion];
 
     NSGraphicsContext* previousGraphicsContext = [NSGraphicsContext currentContext];
-    NSGraphicsContext* nsGraphicsContext = [NSGraphicsContext graphicsContextWithGraphicsPort:canvas flipped:YES];
+#if WEBKIT_USING_SKIA
+    gfx::SkiaBitLocker bitLocker(canvas);
+    CGContextRef cgContext = bitLocker.cgContext();
+#else
+    CGContextRef cgContext = canvas;
+#endif
+    NSGraphicsContext* nsGraphicsContext = [NSGraphicsContext graphicsContextWithGraphicsPort:cgContext flipped:YES];
     [NSGraphicsContext setCurrentContext:nsGraphicsContext];
 
     // Despite passing in frameRect() to the scroller, it always draws at (0, 0).
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to