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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutInline.cpp

Issue 1490063002: Implement Paint Containment (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix merge Created 5 years 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) 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 1122 matching lines...) Expand 10 before | Expand all | Expand 10 after
1133 1133
1134 if (container->hasOverflowClip()) 1134 if (container->hasOverflowClip())
1135 offset -= toLayoutBox(container)->scrolledContentOffset(); 1135 offset -= toLayoutBox(container)->scrolledContentOffset();
1136 1136
1137 if (offsetDependsOnPoint) 1137 if (offsetDependsOnPoint)
1138 *offsetDependsOnPoint = (container->isBox() && container->style()->isFli ppedBlocksWritingMode()) || container->isLayoutFlowThread(); 1138 *offsetDependsOnPoint = (container->isBox() && container->style()->isFli ppedBlocksWritingMode()) || container->isLayoutFlowThread();
1139 1139
1140 return offset; 1140 return offset;
1141 } 1141 }
1142 1142
1143 PaintLayerType LayoutInline::layerTypeRequired() const
1144 {
1145 return isInFlowPositioned() || createsGroup() || hasClipPath() || style()->s houldCompositeForCurrentAnimations()
1146 || style()->hasCompositorProxy() || style()->containsPaint() ? NormalPa intLayer : NoPaintLayer;
1147 }
1148
1143 void LayoutInline::mapLocalToContainer(const LayoutBoxModelObject* paintInvalida tionContainer, TransformState& transformState, MapCoordinatesFlags mode, bool* w asFixed, const PaintInvalidationState* paintInvalidationState) const 1149 void LayoutInline::mapLocalToContainer(const LayoutBoxModelObject* paintInvalida tionContainer, TransformState& transformState, MapCoordinatesFlags mode, bool* w asFixed, const PaintInvalidationState* paintInvalidationState) const
1144 { 1150 {
1145 if (paintInvalidationContainer == this) 1151 if (paintInvalidationContainer == this)
1146 return; 1152 return;
1147 1153
1148 if (paintInvalidationState && paintInvalidationState->canMapToContainer(pain tInvalidationContainer)) { 1154 if (paintInvalidationState && paintInvalidationState->canMapToContainer(pain tInvalidationContainer)) {
1149 LayoutSize offset = paintInvalidationState->paintOffset(); 1155 LayoutSize offset = paintInvalidationState->paintOffset();
1150 if (style()->hasInFlowPosition() && layer()) 1156 if (style()->hasInFlowPosition() && layer())
1151 offset += layer()->offsetForInFlowPosition(); 1157 offset += layer()->offsetForInFlowPosition();
1152 transformState.move(offset); 1158 transformState.move(offset);
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
1421 { 1427 {
1422 LayoutBoxModelObject::invalidateDisplayItemClients(paintInvalidationContaine r, invalidationReason, paintInvalidationRect); 1428 LayoutBoxModelObject::invalidateDisplayItemClients(paintInvalidationContaine r, invalidationReason, paintInvalidationRect);
1423 1429
1424 // Use the paintInvalidationRect of LayoutInline for inline boxes, which sav es the cost to calculate paint invalidation rect 1430 // Use the paintInvalidationRect of LayoutInline for inline boxes, which sav es the cost to calculate paint invalidation rect
1425 // for every inline box. This won't cause more rasterization invalidations b ecause the whole LayoutInline is being invalidated. 1431 // for every inline box. This won't cause more rasterization invalidations b ecause the whole LayoutInline is being invalidated.
1426 for (InlineFlowBox* box = firstLineBox(); box; box = box->nextLineBox()) 1432 for (InlineFlowBox* box = firstLineBox(); box; box = box->nextLineBox())
1427 paintInvalidationContainer.invalidateDisplayItemClientOnBacking(*box, in validationReason, paintInvalidationRect); 1433 paintInvalidationContainer.invalidateDisplayItemClientOnBacking(*box, in validationReason, paintInvalidationRect);
1428 } 1434 }
1429 1435
1430 } // namespace blink 1436 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutInline.h ('k') | third_party/WebKit/Source/core/layout/LayoutObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698