void PaintInvalidationCapableScrollableArea::willRemoveScrollbar(Scrollbar& scrollbar, ScrollbarOrientation orientation) { if (!scrollbar.isCustomScrollbar() && !(orientation == HorizontalScrollbar ? layerForHorizontalScrollbar() : layerForVerticalScrollbar())) boxForScrollControlPaintInvalidation().invalidateDisplayItemClient(scrollbar); ScrollableArea::willRemoveScrollbar(scrollbar, orientation); }
void FramePainter::paintScrollbar(GraphicsContext& context, Scrollbar& bar, const IntRect& rect) { bool needsBackground = bar.isCustomScrollbar() && frameView().frame().isMainFrame(); if (needsBackground) { IntRect toFill = bar.frameRect(); toFill.intersect(rect); context.fillRect(toFill, frameView().baseBackgroundColor()); } bar.paint(context, CullRect(rect)); }
void ScrollingCoordinatorChromium::scrollableAreaScrollbarLayerDidChange(ScrollableArea* scrollableArea, ScrollbarOrientation orientation) { #if OS(DARWIN) static const bool platformSupportsCoordinatedScrollbar = false; static const bool platformSupportsMainFrameOnly = false; // Don't care. #elif OS(WINDOWS) static const bool platformSupportsCoordinatedScrollbar = true; static const bool platformSupportsMainFrameOnly = true; #else static const bool platformSupportsCoordinatedScrollbar = true; static const bool platformSupportsMainFrameOnly = false; #endif if (!platformSupportsCoordinatedScrollbar) return; bool isMainFrame = (scrollableArea == static_cast<ScrollableArea*>(m_page->mainFrame()->view())); if (!isMainFrame && platformSupportsMainFrameOnly) return; GraphicsLayer* scrollbarGraphicsLayer = orientation == HorizontalScrollbar ? horizontalScrollbarLayerForScrollableArea(scrollableArea) : verticalScrollbarLayerForScrollableArea(scrollableArea); if (scrollbarGraphicsLayer) { Scrollbar* scrollbar = orientation == HorizontalScrollbar ? scrollableArea->horizontalScrollbar() : scrollableArea->verticalScrollbar(); if (scrollbar->isCustomScrollbar()) { detachScrollbarLayer(scrollbarGraphicsLayer); return; } WebScrollbarLayer* scrollbarLayer = getWebScrollbarLayer(scrollableArea, orientation); if (!scrollbarLayer) scrollbarLayer = addWebScrollbarLayer(scrollableArea, orientation, createScrollbarLayer(scrollbar)); // Root layer non-overlay scrollbars should be marked opaque to disable // blending. bool isOpaqueScrollbar = !scrollbar->isOverlayScrollbar(); if (!scrollbarGraphicsLayer->contentsOpaque()) scrollbarGraphicsLayer->setContentsOpaque(isMainFrame && isOpaqueScrollbar); scrollbarLayer->layer()->setOpaque(scrollbarGraphicsLayer->contentsOpaque()); setupScrollbarLayer(scrollbarGraphicsLayer, scrollbarLayer, scrollingWebLayerForScrollableArea(scrollableArea)); } else removeWebScrollbarLayer(scrollableArea, orientation); }