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

Side by Side Diff: Source/core/rendering/RenderObject.h

Issue 380583003: Revert of Revert of Divorce PaintInvalidationState from LayoutState (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
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. All r ights reserved. 6 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2009 Google Inc. All rights reserved. 7 * Copyright (C) 2009 Google Inc. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 47
48 namespace WebCore { 48 namespace WebCore {
49 49
50 class AffineTransform; 50 class AffineTransform;
51 class Cursor; 51 class Cursor;
52 class Document; 52 class Document;
53 class HitTestLocation; 53 class HitTestLocation;
54 class HitTestResult; 54 class HitTestResult;
55 class InlineBox; 55 class InlineBox;
56 class InlineFlowBox; 56 class InlineFlowBox;
57 class PaintInvalidationState;
57 class Position; 58 class Position;
58 class PositionWithAffinity; 59 class PositionWithAffinity;
59 class PseudoStyleRequest; 60 class PseudoStyleRequest;
60 class RenderBoxModelObject; 61 class RenderBoxModelObject;
61 class RenderBlock; 62 class RenderBlock;
62 class RenderFlowThread; 63 class RenderFlowThread;
63 class RenderGeometryMap; 64 class RenderGeometryMap;
64 class RenderLayer; 65 class RenderLayer;
65 class RenderLayerModelObject; 66 class RenderLayerModelObject;
66 class RenderView; 67 class RenderView;
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after
739 // Convert a local quad to absolute coordinates, taking transforms into acco unt. 740 // Convert a local quad to absolute coordinates, taking transforms into acco unt.
740 FloatQuad localToAbsoluteQuad(const FloatQuad& quad, MapCoordinatesFlags mod e = 0, bool* wasFixed = 0) const 741 FloatQuad localToAbsoluteQuad(const FloatQuad& quad, MapCoordinatesFlags mod e = 0, bool* wasFixed = 0) const
741 { 742 {
742 return localToContainerQuad(quad, 0, mode, wasFixed); 743 return localToContainerQuad(quad, 0, mode, wasFixed);
743 } 744 }
744 // Convert an absolute quad to local coordinates. 745 // Convert an absolute quad to local coordinates.
745 FloatQuad absoluteToLocalQuad(const FloatQuad&, MapCoordinatesFlags mode = 0 ) const; 746 FloatQuad absoluteToLocalQuad(const FloatQuad&, MapCoordinatesFlags mode = 0 ) const;
746 747
747 // Convert a local quad into the coordinate system of container, taking tran sforms into account. 748 // Convert a local quad into the coordinate system of container, taking tran sforms into account.
748 FloatQuad localToContainerQuad(const FloatQuad&, const RenderLayerModelObjec t* paintInvalidatinoContainer, MapCoordinatesFlags = 0, bool* wasFixed = 0) cons t; 749 FloatQuad localToContainerQuad(const FloatQuad&, const RenderLayerModelObjec t* paintInvalidatinoContainer, MapCoordinatesFlags = 0, bool* wasFixed = 0) cons t;
749 FloatPoint localToContainerPoint(const FloatPoint&, const RenderLayerModelOb ject* paintInvalidationContainer, MapCoordinatesFlags = 0, bool* wasFixed = 0) c onst; 750 FloatPoint localToContainerPoint(const FloatPoint&, const RenderLayerModelOb ject* paintInvalidationContainer, MapCoordinatesFlags = 0, bool* wasFixed = 0, c onst PaintInvalidationState* = 0) const;
750 751
751 // Return the offset from the container() renderer (excluding transforms). I n multi-column layout, 752 // Return the offset from the container() renderer (excluding transforms). I n multi-column layout,
752 // different offsets apply at different points, so return the offset that ap plies to the given point. 753 // different offsets apply at different points, so return the offset that ap plies to the given point.
753 virtual LayoutSize offsetFromContainer(const RenderObject*, const LayoutPoin t&, bool* offsetDependsOnPoint = 0) const; 754 virtual LayoutSize offsetFromContainer(const RenderObject*, const LayoutPoin t&, bool* offsetDependsOnPoint = 0) const;
754 // Return the offset from an object up the container() chain. Asserts that n one of the intermediate objects have transforms. 755 // Return the offset from an object up the container() chain. Asserts that n one of the intermediate objects have transforms.
755 LayoutSize offsetFromAncestorContainer(const RenderObject*) const; 756 LayoutSize offsetFromAncestorContainer(const RenderObject*) const;
756 757
757 virtual void absoluteRects(Vector<IntRect>&, const LayoutPoint&) const { } 758 virtual void absoluteRects(Vector<IntRect>&, const LayoutPoint&) const { }
758 759
759 // Computes the position of the given render object in the space of |repaint Container|. 760 // Computes the position of the given render object in the space of |repaint Container|.
760 LayoutPoint positionFromPaintInvalidationContainer(const RenderLayerModelObj ect* paintInvalidationContainer) const; 761 LayoutPoint positionFromPaintInvalidationContainer(const RenderLayerModelObj ect* paintInvalidationContainer, const PaintInvalidationState* = 0) const;
761 762
762 IntRect absoluteBoundingBoxRect() const; 763 IntRect absoluteBoundingBoxRect() const;
763 // FIXME: This function should go away eventually 764 // FIXME: This function should go away eventually
764 IntRect absoluteBoundingBoxRectIgnoringTransforms() const; 765 IntRect absoluteBoundingBoxRectIgnoringTransforms() const;
765 766
766 // Build an array of quads in absolute coords for line boxes 767 // Build an array of quads in absolute coords for line boxes
767 virtual void absoluteQuads(Vector<FloatQuad>&, bool* /*wasFixed*/ = 0) const { } 768 virtual void absoluteQuads(Vector<FloatQuad>&, bool* /*wasFixed*/ = 0) const { }
768 769
769 virtual void absoluteFocusRingQuads(Vector<FloatQuad>&); 770 virtual void absoluteFocusRingQuads(Vector<FloatQuad>&);
770 771
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
815 const RenderLayerModelObject* containerForPaintInvalidation() const; 816 const RenderLayerModelObject* containerForPaintInvalidation() const;
816 const RenderLayerModelObject* adjustCompositedContainerForSpecialAncestors(c onst RenderLayerModelObject* paintInvalidationContainer) const; 817 const RenderLayerModelObject* adjustCompositedContainerForSpecialAncestors(c onst RenderLayerModelObject* paintInvalidationContainer) const;
817 bool isPaintInvalidationContainer() const; 818 bool isPaintInvalidationContainer() const;
818 819
819 LayoutRect computePaintInvalidationRect() 820 LayoutRect computePaintInvalidationRect()
820 { 821 {
821 return computePaintInvalidationRect(containerForPaintInvalidation()); 822 return computePaintInvalidationRect(containerForPaintInvalidation());
822 } 823 }
823 824
824 // Returns the paint invalidation rect for this RenderObject in the coordina te space of the paint backing (typically a GraphicsLayer) for |paintInvalidation Container|. 825 // Returns the paint invalidation rect for this RenderObject in the coordina te space of the paint backing (typically a GraphicsLayer) for |paintInvalidation Container|.
825 LayoutRect computePaintInvalidationRect(const RenderLayerModelObject* paintI nvalidationContainer) const; 826 LayoutRect computePaintInvalidationRect(const RenderLayerModelObject* paintI nvalidationContainer, const PaintInvalidationState* = 0) const;
826 827
827 // Returns the rect bounds needed to invalidate the paint of this object, in the coordinate space of the rendering backing of |paintInvalidationContainer| 828 // Returns the rect bounds needed to invalidate the paint of this object, in the coordinate space of the rendering backing of |paintInvalidationContainer|
828 LayoutRect boundsRectForPaintInvalidation(const RenderLayerModelObject* pain tInvalidationContainer) const; 829 LayoutRect boundsRectForPaintInvalidation(const RenderLayerModelObject* pain tInvalidationContainer, const PaintInvalidationState* = 0) const;
829 830
830 // Actually do the paint invalidate of rect r for this object which has been computed in the coordinate space 831 // Actually do the paint invalidate of rect r for this object which has been computed in the coordinate space
831 // of the GraphicsLayer backing of |paintInvalidationContainer|. Note that t his coordinaten space is not the same 832 // of the GraphicsLayer backing of |paintInvalidationContainer|. Note that t his coordinaten space is not the same
832 // as the local coordinate space of |paintInvalidationContainer| in the pres ence of layer squashing. 833 // as the local coordinate space of |paintInvalidationContainer| in the pres ence of layer squashing.
833 // If |paintInvalidationContainer| is 0, invalidate paints via the view. 834 // If |paintInvalidationContainer| is 0, invalidate paints via the view.
834 // FIXME: |paintInvalidationContainer| should never be 0. See crbug.com/3636 99. 835 // FIXME: |paintInvalidationContainer| should never be 0. See crbug.com/3636 99.
835 void invalidatePaintUsingContainer(const RenderLayerModelObject* paintInvali dationContainer, const LayoutRect&, InvalidationReason) const; 836 void invalidatePaintUsingContainer(const RenderLayerModelObject* paintInvali dationContainer, const LayoutRect&, InvalidationReason) const;
836 837
837 // Invalidate the paint of the entire object. Called when, e.g., the color o f a border changes, or when a border 838 // Invalidate the paint of the entire object. Called when, e.g., the color o f a border changes, or when a border
838 // style changes. 839 // style changes.
839 void paintInvalidationForWholeRenderer() const; 840 void paintInvalidationForWholeRenderer() const;
840 841
841 // Invalidate the paint of a specific subrectangle within a given object. Th e rect |r| is in the object's coordinate space. 842 // Invalidate the paint of a specific subrectangle within a given object. Th e rect |r| is in the object's coordinate space.
842 void invalidatePaintRectangle(const LayoutRect&) const; 843 void invalidatePaintRectangle(const LayoutRect&) const;
843 844
844 bool invalidatePaintIfNeeded(const RenderLayerModelObject& paintInvalidation Container, 845 bool invalidatePaintIfNeeded(const RenderLayerModelObject& paintInvalidation Container,
845 const LayoutRect& oldBounds, const LayoutPoint& oldPositionFromPaintInva lidationContainer); 846 const LayoutRect& oldBounds, const LayoutPoint& oldPositionFromPaintInva lidationContainer);
846 847
847 // Walk the tree after layout issuing paint invalidations for renderers that have changed or moved, updating bounds that have changed, and clearing paint in validation state. 848 // Walk the tree after layout issuing paint invalidations for renderers that have changed or moved, updating bounds that have changed, and clearing paint in validation state.
848 virtual void invalidateTreeAfterLayout(const RenderLayerModelObject&); 849 virtual void invalidateTreeAfterLayout(const PaintInvalidationState&);
849 850
850 virtual void invalidatePaintForOverflow(); 851 virtual void invalidatePaintForOverflow();
851 void invalidatePaintForOverflowIfNeeded(); 852 void invalidatePaintForOverflowIfNeeded();
852 853
853 bool checkForPaintInvalidation() const; 854 bool checkForPaintInvalidation() const;
854 855
855 // Returns the rect that should have paint invalidated whenever this object changes. The rect is in the view's 856 // Returns the rect that should have paint invalidated whenever this object changes. The rect is in the view's
856 // coordinate space. This method deals with outlines and overflow. 857 // coordinate space. This method deals with outlines and overflow.
857 LayoutRect absoluteClippedOverflowRect() const 858 LayoutRect absoluteClippedOverflowRect() const
858 { 859 {
859 return clippedOverflowRectForPaintInvalidation(0); 860 return clippedOverflowRectForPaintInvalidation(0);
860 } 861 }
861 IntRect pixelSnappedAbsoluteClippedOverflowRect() const; 862 IntRect pixelSnappedAbsoluteClippedOverflowRect() const;
862 virtual LayoutRect clippedOverflowRectForPaintInvalidation(const RenderLayer ModelObject* paintInvalidationContainer) const; 863 virtual LayoutRect clippedOverflowRectForPaintInvalidation(const RenderLayer ModelObject* paintInvalidationContainer, const PaintInvalidationState* = 0) cons t;
863 virtual LayoutRect rectWithOutlineForPaintInvalidation(const RenderLayerMode lObject* paintInvalidationContainer, LayoutUnit outlineWidth) const; 864 virtual LayoutRect rectWithOutlineForPaintInvalidation(const RenderLayerMode lObject* paintInvalidationContainer, LayoutUnit outlineWidth, const PaintInvalid ationState* = 0) const;
864 865
865 // Given a rect in the object's coordinate space, compute a rect suitable fo r invalidating paints of 866 // Given a rect in the object's coordinate space, compute a rect suitable fo r invalidating paints of
866 // that rect in the coordinate space of paintInvalidationContainer. 867 // that rect in the coordinate space of paintInvalidationContainer.
867 virtual void mapRectToPaintInvalidationBacking(const RenderLayerModelObject* paintInvalidationContainer, LayoutRect&, bool fixed = false) const; 868 virtual void mapRectToPaintInvalidationBacking(const RenderLayerModelObject* paintInvalidationContainer, LayoutRect&, bool fixed = false, const PaintInvalid ationState* = 0) const;
868 virtual void computeFloatRectForPaintInvalidation(const RenderLayerModelObje ct* paintInvalidationContainer, FloatRect& paintInvalidationRect, bool fixed = f alse) const; 869 virtual void computeFloatRectForPaintInvalidation(const RenderLayerModelObje ct* paintInvalidationContainer, FloatRect& paintInvalidationRect, bool fixed = f alse, const PaintInvalidationState* = 0) const;
869 870
870 // Return the offset to the column in which the specified point (in flow-thr ead coordinates) 871 // Return the offset to the column in which the specified point (in flow-thr ead coordinates)
871 // lives. This is used to convert a flow-thread point to a visual point. 872 // lives. This is used to convert a flow-thread point to a visual point.
872 virtual LayoutSize columnOffset(const LayoutPoint&) const { return LayoutSiz e(); } 873 virtual LayoutSize columnOffset(const LayoutPoint&) const { return LayoutSiz e(); }
873 874
874 virtual unsigned length() const { return 1; } 875 virtual unsigned length() const { return 1; }
875 876
876 bool isFloatingOrOutOfFlowPositioned() const { return (isFloating() || isOut OfFlowPositioned()); } 877 bool isFloatingOrOutOfFlowPositioned() const { return (isFloating() || isOut OfFlowPositioned()); }
877 878
878 bool isTransparent() const { return style()->hasOpacity(); } 879 bool isTransparent() const { return style()->hasOpacity(); }
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
958 bool isInert() const; 959 bool isInert() const;
959 960
960 bool supportsTouchAction() const; 961 bool supportsTouchAction() const;
961 962
962 bool visibleToHitTestRequest(const HitTestRequest& request) const { return s tyle()->visibility() == VISIBLE && (request.ignorePointerEventsNone() || style() ->pointerEvents() != PE_NONE) && !isInert(); } 963 bool visibleToHitTestRequest(const HitTestRequest& request) const { return s tyle()->visibility() == VISIBLE && (request.ignorePointerEventsNone() || style() ->pointerEvents() != PE_NONE) && !isInert(); }
963 964
964 bool visibleToHitTesting() const { return style()->visibility() == VISIBLE & & style()->pointerEvents() != PE_NONE && !isInert(); } 965 bool visibleToHitTesting() const { return style()->visibility() == VISIBLE & & style()->pointerEvents() != PE_NONE && !isInert(); }
965 966
966 // Map points and quads through elements, potentially via 3d transforms. You should never need to call these directly; use 967 // Map points and quads through elements, potentially via 3d transforms. You should never need to call these directly; use
967 // localToAbsolute/absoluteToLocal methods instead. 968 // localToAbsolute/absoluteToLocal methods instead.
968 virtual void mapLocalToContainer(const RenderLayerModelObject* paintInvalida tionContainer, TransformState&, MapCoordinatesFlags = ApplyContainerFlip, bool* wasFixed = 0) const; 969 virtual void mapLocalToContainer(const RenderLayerModelObject* paintInvalida tionContainer, TransformState&, MapCoordinatesFlags = ApplyContainerFlip, bool* wasFixed = 0, const PaintInvalidationState* = 0) const;
969 virtual void mapAbsoluteToLocalPoint(MapCoordinatesFlags, TransformState&) c onst; 970 virtual void mapAbsoluteToLocalPoint(MapCoordinatesFlags, TransformState&) c onst;
970 971
971 // Pushes state onto RenderGeometryMap about how to map coordinates from thi s renderer to its container, or ancestorToStopAt (whichever is encountered first ). 972 // Pushes state onto RenderGeometryMap about how to map coordinates from thi s renderer to its container, or ancestorToStopAt (whichever is encountered first ).
972 // Returns the renderer which was mapped to (container or ancestorToStopAt). 973 // Returns the renderer which was mapped to (container or ancestorToStopAt).
973 virtual const RenderObject* pushMappingToContainer(const RenderLayerModelObj ect* ancestorToStopAt, RenderGeometryMap&) const; 974 virtual const RenderObject* pushMappingToContainer(const RenderLayerModelObj ect* ancestorToStopAt, RenderGeometryMap&) const;
974 975
975 bool shouldUseTransformFromContainer(const RenderObject* container) const; 976 bool shouldUseTransformFromContainer(const RenderObject* container) const;
976 void getTransformFromContainer(const RenderObject* container, const LayoutSi ze& offsetInContainer, TransformationMatrix&) const; 977 void getTransformFromContainer(const RenderObject* container, const LayoutSi ze& offsetInContainer, TransformationMatrix&) const;
977 978
978 bool createsGroup() const { return isTransparent() || hasMask() || hasFilter () || hasBlendMode(); } 979 bool createsGroup() const { return isTransparent() || hasMask() || hasFilter () || hasBlendMode(); }
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after
1493 void showTree(const WebCore::RenderObject*); 1494 void showTree(const WebCore::RenderObject*);
1494 void showLineTree(const WebCore::RenderObject*); 1495 void showLineTree(const WebCore::RenderObject*);
1495 void showRenderTree(const WebCore::RenderObject* object1); 1496 void showRenderTree(const WebCore::RenderObject* object1);
1496 // We don't make object2 an optional parameter so that showRenderTree 1497 // We don't make object2 an optional parameter so that showRenderTree
1497 // can be called from gdb easily. 1498 // can be called from gdb easily.
1498 void showRenderTree(const WebCore::RenderObject* object1, const WebCore::RenderO bject* object2); 1499 void showRenderTree(const WebCore::RenderObject* object1, const WebCore::RenderO bject* object2);
1499 1500
1500 #endif 1501 #endif
1501 1502
1502 #endif // RenderObject_h 1503 #endif // RenderObject_h
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderMediaControlElements.cpp ('k') | Source/core/rendering/RenderObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698