| Index: Source/platform/scroll/ScrollbarThemeMacNonOverlayAPI.mm
|
| diff --git a/Source/platform/scroll/ScrollbarThemeMacNonOverlayAPI.mm b/Source/platform/scroll/ScrollbarThemeMacNonOverlayAPI.mm
|
| index d63ab2d11f4797dae6b787daa86a76f4112e618e..fd697e60eb223524f204ff30ef9fbcfe675edacc 100644
|
| --- a/Source/platform/scroll/ScrollbarThemeMacNonOverlayAPI.mm
|
| +++ b/Source/platform/scroll/ScrollbarThemeMacNonOverlayAPI.mm
|
| @@ -71,18 +71,6 @@ void ScrollbarThemeMacNonOverlayAPI::updateButtonPlacement()
|
| }
|
| }
|
|
|
| -static blink::WebThemeEngine::State scrollbarStateToThemeState(ScrollbarThemeClient* scrollbar)
|
| -{
|
| - if (!scrollbar->enabled())
|
| - return blink::WebThemeEngine::StateDisabled;
|
| - if (!scrollbar->isScrollableAreaActive())
|
| - return blink::WebThemeEngine::StateInactive;
|
| - if (scrollbar->pressedPart() == ThumbPart)
|
| - return blink::WebThemeEngine::StatePressed;
|
| -
|
| - return blink::WebThemeEngine::StateActive;
|
| -}
|
| -
|
| // Override ScrollbarThemeMacCommon::paint() to add support for the following:
|
| // - drawing using WebThemeEngine functions
|
| // - drawing tickmarks
|
| @@ -101,7 +89,8 @@ bool ScrollbarThemeMacNonOverlayAPI::paint(ScrollbarThemeClient* scrollbar, Grap
|
| trackInfo.max = scrollbar->maximum();
|
| trackInfo.value = scrollbar->currentPos();
|
| trackInfo.trackInfo.scrollbar.viewsize = scrollbar->visibleSize();
|
| - trackInfo.attributes = 0;
|
| + trackInfo.attributes = hasThumb(scrollbar) ? kThemeTrackShowThumb : 0;
|
| +
|
| if (scrollbar->orientation() == HorizontalScrollbar)
|
| trackInfo.attributes |= kThemeTrackHorizontal;
|
|
|
| @@ -135,7 +124,7 @@ bool ScrollbarThemeMacNonOverlayAPI::paint(ScrollbarThemeClient* scrollbar, Grap
|
| drawingContext = imageBuffer->context();
|
| }
|
|
|
| - // Draw thumbless.
|
| + // Draw the track and its thumb.
|
| gfx::SkiaBitLocker bitLocker(drawingContext->canvas(), ThemeMac::inflateRectForAA(scrollbar->frameRect()));
|
| CGContextRef cgContext = bitLocker.cgContext();
|
| HIThemeDrawTrack(&trackInfo, 0, cgContext, kHIThemeOrientationNormal);
|
| @@ -152,24 +141,6 @@ bool ScrollbarThemeMacNonOverlayAPI::paint(ScrollbarThemeClient* scrollbar, Grap
|
| tickmarkTrackRect.setWidth(tickmarkTrackRect.width() - 5);
|
| paintGivenTickmarks(drawingContext, scrollbar, tickmarkTrackRect, tickmarks);
|
|
|
| - if (hasThumb(scrollbar)) {
|
| - blink::WebThemeEngine::ScrollbarInfo scrollbarInfo;
|
| - scrollbarInfo.orientation = scrollbar->orientation() == HorizontalScrollbar ? blink::WebThemeEngine::ScrollbarOrientationHorizontal : blink::WebThemeEngine::ScrollbarOrientationVertical;
|
| - scrollbarInfo.parent = scrollbar->isScrollViewScrollbar() ? blink::WebThemeEngine::ScrollbarParentScrollView : blink::WebThemeEngine::ScrollbarParentRenderLayer;
|
| - scrollbarInfo.maxValue = scrollbar->maximum();
|
| - scrollbarInfo.currentValue = scrollbar->currentPos();
|
| - scrollbarInfo.visibleSize = scrollbar->visibleSize();
|
| - scrollbarInfo.totalSize = scrollbar->totalSize();
|
| -
|
| - blink::WebCanvas* webCanvas = drawingContext->canvas();
|
| - blink::Platform::current()->themeEngine()->paintScrollbarThumb(
|
| - webCanvas,
|
| - scrollbarStateToThemeState(scrollbar),
|
| - scrollbar->controlSize() == RegularScrollbar ? blink::WebThemeEngine::SizeRegular : blink::WebThemeEngine::SizeSmall,
|
| - blink::WebRect(scrollbar->frameRect()),
|
| - scrollbarInfo);
|
| - }
|
| -
|
| if (!canDrawDirectly) {
|
| ASSERT(imageBuffer);
|
| context->drawImageBuffer(imageBuffer.get(),
|
|
|