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

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

Issue 2370553002: Refactor LocalBorderBoxProperties to use PropertyTreeState (Closed)
Patch Set: Rebase from space Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/PaintPropertyTreeBuilder.h" 5 #include "core/paint/PaintPropertyTreeBuilder.h"
6 6
7 #include "core/frame/FrameView.h" 7 #include "core/frame/FrameView.h"
8 #include "core/frame/LocalFrame.h" 8 #include "core/frame/LocalFrame.h"
9 #include "core/frame/Settings.h" 9 #include "core/frame/Settings.h"
10 #include "core/layout/LayoutInline.h" 10 #include "core/layout/LayoutInline.h"
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 if (ObjectPaintProperties* properties = object.getMutableForPainting().objec tPaintProperties()) 314 if (ObjectPaintProperties* properties = object.getMutableForPainting().objec tPaintProperties())
315 properties->clearCssClip(); 315 properties->clearCssClip();
316 } 316 }
317 317
318 void PaintPropertyTreeBuilder::updateLocalBorderBoxContext(const LayoutObject& o bject, PaintPropertyTreeBuilderContext& context) 318 void PaintPropertyTreeBuilder::updateLocalBorderBoxContext(const LayoutObject& o bject, PaintPropertyTreeBuilderContext& context)
319 { 319 {
320 // Avoid adding an ObjectPaintProperties for non-boxes to save memory, since we don't need them at the moment. 320 // Avoid adding an ObjectPaintProperties for non-boxes to save memory, since we don't need them at the moment.
321 if (!object.isBox() && !object.hasLayer()) 321 if (!object.isBox() && !object.hasLayer())
322 return; 322 return;
323 323
324 PropertyTreeState propertyTreeState(context.current.transform, context.curre nt.clip, context.currentEffect, context.current.scroll);
324 std::unique_ptr<ObjectPaintProperties::LocalBorderBoxProperties> borderBoxCo ntext = 325 std::unique_ptr<ObjectPaintProperties::LocalBorderBoxProperties> borderBoxCo ntext =
325 wrapUnique(new ObjectPaintProperties::LocalBorderBoxProperties); 326 wrapUnique(new ObjectPaintProperties::LocalBorderBoxProperties(context.c urrent.paintOffset, propertyTreeState));
326 borderBoxContext->paintOffset = context.current.paintOffset;
327 borderBoxContext->geometryPropertyTreeState = GeometryPropertyTreeState(cont ext.current.transform, context.current.clip, context.currentEffect);
328 borderBoxContext->scroll = context.current.scroll;
329
330 object.getMutableForPainting().ensureObjectPaintProperties().setLocalBorderB oxProperties(std::move(borderBoxContext)); 327 object.getMutableForPainting().ensureObjectPaintProperties().setLocalBorderB oxProperties(std::move(borderBoxContext));
331 328
332 } 329 }
333 330
334 // TODO(trchen): Remove this once we bake the paint offset into frameRect. 331 // TODO(trchen): Remove this once we bake the paint offset into frameRect.
335 void PaintPropertyTreeBuilder::updateScrollbarPaintOffset(const LayoutObject& ob ject, const PaintPropertyTreeBuilderContext& context) 332 void PaintPropertyTreeBuilder::updateScrollbarPaintOffset(const LayoutObject& ob ject, const PaintPropertyTreeBuilderContext& context)
336 { 333 {
337 IntPoint roundedPaintOffset = roundedIntPoint(context.current.paintOffset); 334 IntPoint roundedPaintOffset = roundedIntPoint(context.current.paintOffset);
338 if (roundedPaintOffset != IntPoint() && object.isBoxModelObject()) { 335 if (roundedPaintOffset != IntPoint() && object.isBoxModelObject()) {
339 if (PaintLayerScrollableArea* scrollableArea = toLayoutBoxModelObject(ob ject).getScrollableArea()) { 336 if (PaintLayerScrollableArea* scrollableArea = toLayoutBoxModelObject(ob ject).getScrollableArea()) {
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
590 return; 587 return;
591 588
592 updateOverflowClip(object, context); 589 updateOverflowClip(object, context);
593 updatePerspective(object, context); 590 updatePerspective(object, context);
594 updateSvgLocalToBorderBoxTransform(object, context); 591 updateSvgLocalToBorderBoxTransform(object, context);
595 updateScrollAndScrollTranslation(object, context); 592 updateScrollAndScrollTranslation(object, context);
596 updateOutOfFlowContext(object, context); 593 updateOutOfFlowContext(object, context);
597 } 594 }
598 595
599 } // namespace blink 596 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698