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

Side by Side Diff: Source/core/rendering/style/BasicShapes.cpp

Issue 132643006: Take into account fill-rule for polygon interpolation (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase against ToT Created 6 years, 11 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 | « LayoutTests/virtual/legacy-animations-engine/animations/interpolation/shape-outside-expected.txt ('k') | no next file » | 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) 2012 Adobe Systems Incorporated. All rights reserved. 2 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above 8 * 1. Redistributions of source code must retain the above
9 * copyright notice, this list of conditions and the following 9 * copyright notice, this list of conditions and the following
10 * disclaimer. 10 * disclaimer.
(...skipping 27 matching lines...) Expand all
38 namespace WebCore { 38 namespace WebCore {
39 39
40 bool BasicShape::canBlend(const BasicShape* other) const 40 bool BasicShape::canBlend(const BasicShape* other) const
41 { 41 {
42 // FIXME: Support animations between different shapes in the future. 42 // FIXME: Support animations between different shapes in the future.
43 if (!other || !isSameType(*other)) 43 if (!other || !isSameType(*other))
44 return false; 44 return false;
45 45
46 // Just polygons with same number of vertices can be animated. 46 // Just polygons with same number of vertices can be animated.
47 if (type() == BasicShape::BasicShapePolygonType 47 if (type() == BasicShape::BasicShapePolygonType
48 && static_cast<const BasicShapePolygon*>(this)->values().size() != stati c_cast<const BasicShapePolygon*>(other)->values().size()) 48 && (static_cast<const BasicShapePolygon*>(this)->values().size() != stat ic_cast<const BasicShapePolygon*>(other)->values().size()
49 || static_cast<const BasicShapePolygon*>(this)->windRule() != static_cas t<const BasicShapePolygon*>(other)->windRule()))
49 return false; 50 return false;
50 51
51 // Circles with keywords for radii or center coordinates cannot be animated. 52 // Circles with keywords for radii or center coordinates cannot be animated.
52 if (type() == BasicShape::BasicShapeCircleType) { 53 if (type() == BasicShape::BasicShapeCircleType) {
53 const BasicShapeCircle* thisCircle = static_cast<const BasicShapeCircle* >(this); 54 const BasicShapeCircle* thisCircle = static_cast<const BasicShapeCircle* >(this);
54 const BasicShapeCircle* otherCircle = static_cast<const BasicShapeCircle *>(other); 55 const BasicShapeCircle* otherCircle = static_cast<const BasicShapeCircle *>(other);
55 if (!thisCircle->radius().canBlend(otherCircle->radius()) 56 if (!thisCircle->radius().canBlend(otherCircle->radius())
56 || !thisCircle->centerX().canBlend(otherCircle->centerX()) 57 || !thisCircle->centerX().canBlend(otherCircle->centerX())
57 || !thisCircle->centerY().canBlend(otherCircle->centerY())) 58 || !thisCircle->centerY().canBlend(otherCircle->centerY()))
58 return false; 59 return false;
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 } 369 }
369 370
370 bool BasicShapeInsetRectangle::operator==(const BasicShape& o) const 371 bool BasicShapeInsetRectangle::operator==(const BasicShape& o) const
371 { 372 {
372 if (!isSameType(o)) 373 if (!isSameType(o))
373 return false; 374 return false;
374 const BasicShapeInsetRectangle& other = toBasicShapeInsetRectangle(o); 375 const BasicShapeInsetRectangle& other = toBasicShapeInsetRectangle(o);
375 return m_right == other.m_right && m_top == other.m_top && m_bottom == other .m_bottom && m_left == other.m_left && m_cornerRadiusX == other.m_cornerRadiusX && m_cornerRadiusY == other.m_cornerRadiusY; 376 return m_right == other.m_right && m_top == other.m_top && m_bottom == other .m_bottom && m_left == other.m_left && m_cornerRadiusX == other.m_cornerRadiusX && m_cornerRadiusY == other.m_cornerRadiusY;
376 } 377 }
377 } 378 }
OLDNEW
« no previous file with comments | « LayoutTests/virtual/legacy-animations-engine/animations/interpolation/shape-outside-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698