OLD | NEW |
---|---|
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, 2010 Apple Inc. | 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. |
7 * All rights reserved. | 7 * All rights reserved. |
8 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. | 8 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. |
9 * | 9 * |
10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
(...skipping 1182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1193 visual_rect_flags)) | 1193 visual_rect_flags)) |
1194 return false; | 1194 return false; |
1195 return true; | 1195 return true; |
1196 } | 1196 } |
1197 | 1197 |
1198 // Otherwise, apply the following: | 1198 // Otherwise, apply the following: |
1199 // 1. Transform. | 1199 // 1. Transform. |
1200 // 2. Container offset. | 1200 // 2. Container offset. |
1201 // 3. Container scroll offset. | 1201 // 3. Container scroll offset. |
1202 // 4. Perspective applied by container. | 1202 // 4. Perspective applied by container. |
1203 // 5. Transform flattening. | 1203 // 5. Expansion for pixel snapping. |
1204 // 6. Expansion for pixel snapping. | 1204 // 6. Transform flattening. |
1205 // 7. Container clip. | 1205 // 7. Container clip. |
1206 | 1206 |
1207 // 1. Transform. | 1207 // 1. Transform. |
1208 TransformationMatrix transform; | 1208 TransformationMatrix transform; |
1209 if (Layer() && Layer()->Transform()) | 1209 if (Layer() && Layer()->Transform()) |
1210 transform.Multiply(Layer()->CurrentTransform()); | 1210 transform.Multiply(Layer()->CurrentTransform()); |
1211 | 1211 |
1212 // 2. Container offset. | 1212 // 2. Container offset. |
1213 transform.PostTranslate(container_offset.X().ToFloat(), | 1213 transform.PostTranslate(container_offset.X().ToFloat(), |
1214 container_offset.Y().ToFloat()); | 1214 container_offset.Y().ToFloat()); |
(...skipping 15 matching lines...) Expand all Loading... | |
1230 | 1230 |
1231 TransformationMatrix perspective_matrix; | 1231 TransformationMatrix perspective_matrix; |
1232 perspective_matrix.ApplyPerspective( | 1232 perspective_matrix.ApplyPerspective( |
1233 container_object->Style()->Perspective()); | 1233 container_object->Style()->Perspective()); |
1234 perspective_matrix.ApplyTransformOrigin(perspective_origin.X(), | 1234 perspective_matrix.ApplyTransformOrigin(perspective_origin.X(), |
1235 perspective_origin.Y(), 0); | 1235 perspective_origin.Y(), 0); |
1236 | 1236 |
1237 transform = perspective_matrix * transform; | 1237 transform = perspective_matrix * transform; |
1238 } | 1238 } |
1239 | 1239 |
1240 // 5. Transform flattening. | 1240 // 5. Expansion for pixel snapping. |
1241 transform_state.ApplyTransform(transform, accumulation); | 1241 // Use EnclosingBoundingBox because we cannot properly compute pixel |
1242 | |
1243 // 6. Expansion for pixel snapping. | |
1244 // Use enclosingBoundingBox because we cannot properly compute pixel | |
1245 // snapping for painted elements within the transform since we don't know | 1242 // snapping for painted elements within the transform since we don't know |
1246 // the desired subpixel accumulation at this point, and the transform may | 1243 // the desired subpixel accumulation at this point, and the transform may |
1247 // include a scale. | 1244 // include a scale. |
1248 if (!preserve3D) { | 1245 if (!preserve3D) { |
1249 transform_state.Flatten(); | 1246 transform_state.Flatten(); |
1250 transform_state.SetQuad( | 1247 transform_state.SetQuad( |
1251 FloatQuad(transform_state.LastPlanarQuad().EnclosingBoundingBox())); | 1248 FloatQuad(transform_state.LastPlanarQuad().EnclosingBoundingBox())); |
Xianzhu
2017/04/28 19:35:27
I'm not sure if this is correct:
1. Is it OK to fl
| |
1252 } | 1249 } |
1253 | 1250 |
1251 // 6. Transform flattening. | |
1252 transform_state.ApplyTransform(transform, accumulation); | |
1253 if (!preserve3D) { | |
1254 transform_state.Flatten(); | |
1255 transform_state.SetQuad(FloatQuad(transform_state.LastPlanarQuad())); | |
1256 } | |
1257 | |
1254 // 7. Container clip. | 1258 // 7. Container clip. |
1255 if (container_object->IsBox() && container_object != ancestor && | 1259 if (container_object->IsBox() && container_object != ancestor && |
1256 container_object->HasClipRelatedProperty()) { | 1260 container_object->HasClipRelatedProperty()) { |
1257 return ToLayoutBox(container_object) | 1261 return ToLayoutBox(container_object) |
1258 ->ApplyBoxClips(transform_state, accumulation, visual_rect_flags); | 1262 ->ApplyBoxClips(transform_state, accumulation, visual_rect_flags); |
1259 } | 1263 } |
1260 | 1264 |
1261 return true; | 1265 return true; |
1262 } | 1266 } |
1263 | 1267 |
(...skipping 4638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5902 void LayoutBox::MutableForPainting:: | 5906 void LayoutBox::MutableForPainting:: |
5903 SavePreviousContentBoxSizeAndLayoutOverflowRect() { | 5907 SavePreviousContentBoxSizeAndLayoutOverflowRect() { |
5904 auto& rare_data = GetLayoutBox().EnsureRareData(); | 5908 auto& rare_data = GetLayoutBox().EnsureRareData(); |
5905 rare_data.has_previous_content_box_size_and_layout_overflow_rect_ = true; | 5909 rare_data.has_previous_content_box_size_and_layout_overflow_rect_ = true; |
5906 rare_data.previous_content_box_size_ = GetLayoutBox().ContentBoxRect().Size(); | 5910 rare_data.previous_content_box_size_ = GetLayoutBox().ContentBoxRect().Size(); |
5907 rare_data.previous_layout_overflow_rect_ = | 5911 rare_data.previous_layout_overflow_rect_ = |
5908 GetLayoutBox().LayoutOverflowRect(); | 5912 GetLayoutBox().LayoutOverflowRect(); |
5909 } | 5913 } |
5910 | 5914 |
5911 } // namespace blink | 5915 } // namespace blink |
OLD | NEW |