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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutObject.h

Issue 2465983002: Rename "paint invalidation rect" etc. to "visual rect". (Closed)
Patch Set: - Created 4 years, 1 month 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 /* 1 /*
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Antti Koivisto (koivisto@kde.org) 3 * (C) 2000 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com)
6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2012 Apple Inc. 6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2012 Apple Inc.
7 * All rights reserved. 7 * All rights reserved.
8 * Copyright (C) 2009 Google Inc. All rights reserved. 8 * Copyright (C) 2009 Google Inc. All rights reserved.
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after
683 // SVGLocatable::getBBox(). 683 // SVGLocatable::getBBox().
684 // NOTE: Markers are not specifically ignored here by SVG 1.1 spec, but we 684 // NOTE: Markers are not specifically ignored here by SVG 1.1 spec, but we
685 // ignore them since stroke-width is ignored (and marker size can depend on 685 // ignore them since stroke-width is ignored (and marker size can depend on
686 // stroke-width). objectBoundingBox is returned local coordinates. 686 // stroke-width). objectBoundingBox is returned local coordinates.
687 // The name objectBoundingBox is taken from the SVG 1.1 spec. 687 // The name objectBoundingBox is taken from the SVG 1.1 spec.
688 virtual FloatRect objectBoundingBox() const; 688 virtual FloatRect objectBoundingBox() const;
689 virtual FloatRect strokeBoundingBox() const; 689 virtual FloatRect strokeBoundingBox() const;
690 690
691 // Returns the smallest rectangle enclosing all of the painted content 691 // Returns the smallest rectangle enclosing all of the painted content
692 // respecting clipping, masking, filters, opacity, stroke-width and markers 692 // respecting clipping, masking, filters, opacity, stroke-width and markers
693 virtual FloatRect paintInvalidationRectInLocalSVGCoordinates() const; 693 virtual FloatRect visualRectInLocalSVGCoordinates() const;
694 694
695 // This only returns the transform="" value from the SVG element. 695 // This only returns the transform="" value from the SVG element.
696 // Most callsites want localToParentTransform() instead. 696 // Most callsites want localToParentTransform() instead.
697 virtual AffineTransform localSVGTransform() const; 697 virtual AffineTransform localSVGTransform() const;
698 698
699 // Returns the full transform mapping from local coordinates to local coords 699 // Returns the full transform mapping from local coordinates to local coords
700 // for the parent SVG layoutObject 700 // for the parent SVG layoutObject
701 // This includes any viewport transforms and x/y offsets as well as the 701 // This includes any viewport transforms and x/y offsets as well as the
702 // transform="" value off the element. 702 // transform="" value off the element.
703 virtual const AffineTransform& localToSVGParentTransform() const; 703 virtual const AffineTransform& localToSVGParentTransform() const;
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after
1344 // shouldDoFullPaintInvalidation is false, but mayNeedPaintInvalidation or 1344 // shouldDoFullPaintInvalidation is false, but mayNeedPaintInvalidation or
1345 // childShouldCheckForPaintInvalidation is true) to avoid unnecessary paint 1345 // childShouldCheckForPaintInvalidation is true) to avoid unnecessary paint
1346 // invalidations of empty areas covered by such objects. 1346 // invalidations of empty areas covered by such objects.
1347 virtual bool paintedOutputOfObjectHasNoEffectRegardlessOfSize() const { 1347 virtual bool paintedOutputOfObjectHasNoEffectRegardlessOfSize() const {
1348 return false; 1348 return false;
1349 } 1349 }
1350 1350
1351 // Returns the rect that should have paint invalidated whenever this object 1351 // Returns the rect that should have paint invalidated whenever this object
1352 // changes. The rect is in the view's coordinate space. This method deals with 1352 // changes. The rect is in the view's coordinate space. This method deals with
1353 // outlines and overflow. 1353 // outlines and overflow.
1354 virtual LayoutRect absoluteClippedOverflowRect() const; 1354 virtual LayoutRect absoluteVisualRect() const;
1355 1355
1356 // Returns the rect that should have paint invalidated whenever this object 1356 // Returns the rect that should have paint invalidated whenever this object
1357 // changes. The rect is in the object's local coordinate space. This is for 1357 // changes. The rect is in the object's local coordinate space. This is for
1358 // non-SVG objects and LayoutSVGRoot only. 1358 // non-SVG objects and LayoutSVGRoot only. SVG objects (except LayoutSVGRoot)
1359 // SVG objects (except LayoutSVGRoot) should use 1359 // should use visualRectInLocalSVGCoordinates() and map with SVG transforms
1360 // paintInvalidationRectInLocalSVGCoordinates() and map with SVG transforms
1361 // instead. 1360 // instead.
1362 virtual LayoutRect localOverflowRectForPaintInvalidation() const; 1361 virtual LayoutRect localVisualRect() const;
1363 1362
1364 // Given a rect in the object's coordinate space, mutates the rect into one 1363 // Given a rect in the object's coordinate space, mutates the rect into one
1365 // representing the size of its visual painted output as if |ancestor| was the 1364 // representing the size of its visual painted output as if |ancestor| was the
1366 // root of the page: the rect is modified by any intervening clips, transforms 1365 // root of the page: the rect is modified by any intervening clips, transforms
1367 // and scrolls between |this| and |ancestor| (not inclusive of |ancestor|), 1366 // and scrolls between |this| and |ancestor| (not inclusive of |ancestor|),
1368 // but not any above |ancestor|. 1367 // but not any above |ancestor|.
1369 // The output is in the physical, painted coordinate pixel space of 1368 // The output is in the physical, painted coordinate pixel space of
1370 // |ancestor|. 1369 // |ancestor|.
1371 // Overflow clipping, CSS clipping and scrolling is *not* applied for 1370 // Overflow clipping, CSS clipping and scrolling is *not* applied for
1372 // |ancestor| itself if |ancestor| scrolls overflow. 1371 // |ancestor| itself if |ancestor| scrolls overflow.
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
1588 1587
1589 // Compute a list of hit-test rectangles per layer rooted at this 1588 // Compute a list of hit-test rectangles per layer rooted at this
1590 // layoutObject. 1589 // layoutObject.
1591 virtual void computeLayerHitTestRects(LayerHitTestRects&) const; 1590 virtual void computeLayerHitTestRects(LayerHitTestRects&) const;
1592 1591
1593 static RespectImageOrientationEnum shouldRespectImageOrientation( 1592 static RespectImageOrientationEnum shouldRespectImageOrientation(
1594 const LayoutObject*); 1593 const LayoutObject*);
1595 1594
1596 bool isRelayoutBoundaryForInspector() const; 1595 bool isRelayoutBoundaryForInspector() const;
1597 1596
1598 // The previous paint invalidation rect, in the the space of the paint 1597 // The previous visual rect, in the the space of the paint invalidation
1599 // invalidation container (*not* the graphics layer that paints 1598 // container (*not* the graphics layer that paints this object).
1600 // this object). 1599 LayoutRect previousVisualRectIncludingCompositedScrolling(
1601 LayoutRect previousPaintInvalidationRectIncludingCompositedScrolling(
1602 const LayoutBoxModelObject& paintInvalidationContainer) const; 1600 const LayoutBoxModelObject& paintInvalidationContainer) const;
1603 1601
1604 // The returned rect does *not* account for composited scrolling. 1602 // The returned rect does *not* account for composited scrolling.
1605 const LayoutRect& previousPaintInvalidationRect() const { 1603 const LayoutRect& previousVisualRect() const { return m_previousVisualRect; }
1606 return m_previousPaintInvalidationRect;
1607 }
1608 1604
1609 // Called when the previous paint invalidation rect(s) is no longer valid. 1605 // Called when the previous visual rect(s) is no longer valid.
1610 virtual void clearPreviousPaintInvalidationRects(); 1606 virtual void clearPreviousVisualRects();
1611 1607
1612 // Only adjusts if the paint invalidation container is not a composited 1608 // Only adjusts if the paint invalidation container is not a composited
1613 // scroller. 1609 // scroller.
1614 void adjustPreviousPaintInvalidationForScrollIfNeeded( 1610 void adjustPreviousPaintInvalidationForScrollIfNeeded(
1615 const DoubleSize& scrollDelta); 1611 const DoubleSize& scrollDelta);
1616 1612
1617 // The previous position of the top-left corner of the object in its previous 1613 // The previous position of the top-left corner of the object in its previous
1618 // paint backing. 1614 // paint backing.
1619 const LayoutPoint& previousPositionFromPaintInvalidationBacking() const { 1615 const LayoutPoint& previousPositionFromPaintInvalidationBacking() const {
1620 return m_previousPositionFromPaintInvalidationBacking; 1616 return m_previousPositionFromPaintInvalidationBacking;
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
1705 void clearPaintInvalidationFlags() { 1701 void clearPaintInvalidationFlags() {
1706 m_layoutObject.clearPaintInvalidationFlags(); 1702 m_layoutObject.clearPaintInvalidationFlags();
1707 } 1703 }
1708 void setShouldDoFullPaintInvalidation(PaintInvalidationReason reason) { 1704 void setShouldDoFullPaintInvalidation(PaintInvalidationReason reason) {
1709 m_layoutObject.setShouldDoFullPaintInvalidation(reason); 1705 m_layoutObject.setShouldDoFullPaintInvalidation(reason);
1710 } 1706 }
1711 void ensureIsReadyForPaintInvalidation() { 1707 void ensureIsReadyForPaintInvalidation() {
1712 m_layoutObject.ensureIsReadyForPaintInvalidation(); 1708 m_layoutObject.ensureIsReadyForPaintInvalidation();
1713 } 1709 }
1714 1710
1715 void setPreviousPaintInvalidationRect(const LayoutRect& r) { 1711 void setPreviousVisualRect(const LayoutRect& r) {
1716 m_layoutObject.setPreviousPaintInvalidationRect(r); 1712 m_layoutObject.setPreviousVisualRect(r);
1717 } 1713 }
1718 void setPreviousPositionFromPaintInvalidationBacking(const LayoutPoint& p) { 1714 void setPreviousPositionFromPaintInvalidationBacking(const LayoutPoint& p) {
1719 m_layoutObject.setPreviousPositionFromPaintInvalidationBacking(p); 1715 m_layoutObject.setPreviousPositionFromPaintInvalidationBacking(p);
1720 } 1716 }
1721 void setPreviousBackgroundObscured(bool b) { 1717 void setPreviousBackgroundObscured(bool b) {
1722 m_layoutObject.setPreviousBackgroundObscured(b); 1718 m_layoutObject.setPreviousBackgroundObscured(b);
1723 } 1719 }
1724 void clearPreviousPaintInvalidationRects() { 1720 void clearPreviousVisualRects() {
1725 m_layoutObject.clearPreviousPaintInvalidationRects(); 1721 m_layoutObject.clearPreviousVisualRects();
1726 } 1722 }
1727 1723
1728 protected: 1724 protected:
1729 friend class PaintPropertyTreeBuilder; 1725 friend class PaintPropertyTreeBuilder;
1730 // The following two functions can be called from PaintPropertyTreeBuilder 1726 // The following two functions can be called from PaintPropertyTreeBuilder
1731 // only. 1727 // only.
1732 ObjectPaintProperties& ensurePaintProperties() { 1728 ObjectPaintProperties& ensurePaintProperties() {
1733 return m_layoutObject.ensurePaintProperties(); 1729 return m_layoutObject.ensurePaintProperties();
1734 } 1730 }
1735 ObjectPaintProperties* paintProperties() { 1731 ObjectPaintProperties* paintProperties() {
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
1902 const PaintLayer* currentLayer, 1898 const PaintLayer* currentLayer,
1903 const LayoutPoint& layerOffset, 1899 const LayoutPoint& layerOffset,
1904 const LayoutRect& containerRect) const; 1900 const LayoutRect& containerRect) const;
1905 1901
1906 // Add hit-test rects for this layoutObject only to the provided list. 1902 // Add hit-test rects for this layoutObject only to the provided list.
1907 // layerOffset is the offset of this layoutObject within the current layer 1903 // layerOffset is the offset of this layoutObject within the current layer
1908 // that should be used for each result. 1904 // that should be used for each result.
1909 virtual void computeSelfHitTestRects(Vector<LayoutRect>&, 1905 virtual void computeSelfHitTestRects(Vector<LayoutRect>&,
1910 const LayoutPoint& layerOffset) const {} 1906 const LayoutPoint& layerOffset) const {}
1911 1907
1912 void setPreviousPaintInvalidationRect(const LayoutRect& rect) { 1908 void setPreviousVisualRect(const LayoutRect& rect) {
1913 m_previousPaintInvalidationRect = rect; 1909 m_previousVisualRect = rect;
1914 } 1910 }
1915 1911
1916 #if ENABLE(ASSERT) 1912 #if ENABLE(ASSERT)
1917 virtual bool paintInvalidationStateIsDirty() const { 1913 virtual bool paintInvalidationStateIsDirty() const {
1918 return shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState(); 1914 return shouldCheckForPaintInvalidationRegardlessOfPaintInvalidationState();
1919 } 1915 }
1920 #endif 1916 #endif
1921 1917
1922 // Called before paint invalidation. 1918 // Called before paint invalidation.
1923 virtual void ensureIsReadyForPaintInvalidation() { DCHECK(!needsLayout()); } 1919 virtual void ensureIsReadyForPaintInvalidation() { DCHECK(!needsLayout()); }
(...skipping 27 matching lines...) Expand all
1951 void removeFromLayoutFlowThread(); 1947 void removeFromLayoutFlowThread();
1952 1948
1953 bool containsInlineWithOutlineAndContinuation() const { 1949 bool containsInlineWithOutlineAndContinuation() const {
1954 return m_bitfields.containsInlineWithOutlineAndContinuation(); 1950 return m_bitfields.containsInlineWithOutlineAndContinuation();
1955 } 1951 }
1956 void setContainsInlineWithOutlineAndContinuation(bool b) { 1952 void setContainsInlineWithOutlineAndContinuation(bool b) {
1957 m_bitfields.setContainsInlineWithOutlineAndContinuation(b); 1953 m_bitfields.setContainsInlineWithOutlineAndContinuation(b);
1958 } 1954 }
1959 1955
1960 private: 1956 private:
1961 // Adjusts a paint invalidation rect in the space of 1957 // Adjusts a visual rect in the space of |m_previousVisualRect| and
1962 // |m_previousPaintInvalidationRect| and 1958 // |m_previousPositionFromPaintInvalidationBacking| to be in the space of the
1963 // |m_previousPositionFromPaintInvalidationBacking| 1959 // |paintInvalidationContainer|, if needed. They can be different only if
1964 // to be in the space of the |paintInvalidationContainer|, if needed. They can 1960 // |paintInvalidationContainer| is a composited scroller.
1965 // be different only if |paintInvalidationContainer| is a composited scroller. 1961 void adjustVisualRectForCompositedScrolling(
1966 void adjustInvalidationRectForCompositedScrolling(
1967 LayoutRect&, 1962 LayoutRect&,
1968 const LayoutBoxModelObject& paintInvalidationContainer) const; 1963 const LayoutBoxModelObject& paintInvalidationContainer) const;
1969 1964
1970 void clearLayoutRootIfNeeded() const; 1965 void clearLayoutRootIfNeeded() const;
1971 1966
1972 bool isInert() const; 1967 bool isInert() const;
1973 1968
1974 void updateImage(StyleImage*, StyleImage*); 1969 void updateImage(StyleImage*, StyleImage*);
1975 1970
1976 void scheduleRelayout(); 1971 void scheduleRelayout();
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
2365 m_bitfields.setSelfNeedsOverflowRecalcAfterStyleChange(true); 2360 m_bitfields.setSelfNeedsOverflowRecalcAfterStyleChange(true);
2366 } 2361 }
2367 void setChildNeedsOverflowRecalcAfterStyleChange() { 2362 void setChildNeedsOverflowRecalcAfterStyleChange() {
2368 m_bitfields.setChildNeedsOverflowRecalcAfterStyleChange(true); 2363 m_bitfields.setChildNeedsOverflowRecalcAfterStyleChange(true);
2369 } 2364 }
2370 2365
2371 private: 2366 private:
2372 // Store state between styleWillChange and styleDidChange 2367 // Store state between styleWillChange and styleDidChange
2373 static bool s_affectsParentBlock; 2368 static bool s_affectsParentBlock;
2374 2369
2375 // This stores the paint invalidation rect from the previous frame. This rect 2370 // This stores the visual rect from the previous frame. This rect does *not*
2376 // does *not* account for composited scrolling. See 2371 // account for composited scrolling. See
2377 // adjustInvalidationRectForCompositedScrolling(). 2372 // adjustVisualRectForCompositedScrolling().
2378 LayoutRect m_previousPaintInvalidationRect; 2373 LayoutRect m_previousVisualRect;
2379 2374
2380 // This stores the position in the paint invalidation backing's coordinate. 2375 // This stores the position in the paint invalidation backing's coordinate.
2381 // It is used to detect layoutObject shifts that forces a full invalidation. 2376 // It is used to detect layoutObject shifts that forces a full invalidation.
2382 // This point does *not* account for composited scrolling. See 2377 // This point does *not* account for composited scrolling. See
2383 // adjustInvalidationRectForCompositedScrolling(). 2378 // adjustInvalidationRectForCompositedScrolling().
2384 LayoutPoint m_previousPositionFromPaintInvalidationBacking; 2379 LayoutPoint m_previousPositionFromPaintInvalidationBacking;
2385 }; 2380 };
2386 2381
2387 // FIXME: remove this once the layout object lifecycle ASSERTS are no longer 2382 // FIXME: remove this once the layout object lifecycle ASSERTS are no longer
2388 // hit. 2383 // hit.
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
2596 CORE_EXPORT void showLineTree(const blink::LayoutObject*); 2591 CORE_EXPORT void showLineTree(const blink::LayoutObject*);
2597 CORE_EXPORT void showLayoutTree(const blink::LayoutObject* object1); 2592 CORE_EXPORT void showLayoutTree(const blink::LayoutObject* object1);
2598 // We don't make object2 an optional parameter so that showLayoutTree 2593 // We don't make object2 an optional parameter so that showLayoutTree
2599 // can be called from gdb easily. 2594 // can be called from gdb easily.
2600 CORE_EXPORT void showLayoutTree(const blink::LayoutObject* object1, 2595 CORE_EXPORT void showLayoutTree(const blink::LayoutObject* object1,
2601 const blink::LayoutObject* object2); 2596 const blink::LayoutObject* object2);
2602 2597
2603 #endif 2598 #endif
2604 2599
2605 #endif // LayoutObject_h 2600 #endif // LayoutObject_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutMultiColumnSet.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698