Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2012 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2014 Google Inc. All rights reserved. | 3 * Copyright (C) 2014 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 29 | 29 |
| 30 #include "platform/geometry/LayoutSize.h" | 30 #include "platform/geometry/LayoutSize.h" |
| 31 #include "platform/transforms/TransformationMatrix.h" | 31 #include "platform/transforms/TransformationMatrix.h" |
| 32 #include "wtf/Allocator.h" | 32 #include "wtf/Allocator.h" |
| 33 #include "wtf/OwnPtr.h" | 33 #include "wtf/OwnPtr.h" |
| 34 | 34 |
| 35 namespace blink { | 35 namespace blink { |
| 36 | 36 |
| 37 class LayoutObject; | 37 class LayoutObject; |
| 38 | 38 |
| 39 enum GeometryInfoFlag { | |
| 40 AccumulatingTransform = 1, | |
|
leviw_travelin_and_unemployed
2016/02/16 01:41:57
Nit: bitshift or hex for clarity?
mstensho (USE GERRIT)
2016/02/16 10:15:04
I considered octal, but went with the bitshift sol
| |
| 41 IsNonUniform = 2, // Mapping depends on the input point, e.g. because of CSS columns. | |
| 42 IsFixedPosition = 4, | |
| 43 HasTransform = 8 | |
| 44 }; | |
| 45 typedef unsigned GeometryInfoFlags; | |
| 46 | |
| 39 // Stores data about how to map from one layoutObject to its container. | 47 // Stores data about how to map from one layoutObject to its container. |
| 40 struct LayoutGeometryMapStep { | 48 struct LayoutGeometryMapStep { |
| 41 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); | 49 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); |
| 42 LayoutGeometryMapStep(const LayoutGeometryMapStep& o) | 50 LayoutGeometryMapStep(const LayoutGeometryMapStep& o) |
| 43 : m_layoutObject(o.m_layoutObject) | 51 : m_layoutObject(o.m_layoutObject) |
| 44 , m_offset(o.m_offset) | 52 , m_offset(o.m_offset) |
| 45 , m_offsetForFixedPosition(o.m_offsetForFixedPosition) | 53 , m_offsetForFixedPosition(o.m_offsetForFixedPosition) |
| 46 , m_accumulatingTransform(o.m_accumulatingTransform) | 54 , m_flags(o.m_flags) |
| 47 , m_isNonUniform(o.m_isNonUniform) | |
| 48 , m_isFixedPosition(o.m_isFixedPosition) | |
| 49 , m_hasTransform(o.m_hasTransform) | |
| 50 { | 55 { |
| 51 ASSERT(!o.m_transform); | 56 ASSERT(!o.m_transform); |
| 52 } | 57 } |
| 53 LayoutGeometryMapStep(const LayoutObject* layoutObject, bool accumulatingTra nsform, bool isNonUniform, bool isFixedPosition, bool hasTransform) | 58 LayoutGeometryMapStep(const LayoutObject* layoutObject, GeometryInfoFlags fl ags) |
| 54 : m_layoutObject(layoutObject) | 59 : m_layoutObject(layoutObject) |
| 55 , m_accumulatingTransform(accumulatingTransform) | 60 , m_flags(flags) |
| 56 , m_isNonUniform(isNonUniform) | |
| 57 , m_isFixedPosition(isFixedPosition) | |
| 58 , m_hasTransform(hasTransform) | |
| 59 { | 61 { |
| 60 } | 62 } |
| 61 const LayoutObject* m_layoutObject; | 63 const LayoutObject* m_layoutObject; |
| 62 LayoutSize m_offset; | 64 LayoutSize m_offset; |
| 63 OwnPtr<TransformationMatrix> m_transform; // Includes offset if non-null. | 65 OwnPtr<TransformationMatrix> m_transform; // Includes offset if non-null. |
| 64 LayoutSize m_offsetForFixedPosition; | 66 LayoutSize m_offsetForFixedPosition; |
| 65 bool m_accumulatingTransform; | 67 GeometryInfoFlags m_flags; |
| 66 bool m_isNonUniform; // Mapping depends on the input point, e.g. because of CSS columns. | |
| 67 bool m_isFixedPosition; | |
| 68 bool m_hasTransform; | |
| 69 }; | 68 }; |
| 70 | 69 |
| 71 } // namespace blink | 70 } // namespace blink |
| 72 | 71 |
| 73 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(blink::LayoutGeometryMapStep) ; | 72 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(blink::LayoutGeometryMapStep) ; |
| 74 | 73 |
| 75 #endif // LayoutGeometryMapStep_h | 74 #endif // LayoutGeometryMapStep_h |
| OLD | NEW |