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

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

Issue 1698143002: Combine 4 bools into GeometryInfoFlags. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Bitshift. Created 4 years, 10 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/LayoutGeometryMap.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
7 * Copyright (C) 2010 Google Inc. All rights reserved. 7 * Copyright (C) 2010 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 958 matching lines...) Expand 10 before | Expand all | Expand 10 after
969 if (ancestorSkipped) { 969 if (ancestorSkipped) {
970 // There can't be a transform between paintInvalidationContainer and anc estorToStopAt, because transforms create containers, so it should be safe 970 // There can't be a transform between paintInvalidationContainer and anc estorToStopAt, because transforms create containers, so it should be safe
971 // to just subtract the delta between the ancestor and ancestorToStopAt. 971 // to just subtract the delta between the ancestor and ancestorToStopAt.
972 adjustmentForSkippedAncestor = -ancestorToStopAt->offsetFromAncestorCont ainer(container); 972 adjustmentForSkippedAncestor = -ancestorToStopAt->offsetFromAncestorCont ainer(container);
973 } 973 }
974 974
975 bool offsetDependsOnPoint = false; 975 bool offsetDependsOnPoint = false;
976 LayoutSize containerOffset = offsetFromContainer(container, LayoutPoint(), & offsetDependsOnPoint); 976 LayoutSize containerOffset = offsetFromContainer(container, LayoutPoint(), & offsetDependsOnPoint);
977 977
978 bool preserve3D = container->style()->preserves3D() || style()->preserves3D( ); 978 bool preserve3D = container->style()->preserves3D() || style()->preserves3D( );
979 GeometryInfoFlags flags = 0;
980 if (preserve3D)
981 flags |= AccumulatingTransform;
982 if (offsetDependsOnPoint)
983 flags |= IsNonUniform;
984 if (isFixedPos)
985 flags |= IsFixedPosition;
986 if (hasTransform)
987 flags |= HasTransform;
979 if (shouldUseTransformFromContainer(container)) { 988 if (shouldUseTransformFromContainer(container)) {
980 TransformationMatrix t; 989 TransformationMatrix t;
981 getTransformFromContainer(container, containerOffset, t); 990 getTransformFromContainer(container, containerOffset, t);
982 t.translateRight(adjustmentForSkippedAncestor.width().toFloat(), adjustm entForSkippedAncestor.height().toFloat()); 991 t.translateRight(adjustmentForSkippedAncestor.width().toFloat(), adjustm entForSkippedAncestor.height().toFloat());
983 geometryMap.push(this, t, preserve3D, offsetDependsOnPoint, isFixedPos, hasTransform); 992 geometryMap.push(this, t, flags);
984 } else { 993 } else {
985 containerOffset += adjustmentForSkippedAncestor; 994 containerOffset += adjustmentForSkippedAncestor;
986 geometryMap.push(this, containerOffset, preserve3D, offsetDependsOnPoint , isFixedPos, hasTransform); 995 geometryMap.push(this, containerOffset, flags);
987 } 996 }
988 997
989 return ancestorSkipped ? ancestorToStopAt : container; 998 return ancestorSkipped ? ancestorToStopAt : container;
990 } 999 }
991 1000
992 void LayoutBoxModelObject::moveChildTo(LayoutBoxModelObject* toBoxModelObject, L ayoutObject* child, LayoutObject* beforeChild, bool fullRemoveInsert) 1001 void LayoutBoxModelObject::moveChildTo(LayoutBoxModelObject* toBoxModelObject, L ayoutObject* child, LayoutObject* beforeChild, bool fullRemoveInsert)
993 { 1002 {
994 // We assume that callers have cleared their positioned objects list for chi ld moves (!fullRemoveInsert) so the 1003 // We assume that callers have cleared their positioned objects list for chi ld moves (!fullRemoveInsert) so the
995 // positioned layoutObject maps don't become stale. It would be too slow to do the map lookup on each call. 1004 // positioned layoutObject maps don't become stale. It would be too slow to do the map lookup on each call.
996 ASSERT(!fullRemoveInsert || !isLayoutBlock() || !toLayoutBlock(this)->hasPos itionedObjects()); 1005 ASSERT(!fullRemoveInsert || !isLayoutBlock() || !toLayoutBlock(this)->hasPos itionedObjects());
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
1058 if (rootElementStyle->hasBackground()) 1067 if (rootElementStyle->hasBackground())
1059 return false; 1068 return false;
1060 1069
1061 if (node() != document().firstBodyElement()) 1070 if (node() != document().firstBodyElement())
1062 return false; 1071 return false;
1063 1072
1064 return true; 1073 return true;
1065 } 1074 }
1066 1075
1067 } // namespace blink 1076 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/LayoutGeometryMap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698