Modified: trunk/Source/WebCore/platform/chromium/ScrollbarOverlayUtilitiesChromiumMac.h (89072 => 89073)
--- trunk/Source/WebCore/platform/chromium/ScrollbarOverlayUtilitiesChromiumMac.h 2011-06-16 22:08:04 UTC (rev 89072)
+++ trunk/Source/WebCore/platform/chromium/ScrollbarOverlayUtilitiesChromiumMac.h 2011-06-16 22:08:11 UTC (rev 89073)
@@ -57,6 +57,8 @@
CGFloat wkScrollbarPainterKnobAlpha(WKScrollbarPainterRef);
void wkScrollbarPainterSetOverlayState(WKScrollbarPainterRef, int overlayScrollerState);
void wkScrollbarPainterPaint(WKScrollbarPainterRef, bool enabled, double value, CGFloat proportion, NSRect frameRect);
+void wkScrollbarPainterPaintTrack(WKScrollbarPainterRef, bool enabled, double value, CGFloat proportion, NSRect frameRect);
+void wkScrollbarPainterPaintKnob(WKScrollbarPainterRef);
int wkScrollbarMinimumThumbLength(WKScrollbarPainterRef);
void wkScrollbarPainterSetDelegate(WKScrollbarPainterRef, id scrollbarPainterDelegate);
CGFloat wkScrollbarPainterTrackAlpha(WKScrollbarPainterRef);
Modified: trunk/Source/WebCore/platform/chromium/ScrollbarOverlayUtilitiesChromiumMac.mm (89072 => 89073)
--- trunk/Source/WebCore/platform/chromium/ScrollbarOverlayUtilitiesChromiumMac.mm 2011-06-16 22:08:04 UTC (rev 89072)
+++ trunk/Source/WebCore/platform/chromium/ScrollbarOverlayUtilitiesChromiumMac.mm 2011-06-16 22:08:11 UTC (rev 89073)
@@ -152,6 +152,12 @@
void wkScrollbarPainterPaint(WKScrollbarPainterRef painter, bool enabled, double value, CGFloat proportion, NSRect frameRect)
{
+ wkScrollbarPainterPaintTrack(painter, enabled, value, proportion, frameRect);
+ wkScrollbarPainterPaintKnob(painter);
+}
+
+void wkScrollbarPainterPaintTrack(WKScrollbarPainterRef painter, bool enabled, double value, CGFloat proportion, NSRect frameRect)
+{
[painter setEnabled:enabled];
[painter setBoundsSize:frameRect.size];
[painter setDoubleValue:value];
@@ -164,6 +170,10 @@
frameRect.origin = NSZeroPoint;
[painter drawKnobSlotInRect:frameRect highlight:NO];
+}
+
+void wkScrollbarPainterPaintKnob(WKScrollbarPainterRef painter)
+{
[painter drawKnob];
}
Modified: trunk/Source/WebCore/platform/chromium/ScrollbarThemeChromiumMac.h (89072 => 89073)
--- trunk/Source/WebCore/platform/chromium/ScrollbarThemeChromiumMac.h 2011-06-16 22:08:04 UTC (rev 89072)
+++ trunk/Source/WebCore/platform/chromium/ScrollbarThemeChromiumMac.h 2011-06-16 22:08:11 UTC (rev 89073)
@@ -71,6 +71,8 @@
virtual bool shouldCenterOnThumb(Scrollbar*, const PlatformMouseEvent&);
virtual bool shouldDragDocumentInsteadOfThumb(Scrollbar*, const PlatformMouseEvent&);
+ void paintTickmarks(Scrollbar*, GraphicsContext* drawingContext, bool canDrawDirectly, float alpha);
+
public:
void preferencesChanged();
};
Modified: trunk/Source/WebCore/platform/chromium/ScrollbarThemeChromiumMac.mm (89072 => 89073)
--- trunk/Source/WebCore/platform/chromium/ScrollbarThemeChromiumMac.mm 2011-06-16 22:08:04 UTC (rev 89072)
+++ trunk/Source/WebCore/platform/chromium/ScrollbarThemeChromiumMac.mm 2011-06-16 22:08:11 UTC (rev 89073)
@@ -479,11 +479,16 @@
context->clip(damageRect);
context->translate(scrollbar->frameRect().x(), scrollbar->frameRect().y());
LocalCurrentGraphicsContext localContext(context);
- wkScrollbarPainterPaint(scrollbarMap()->get(scrollbar).get(),
- scrollbar->enabled(),
- value,
- (static_cast<CGFloat>(scrollbar->visibleSize()) - overhang) / scrollbar->totalSize(),
- scrollbar->frameRect());
+ WKScrollbarPainterRef scrollbarPainter = scrollbarMap()->get(scrollbar).get();
+ wkScrollbarPainterPaintTrack(scrollbarPainter,
+ scrollbar->enabled(),
+ value,
+ (static_cast<CGFloat>(scrollbar->visibleSize()) - overhang) / scrollbar->totalSize(),
+ scrollbar->frameRect());
+ CGFloat trackAlpha = wkScrollbarPainterTrackAlpha(scrollbarPainter);
+ if (trackAlpha >= 0.0)
+ paintTickmarks(scrollbar, context, false, trackAlpha);
+ wkScrollbarPainterPaintKnob(scrollbarPainter);
scrollAnimator->setIsDrawingIntoLayer(false);
return true;
@@ -544,13 +549,40 @@
#endif
HIThemeDrawTrack(&trackInfo, 0, cgContext, kHIThemeOrientationNormal);
+ paintTickmarks(scrollbar, drawingContext, canDrawDirectly, 1.0);
+
+ if (hasThumb(scrollbar)) {
+ PlatformBridge::ThemePaintScrollbarInfo scrollbarInfo;
+ scrollbarInfo.orientation = scrollbar->orientation() == HorizontalScrollbar ? PlatformBridge::ScrollbarOrientationHorizontal : PlatformBridge::ScrollbarOrientationVertical;
+ scrollbarInfo.parent = scrollbar->parent() && scrollbar->parent()->isFrameView() && static_cast<FrameView*>(scrollbar->parent())->isScrollViewScrollbar(scrollbar) ? PlatformBridge::ScrollbarParentScrollView : PlatformBridge::ScrollbarParentRenderLayer;
+ scrollbarInfo.maxValue = scrollbar->maximum();
+ scrollbarInfo.currentValue = scrollbar->currentPos();
+ scrollbarInfo.visibleSize = scrollbar->visibleSize();
+ scrollbarInfo.totalSize = scrollbar->totalSize();
+
+ PlatformBridge::paintScrollbarThumb(
+ drawingContext,
+ scrollbarStateToThemeState(scrollbar),
+ scrollbar->controlSize() == RegularScrollbar ? PlatformBridge::SizeRegular : PlatformBridge::SizeSmall,
+ scrollbar->frameRect(),
+ scrollbarInfo);
+ }
+
+ if (!canDrawDirectly)
+ context->drawImageBuffer(imageBuffer.get(), ColorSpaceDeviceRGB, scrollbar->frameRect().location());
+
+ return true;
+}
+
+void ScrollbarThemeChromiumMac::paintTickmarks(Scrollbar* scrollbar, GraphicsContext* drawingContext, bool canDrawDirectly, float alpha) {
Vector<IntRect> tickmarks;
scrollbar->scrollableArea()->getTickmarks(tickmarks);
if (scrollbar->orientation() == VerticalScrollbar && tickmarks.size()) {
drawingContext->save();
drawingContext->setShouldAntialias(false);
- drawingContext->setStrokeColor(Color(0xCC, 0xAA, 0x00, 0xFF), ColorSpaceDeviceRGB);
- drawingContext->setFillColor(Color(0xFF, 0xDD, 0x00, 0xFF), ColorSpaceDeviceRGB);
+ int alphaInt = 0xFF * alpha;
+ drawingContext->setStrokeColor(Color(0xCC, 0xAA, 0x00, alphaInt), ColorSpaceDeviceRGB);
+ drawingContext->setFillColor(Color(0xFF, 0xDD, 0x00, alphaInt), ColorSpaceDeviceRGB);
IntRect thumbArea = trackRect(scrollbar, false);
if (!canDrawDirectly) {
@@ -578,28 +610,6 @@
drawingContext->restore();
}
-
- if (hasThumb(scrollbar)) {
- PlatformBridge::ThemePaintScrollbarInfo scrollbarInfo;
- scrollbarInfo.orientation = scrollbar->orientation() == HorizontalScrollbar ? PlatformBridge::ScrollbarOrientationHorizontal : PlatformBridge::ScrollbarOrientationVertical;
- scrollbarInfo.parent = scrollbar->parent() && scrollbar->parent()->isFrameView() && static_cast<FrameView*>(scrollbar->parent())->isScrollViewScrollbar(scrollbar) ? PlatformBridge::ScrollbarParentScrollView : PlatformBridge::ScrollbarParentRenderLayer;
- scrollbarInfo.maxValue = scrollbar->maximum();
- scrollbarInfo.currentValue = scrollbar->currentPos();
- scrollbarInfo.visibleSize = scrollbar->visibleSize();
- scrollbarInfo.totalSize = scrollbar->totalSize();
-
- PlatformBridge::paintScrollbarThumb(
- drawingContext,
- scrollbarStateToThemeState(scrollbar),
- scrollbar->controlSize() == RegularScrollbar ? PlatformBridge::SizeRegular : PlatformBridge::SizeSmall,
- scrollbar->frameRect(),
- scrollbarInfo);
- }
-
- if (!canDrawDirectly)
- context->drawImageBuffer(imageBuffer.get(), ColorSpaceDeviceRGB, scrollbar->frameRect().location());
-
- return true;
}
}