OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "core/paint/ScrollableAreaPainter.h" | 5 #include "core/paint/ScrollableAreaPainter.h" |
6 | 6 |
7 #include "core/layout/LayoutView.h" | 7 #include "core/layout/LayoutView.h" |
8 #include "core/page/Page.h" | 8 #include "core/page/Page.h" |
9 #include "core/paint/LayoutObjectDrawingRecorder.h" | 9 #include "core/paint/LayoutObjectDrawingRecorder.h" |
10 #include "core/paint/ObjectPaintProperties.h" | 10 #include "core/paint/ObjectPaintProperties.h" |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 if (paintingOverlayControls && !getScrollableArea().hasOverlayScrollbars()) | 126 if (paintingOverlayControls && !getScrollableArea().hasOverlayScrollbars()) |
127 return; | 127 return; |
128 | 128 |
129 { | 129 { |
130 Optional<ScopedPaintChunkProperties> scopedTransformProperty; | 130 Optional<ScopedPaintChunkProperties> scopedTransformProperty; |
131 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { | 131 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { |
132 const auto* objectProperties = getScrollableArea().box().objectPaint
Properties(); | 132 const auto* objectProperties = getScrollableArea().box().objectPaint
Properties(); |
133 if (objectProperties && objectProperties->scrollbarPaintOffset()) { | 133 if (objectProperties && objectProperties->scrollbarPaintOffset()) { |
134 PaintChunkProperties properties(context.getPaintController().cur
rentPaintChunkProperties()); | 134 PaintChunkProperties properties(context.getPaintController().cur
rentPaintChunkProperties()); |
135 properties.transform = objectProperties->scrollbarPaintOffset(); | 135 properties.transform = objectProperties->scrollbarPaintOffset(); |
136 scopedTransformProperty.emplace(context.getPaintController(), pr
operties); | 136 scopedTransformProperty.emplace(context.getPaintController(), ge
tScrollableArea().box(), DisplayItem::ScrollOverflowControls, properties); |
137 } | 137 } |
138 } | 138 } |
139 if (getScrollableArea().horizontalScrollbar() && !getScrollableArea().la
yerForHorizontalScrollbar()) { | 139 if (getScrollableArea().horizontalScrollbar() && !getScrollableArea().la
yerForHorizontalScrollbar()) { |
140 TransformRecorder translateRecorder(context, *getScrollableArea().ho
rizontalScrollbar(), AffineTransform::translation(adjustedPaintOffset.x(), adjus
tedPaintOffset.y())); | 140 TransformRecorder translateRecorder(context, *getScrollableArea().ho
rizontalScrollbar(), AffineTransform::translation(adjustedPaintOffset.x(), adjus
tedPaintOffset.y())); |
141 getScrollableArea().horizontalScrollbar()->paint(context, adjustedCu
llRect); | 141 getScrollableArea().horizontalScrollbar()->paint(context, adjustedCu
llRect); |
142 } | 142 } |
143 if (getScrollableArea().verticalScrollbar() && !getScrollableArea().laye
rForVerticalScrollbar()) { | 143 if (getScrollableArea().verticalScrollbar() && !getScrollableArea().laye
rForVerticalScrollbar()) { |
144 TransformRecorder translateRecorder(context, *getScrollableArea().ve
rticalScrollbar(), AffineTransform::translation(adjustedPaintOffset.x(), adjuste
dPaintOffset.y())); | 144 TransformRecorder translateRecorder(context, *getScrollableArea().ve
rticalScrollbar(), AffineTransform::translation(adjustedPaintOffset.x(), adjuste
dPaintOffset.y())); |
145 getScrollableArea().verticalScrollbar()->paint(context, adjustedCull
Rect); | 145 getScrollableArea().verticalScrollbar()->paint(context, adjustedCull
Rect); |
146 } | 146 } |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 LayoutObjectDrawingRecorder recorder(context, getScrollableArea().box(), Dis
playItem::ScrollbarCorner, absRect); | 201 LayoutObjectDrawingRecorder recorder(context, getScrollableArea().box(), Dis
playItem::ScrollbarCorner, absRect); |
202 context.fillRect(absRect, Color::white); | 202 context.fillRect(absRect, Color::white); |
203 } | 203 } |
204 | 204 |
205 PaintLayerScrollableArea& ScrollableAreaPainter::getScrollableArea() const | 205 PaintLayerScrollableArea& ScrollableAreaPainter::getScrollableArea() const |
206 { | 206 { |
207 return *m_scrollableArea; | 207 return *m_scrollableArea; |
208 } | 208 } |
209 | 209 |
210 } // namespace blink | 210 } // namespace blink |
OLD | NEW |