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

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

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