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

Side by Side Diff: Source/core/rendering/RenderInline.cpp

Issue 335963002: Change LayoutState to be stack-allocated (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix push function to match old behavior... Created 6 years, 6 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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 976 matching lines...) Expand 10 before | Expand all | Expand 10 after
987 LayoutUnit logicalHeight = lastLineBox()->logicalBottomVisualOverflow(lastRo otBox.lineBottom()) - logicalTop; 987 LayoutUnit logicalHeight = lastLineBox()->logicalBottomVisualOverflow(lastRo otBox.lineBottom()) - logicalTop;
988 988
989 LayoutRect rect(logicalLeftSide, logicalTop, logicalWidth, logicalHeight); 989 LayoutRect rect(logicalLeftSide, logicalTop, logicalWidth, logicalHeight);
990 if (!style()->isHorizontalWritingMode()) 990 if (!style()->isHorizontalWritingMode())
991 rect = rect.transposedRect(); 991 rect = rect.transposedRect();
992 return rect; 992 return rect;
993 } 993 }
994 994
995 LayoutRect RenderInline::clippedOverflowRectForPaintInvalidation(const RenderLay erModelObject* paintInvalidationContainer) const 995 LayoutRect RenderInline::clippedOverflowRectForPaintInvalidation(const RenderLay erModelObject* paintInvalidationContainer) const
996 { 996 {
997 ASSERT(!view() || !view()->layoutStateEnabled()); 997 ASSERT(!view() || !view()->layoutStateCachedOffsetsEnabled());
998 998
999 if (!firstLineBoxIncludingCulling() && !continuation()) 999 if (!firstLineBoxIncludingCulling() && !continuation())
1000 return LayoutRect(); 1000 return LayoutRect();
1001 1001
1002 LayoutRect repaintRect(linesVisualOverflowBoundingBox()); 1002 LayoutRect repaintRect(linesVisualOverflowBoundingBox());
1003 bool hitRepaintContainer = false; 1003 bool hitRepaintContainer = false;
1004 1004
1005 // We need to add in the in-flow position offsets of any inlines (including us) up to our 1005 // We need to add in the in-flow position offsets of any inlines (including us) up to our
1006 // containing block. 1006 // containing block.
1007 RenderBlock* cb = containingBlock(); 1007 RenderBlock* cb = containingBlock();
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
1049 if (!curr->isText()) 1049 if (!curr->isText())
1050 r.unite(curr->rectWithOutlineForPaintInvalidation(paintInvalidationC ontainer, outlineWidth)); 1050 r.unite(curr->rectWithOutlineForPaintInvalidation(paintInvalidationC ontainer, outlineWidth));
1051 } 1051 }
1052 return r; 1052 return r;
1053 } 1053 }
1054 1054
1055 void RenderInline::mapRectToPaintInvalidationBacking(const RenderLayerModelObjec t* paintInvalidationContainer, LayoutRect& rect, bool fixed) const 1055 void RenderInline::mapRectToPaintInvalidationBacking(const RenderLayerModelObjec t* paintInvalidationContainer, LayoutRect& rect, bool fixed) const
1056 { 1056 {
1057 if (RenderView* v = view()) { 1057 if (RenderView* v = view()) {
1058 // LayoutState is only valid for root-relative repainting 1058 // LayoutState is only valid for root-relative repainting
1059 if (v->canUseLayoutStateForContainer(paintInvalidationContainer)) { 1059 if (v->canMapUsingLayoutStateForContainer(paintInvalidationContainer)) {
1060 LayoutState* layoutState = v->layoutState(); 1060 LayoutState* layoutState = v->layoutState();
1061 if (style()->hasInFlowPosition() && layer()) 1061 if (style()->hasInFlowPosition() && layer())
1062 rect.move(layer()->offsetForInFlowPosition()); 1062 rect.move(layer()->offsetForInFlowPosition());
1063 rect.move(layoutState->paintOffset()); 1063 rect.move(layoutState->paintOffset());
1064 if (layoutState->isClipped()) 1064 if (layoutState->isClipped())
1065 rect.intersect(layoutState->clipRect()); 1065 rect.intersect(layoutState->clipRect());
1066 return; 1066 return;
1067 } 1067 }
1068 } 1068 }
1069 1069
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
1136 1136
1137 return offset; 1137 return offset;
1138 } 1138 }
1139 1139
1140 void RenderInline::mapLocalToContainer(const RenderLayerModelObject* repaintCont ainer, TransformState& transformState, MapCoordinatesFlags mode, bool* wasFixed) const 1140 void RenderInline::mapLocalToContainer(const RenderLayerModelObject* repaintCont ainer, TransformState& transformState, MapCoordinatesFlags mode, bool* wasFixed) const
1141 { 1141 {
1142 if (repaintContainer == this) 1142 if (repaintContainer == this)
1143 return; 1143 return;
1144 1144
1145 if (RenderView *v = view()) { 1145 if (RenderView *v = view()) {
1146 if (v->canUseLayoutStateForContainer(repaintContainer)) { 1146 if (v->canMapUsingLayoutStateForContainer(repaintContainer)) {
1147 LayoutState* layoutState = v->layoutState(); 1147 LayoutState* layoutState = v->layoutState();
1148 LayoutSize offset = layoutState->paintOffset(); 1148 LayoutSize offset = layoutState->paintOffset();
1149 if (style()->hasInFlowPosition() && layer()) 1149 if (style()->hasInFlowPosition() && layer())
1150 offset += layer()->offsetForInFlowPosition(); 1150 offset += layer()->offsetForInFlowPosition();
1151 transformState.move(offset); 1151 transformState.move(offset);
1152 return; 1152 return;
1153 } 1153 }
1154 } 1154 }
1155 1155
1156 bool containerSkipped; 1156 bool containerSkipped;
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
1566 container = this; 1566 container = this;
1567 1567
1568 FloatPoint absPos = container->localToAbsolute(); 1568 FloatPoint absPos = container->localToAbsolute();
1569 region.bounds.setX(absPos.x() + region.bounds.x()); 1569 region.bounds.setX(absPos.x() + region.bounds.x());
1570 region.bounds.setY(absPos.y() + region.bounds.y()); 1570 region.bounds.setY(absPos.y() + region.bounds.y());
1571 1571
1572 regions.append(region); 1572 regions.append(region);
1573 } 1573 }
1574 1574
1575 } // namespace WebCore 1575 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698