Modified: trunk/Source/WebCore/platform/chromium/ScrollbarOverlayUtilitiesChromiumMac.h (89119 => 89120)
--- trunk/Source/WebCore/platform/chromium/ScrollbarOverlayUtilitiesChromiumMac.h 2011-06-17 06:03:49 UTC (rev 89119)
+++ trunk/Source/WebCore/platform/chromium/ScrollbarOverlayUtilitiesChromiumMac.h 2011-06-17 06:18:19 UTC (rev 89120)
@@ -57,8 +57,6 @@
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 (89119 => 89120)
--- trunk/Source/WebCore/platform/chromium/ScrollbarOverlayUtilitiesChromiumMac.mm 2011-06-17 06:03:49 UTC (rev 89119)
+++ trunk/Source/WebCore/platform/chromium/ScrollbarOverlayUtilitiesChromiumMac.mm 2011-06-17 06:18:19 UTC (rev 89120)
@@ -152,12 +152,6 @@
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];
@@ -170,10 +164,6 @@
frameRect.origin = NSZeroPoint;
[painter drawKnobSlotInRect:frameRect highlight:NO];
-}
-
-void wkScrollbarPainterPaintKnob(WKScrollbarPainterRef painter)
-{
[painter drawKnob];
}
Modified: trunk/Source/WebCore/platform/chromium/ScrollbarThemeChromiumMac.h (89119 => 89120)
--- trunk/Source/WebCore/platform/chromium/ScrollbarThemeChromiumMac.h 2011-06-17 06:03:49 UTC (rev 89119)
+++ trunk/Source/WebCore/platform/chromium/ScrollbarThemeChromiumMac.h 2011-06-17 06:18:19 UTC (rev 89120)
@@ -71,8 +71,6 @@
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 (89119 => 89120)
--- trunk/Source/WebCore/platform/chromium/ScrollbarThemeChromiumMac.mm 2011-06-17 06:03:49 UTC (rev 89119)
+++ trunk/Source/WebCore/platform/chromium/ScrollbarThemeChromiumMac.mm 2011-06-17 06:18:19 UTC (rev 89120)
@@ -479,16 +479,11 @@
context->clip(damageRect);
context->translate(scrollbar->frameRect().x(), scrollbar->frameRect().y());
LocalCurrentGraphicsContext localContext(context);
- 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);
+ wkScrollbarPainterPaint(scrollbarMap()->get(scrollbar).get(),
+ scrollbar->enabled(),
+ value,
+ (static_cast<CGFloat>(scrollbar->visibleSize()) - overhang) / scrollbar->totalSize(),
+ scrollbar->frameRect());
scrollAnimator->setIsDrawingIntoLayer(false);
return true;
@@ -549,40 +544,13 @@
#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);
- int alphaInt = 0xFF * alpha;
- drawingContext->setStrokeColor(Color(0xCC, 0xAA, 0x00, alphaInt), ColorSpaceDeviceRGB);
- drawingContext->setFillColor(Color(0xFF, 0xDD, 0x00, alphaInt), ColorSpaceDeviceRGB);
+ drawingContext->setStrokeColor(Color(0xCC, 0xAA, 0x00, 0xFF), ColorSpaceDeviceRGB);
+ drawingContext->setFillColor(Color(0xFF, 0xDD, 0x00, 0xFF), ColorSpaceDeviceRGB);
IntRect thumbArea = trackRect(scrollbar, false);
if (!canDrawDirectly) {
@@ -610,6 +578,28 @@
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;
}
}