Title: [88015] trunk/Tools
- Revision
- 88015
- Author
- [email protected]
- Date
- 2011-06-03 07:39:52 -0700 (Fri, 03 Jun 2011)
Log Message
2011-06-03 Cary Clark <[email protected]>
Reviewed by Eric Seidel.
Draw DRT scroll bar thumb with CG when WebKit renders with Skia
https://bugs.webkit.org/show_bug.cgi?id=61534
Skia on Mac uses Skia to render WebKit, and CG
to render UI elements. The CG elements need a
transcribed graphics context that preserves the
canvas matrix, and the canvas clip.
The SkiaBitLocker utility class sets up a CGContext
from the SkCanvas, locks the bitmap's bits, and
releases the lock when the class goes out of scope.
The SkiaBitLocker implementation is described by
this patch:
http://codereview.chromium.org/7031006/
When WebKit uses Skia for rendering, the WebCanvas
is an SkCanvas. Create an equivalent CGContext to
draw the scrollbar thumb.
As the Chrome Mac port does not yet use Skia, this
patch has no effect and requires no tests.
* DumpRenderTree/chromium/WebThemeEngineDRTMac.mm:
(WebThemeEngineDRTMac::paintHIThemeScrollbarThumb):
Modified Paths
Diff
Modified: trunk/Tools/ChangeLog (88014 => 88015)
--- trunk/Tools/ChangeLog 2011-06-03 14:17:42 UTC (rev 88014)
+++ trunk/Tools/ChangeLog 2011-06-03 14:39:52 UTC (rev 88015)
@@ -1,3 +1,33 @@
+2011-06-03 Cary Clark <[email protected]>
+
+ Reviewed by Eric Seidel.
+
+ Draw DRT scroll bar thumb with CG when WebKit renders with Skia
+ https://bugs.webkit.org/show_bug.cgi?id=61534
+
+ Skia on Mac uses Skia to render WebKit, and CG
+ to render UI elements. The CG elements need a
+ transcribed graphics context that preserves the
+ canvas matrix, and the canvas clip.
+
+ The SkiaBitLocker utility class sets up a CGContext
+ from the SkCanvas, locks the bitmap's bits, and
+ releases the lock when the class goes out of scope.
+
+ The SkiaBitLocker implementation is described by
+ this patch:
+ http://codereview.chromium.org/7031006/
+
+ When WebKit uses Skia for rendering, the WebCanvas
+ is an SkCanvas. Create an equivalent CGContext to
+ draw the scrollbar thumb.
+
+ As the Chrome Mac port does not yet use Skia, this
+ patch has no effect and requires no tests.
+
+ * DumpRenderTree/chromium/WebThemeEngineDRTMac.mm:
+ (WebThemeEngineDRTMac::paintHIThemeScrollbarThumb):
+
2011-06-03 Andras Becsi <[email protected]>
Unreviewed build fix.
Modified: trunk/Tools/DumpRenderTree/chromium/WebThemeEngineDRTMac.mm (88014 => 88015)
--- trunk/Tools/DumpRenderTree/chromium/WebThemeEngineDRTMac.mm 2011-06-03 14:17:42 UTC (rev 88014)
+++ trunk/Tools/DumpRenderTree/chromium/WebThemeEngineDRTMac.mm 2011-06-03 14:39:52 UTC (rev 88015)
@@ -38,6 +38,10 @@
#import <AppKit/NSWindow.h>
#include <Carbon/Carbon.h>
+#if WEBKIT_USING_SKIA
+#include "skia/ext/skia_utils_mac.h"
+#endif
+
using WebKit::WebCanvas;
using WebKit::WebRect;
using WebKit::WebThemeEngine;
@@ -140,7 +144,13 @@
trackInfo.trackInfo.scrollbar.pressState =
state == WebThemeEngine::StatePressed ? kThemeThumbPressed : 0;
trackInfo.attributes |= (kThemeTrackShowThumb | kThemeTrackHideTrack);
- HIThemeDrawTrack(&trackInfo, 0, canvas, kHIThemeOrientationNormal);
+#if WEBKIT_USING_SKIA
+ gfx::SkiaBitLocker bitLocker(canvas);
+ CGContextRef cgContext = bitLocker.cgContext();
+#else
+ CGContextRef cgContext = canvas;
+#endif
+ HIThemeDrawTrack(&trackInfo, 0, cgContext, kHIThemeOrientationNormal);
}
void WebThemeEngineDRTMac::paintNSScrollerScrollbarThumb(
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes