Title: [87821] trunk/Source/WebCore
- Revision
- 87821
- Author
- [email protected]
- Date
- 2011-06-01 10:19:42 -0700 (Wed, 01 Jun 2011)
Log Message
2011-06-01 Cary Clark <[email protected]>
Reviewed by Eric Seidel.
Ready Chromium port for Skia on Mac
https://bugs.webkit.org/show_bug.cgi?id=61800
Skia on Mac is not enabled. The executing
code is unchanged, so there are no new tests.
* platform/chromium/DragImageRef.h:
Use Skia for DragImageRef instead of CG.
* platform/chromium/ScrollbarThemeChromiumMac.mm:
(WebCore::ScrollbarThemeChromiumMac::paint):
Get the total matrix from Skia for the scrollbar.
Convert the SkCanvas into a CGContext to draw.
* platform/chromium/ThemeChromiumMac.mm:
(WebCore::paintStepper):
Ditto.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (87820 => 87821)
--- trunk/Source/WebCore/ChangeLog 2011-06-01 17:08:50 UTC (rev 87820)
+++ trunk/Source/WebCore/ChangeLog 2011-06-01 17:19:42 UTC (rev 87821)
@@ -1,3 +1,25 @@
+2011-06-01 Cary Clark <[email protected]>
+
+ Reviewed by Eric Seidel.
+
+ Ready Chromium port for Skia on Mac
+ https://bugs.webkit.org/show_bug.cgi?id=61800
+
+ Skia on Mac is not enabled. The executing
+ code is unchanged, so there are no new tests.
+
+ * platform/chromium/DragImageRef.h:
+ Use Skia for DragImageRef instead of CG.
+
+ * platform/chromium/ScrollbarThemeChromiumMac.mm:
+ (WebCore::ScrollbarThemeChromiumMac::paint):
+ Get the total matrix from Skia for the scrollbar.
+ Convert the SkCanvas into a CGContext to draw.
+
+ * platform/chromium/ThemeChromiumMac.mm:
+ (WebCore::paintStepper):
+ Ditto.
+
2011-06-01 Yury Semikhatsky <[email protected]>
Reviewed by Pavel Feldman.
Modified: trunk/Source/WebCore/platform/chromium/DragImageRef.h (87820 => 87821)
--- trunk/Source/WebCore/platform/chromium/DragImageRef.h 2011-06-01 17:08:50 UTC (rev 87820)
+++ trunk/Source/WebCore/platform/chromium/DragImageRef.h 2011-06-01 17:19:42 UTC (rev 87821)
@@ -29,7 +29,7 @@
#ifndef DragImageRef_h
#define DragImageRef_h
-#if OS(DARWIN)
+#if OS(DARWIN) && !USE(SKIA_ON_MAC_CHROME)
typedef struct CGImage* CGImageRef;
#else
class SkBitmap;
@@ -37,7 +37,7 @@
namespace WebCore {
-#if OS(DARWIN)
+#if OS(DARWIN) && !USE(SKIA_ON_MAC_CHROME)
typedef CGImageRef DragImageRef;
#else
typedef SkBitmap* DragImageRef;
Modified: trunk/Source/WebCore/platform/chromium/ScrollbarThemeChromiumMac.mm (87820 => 87821)
--- trunk/Source/WebCore/platform/chromium/ScrollbarThemeChromiumMac.mm 2011-06-01 17:08:50 UTC (rev 87820)
+++ trunk/Source/WebCore/platform/chromium/ScrollbarThemeChromiumMac.mm 2011-06-01 17:19:42 UTC (rev 87821)
@@ -36,6 +36,10 @@
#include <wtf/StdLibExtras.h>
#include <wtf/UnusedParam.h>
+#if USE(SKIA)
+#include "PlatformContextSkia.h"
+#include "skia/ext/skia_utils_mac.h"
+#endif
// FIXME: There are repainting problems due to Aqua scroll bar buttons' visual overflow.
@@ -404,7 +408,12 @@
trackInfo.enableState = kThemeTrackNothingToScroll;
trackInfo.trackInfo.scrollbar.pressState = scrollbarPartToHIPressedState(scrollbar->pressedPart());
+#if USE(SKIA)
+ SkCanvas* canvas = context->platformContext()->canvas();
+ CGAffineTransform currentCTM = gfx::SkMatrixToCGAffineTransform(canvas->getTotalMatrix());
+#else
CGAffineTransform currentCTM = CGContextGetCTM(context->platformContext());
+#endif
// The Aqua scrollbar is buggy when rotated and scaled. We will just draw into a bitmap if we detect a scale or rotation.
bool canDrawDirectly = currentCTM.a == 1.0f && currentCTM.b == 0.0f && currentCTM.c == 0.0f && (currentCTM.d == 1.0f || currentCTM.d == -1.0f);
@@ -425,7 +434,13 @@
}
// Draw thumbless.
- HIThemeDrawTrack(&trackInfo, 0, drawingContext->platformContext(), kHIThemeOrientationNormal);
+#if USE(SKIA)
+ gfx::SkiaBitLocker bitLocker(drawingContext->platformContext()->canvas());
+ CGContextRef cgContext = bitLocker.cgContext();
+#else
+ CGContextRef cgContext = drawingContext->platformContext();
+#endif
+ HIThemeDrawTrack(&trackInfo, 0, cgContext, kHIThemeOrientationNormal);
Vector<IntRect> tickmarks;
scrollbar->scrollableArea()->getTickmarks(tickmarks);
Modified: trunk/Source/WebCore/platform/chromium/ThemeChromiumMac.mm (87820 => 87821)
--- trunk/Source/WebCore/platform/chromium/ThemeChromiumMac.mm 2011-06-01 17:08:50 UTC (rev 87820)
+++ trunk/Source/WebCore/platform/chromium/ThemeChromiumMac.mm 2011-06-01 17:19:42 UTC (rev 87821)
@@ -36,6 +36,11 @@
#include <wtf/StdLibExtras.h>
#import <objc/runtime.h>
+#if USE(SKIA)
+#include "PlatformContextSkia.h"
+#include "skia/ext/skia_utils_mac.h"
+#endif
+
using namespace std;
// This file (and its associated .h file) is a clone of ThemeMac.mm.
@@ -652,7 +657,13 @@
bounds.origin.x += bounds.origin.x - backgroundBounds.origin.x;
if (bounds.origin.y != backgroundBounds.origin.y)
bounds.origin.y += bounds.origin.y - backgroundBounds.origin.y;
- HIThemeDrawButton(&bounds, &drawInfo, context->platformContext(), kHIThemeOrientationNormal, 0);
+#if USE(SKIA)
+ gfx::SkiaBitLocker bitLocker(context->platformContext()->canvas());
+ CGContextRef cgContext = bitLocker.cgContext();
+#else
+ CGContextRef cgContext = context->platformContext();
+#endif
+ HIThemeDrawButton(&bounds, &drawInfo, cgContext, kHIThemeOrientationNormal, 0);
context->restore();
}
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes