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

Side by Side Diff: third_party/WebKit/Source/core/paint/ScrollableAreaPainter.cpp

Issue 2573883002: Refactor PaintChunkProperties to use PropertyTreeState (Closed)
Patch Set: none Created 4 years 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 unified diff | Download patch
OLDNEW
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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 DisplayItem::kClipLayerOverflowControls, clipRect); 159 DisplayItem::kClipLayerOverflowControls, clipRect);
160 160
161 { 161 {
162 Optional<ScopedPaintChunkProperties> scopedTransformProperty; 162 Optional<ScopedPaintChunkProperties> scopedTransformProperty;
163 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { 163 if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
164 const auto* objectProperties = 164 const auto* objectProperties =
165 getScrollableArea().box().paintProperties(); 165 getScrollableArea().box().paintProperties();
166 if (objectProperties && objectProperties->scrollbarPaintOffset()) { 166 if (objectProperties && objectProperties->scrollbarPaintOffset()) {
167 PaintChunkProperties properties( 167 PaintChunkProperties properties(
168 context.getPaintController().currentPaintChunkProperties()); 168 context.getPaintController().currentPaintChunkProperties());
169 properties.transform = objectProperties->scrollbarPaintOffset(); 169 properties.propertyTreeState.setTransform(
170 objectProperties->scrollbarPaintOffset());
170 scopedTransformProperty.emplace( 171 scopedTransformProperty.emplace(
171 context.getPaintController(), getScrollableArea().box(), 172 context.getPaintController(), getScrollableArea().box(),
172 DisplayItem::kScrollOverflowControls, properties); 173 DisplayItem::kScrollOverflowControls, properties);
173 } 174 }
174 } 175 }
175 if (getScrollableArea().horizontalScrollbar() && 176 if (getScrollableArea().horizontalScrollbar() &&
176 !getScrollableArea().layerForHorizontalScrollbar()) { 177 !getScrollableArea().layerForHorizontalScrollbar()) {
177 TransformRecorder translateRecorder( 178 TransformRecorder translateRecorder(
178 context, *getScrollableArea().horizontalScrollbar(), 179 context, *getScrollableArea().horizontalScrollbar(),
179 AffineTransform::translation(adjustedPaintOffset.x(), 180 AffineTransform::translation(adjustedPaintOffset.x(),
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 LayoutObjectDrawingRecorder recorder(context, getScrollableArea().box(), 255 LayoutObjectDrawingRecorder recorder(context, getScrollableArea().box(),
255 DisplayItem::kScrollbarCorner, absRect); 256 DisplayItem::kScrollbarCorner, absRect);
256 context.fillRect(absRect, Color::white); 257 context.fillRect(absRect, Color::white);
257 } 258 }
258 259
259 PaintLayerScrollableArea& ScrollableAreaPainter::getScrollableArea() const { 260 PaintLayerScrollableArea& ScrollableAreaPainter::getScrollableArea() const {
260 return *m_scrollableArea; 261 return *m_scrollableArea;
261 } 262 }
262 263
263 } // namespace blink 264 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698