Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(269)

Unified Diff: Source/platform/scroll/ScrollbarThemeMacNonOverlayAPI.mm

Issue 544913002: Fix scrollbar rendering on Mac 10.6 impl-side painting (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase and drop scroll-descendant-with-cached-cliprects.html b/c already has rebaseline needed Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(),
« no previous file with comments | « LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698