| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 #include "platform/graphics/paint/DisplayItemTransformTreeBuilder.h" | 6 #include "platform/graphics/paint/DisplayItemTransformTreeBuilder.h" |
| 7 | 7 |
| 8 #include "platform/graphics/paint/DisplayItem.h" | 8 #include "platform/graphics/paint/DisplayItem.h" |
| 9 #include "platform/graphics/paint/DisplayItemTransformTree.h" | 9 #include "platform/graphics/paint/DisplayItemTransformTree.h" |
| 10 #include "platform/graphics/paint/Transform3DDisplayItem.h" | 10 #include "platform/graphics/paint/Transform3DDisplayItem.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 enum BeginDisplayItemClassification { NotATransform = 0, Only2DTranslation, Requ
iresTransformNode }; | 37 enum BeginDisplayItemClassification { NotATransform = 0, Only2DTranslation, Requ
iresTransformNode }; |
| 38 | 38 |
| 39 // Classifies a display item based on whether it is a transform, and if so, | 39 // Classifies a display item based on whether it is a transform, and if so, |
| 40 // whether it should be get a transform node. | 40 // whether it should be get a transform node. |
| 41 // If it is a transform (including a translation), the TransformationMatrix | 41 // If it is a transform (including a translation), the TransformationMatrix |
| 42 // will be copied to output parameter. | 42 // will be copied to output parameter. |
| 43 static BeginDisplayItemClassification classifyBeginItem(const DisplayItem& begin
DisplayItem, TransformationMatrix* transform) | 43 static BeginDisplayItemClassification classifyBeginItem(const DisplayItem& begin
DisplayItem, TransformationMatrix* transform) |
| 44 { | 44 { |
| 45 ASSERT(beginDisplayItem.isBegin()); | 45 ASSERT(beginDisplayItem.isBegin()); |
| 46 | 46 |
| 47 if (beginDisplayItem.type() == DisplayItem::BeginTransform3D) { | 47 if (DisplayItem::isTransform3DType(beginDisplayItem.type())) { |
| 48 const auto& begin3D = static_cast<const BeginTransform3DDisplayItem&>(be
ginDisplayItem); | 48 const auto& begin3D = static_cast<const BeginTransform3DDisplayItem&>(be
ginDisplayItem); |
| 49 *transform = begin3D.transform(); | 49 *transform = begin3D.transform(); |
| 50 if (transform->isIdentityOr2DTranslation()) | 50 if (transform->isIdentityOr2DTranslation()) |
| 51 return Only2DTranslation; | 51 return Only2DTranslation; |
| 52 return RequiresTransformNode; | 52 return RequiresTransformNode; |
| 53 } | 53 } |
| 54 return NotATransform; | 54 return NotATransform; |
| 55 } | 55 } |
| 56 | 56 |
| 57 } // namespace | 57 } // namespace |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 const auto& current = currentTransformNodeData(); | 102 const auto& current = currentTransformNodeData(); |
| 103 m_transformTree->appendRangeRecord(m_rangeBeginIndex, m_currentIndex, cu
rrent.transformNode, current.offset); | 103 m_transformTree->appendRangeRecord(m_rangeBeginIndex, m_currentIndex, cu
rrent.transformNode, current.offset); |
| 104 } | 104 } |
| 105 | 105 |
| 106 // The current display item is a boundary. | 106 // The current display item is a boundary. |
| 107 // The earliest the next range could begin is the next one. | 107 // The earliest the next range could begin is the next one. |
| 108 m_rangeBeginIndex = m_currentIndex + 1; | 108 m_rangeBeginIndex = m_currentIndex + 1; |
| 109 } | 109 } |
| 110 | 110 |
| 111 } // namespace blink | 111 } // namespace blink |
| OLD | NEW |