OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 29 matching lines...) Expand all Loading... |
40 { | 40 { |
41 FloatRectOutsets outsets; | 41 FloatRectOutsets outsets; |
42 for (const ShadowData& shadow : shadows()) { | 42 for (const ShadowData& shadow : shadows()) { |
43 if (shadow.style() == Inset) | 43 if (shadow.style() == Inset) |
44 continue; | 44 continue; |
45 outsets.unite(shadow.rectOutsets()); | 45 outsets.unite(shadow.rectOutsets()); |
46 } | 46 } |
47 return outsets; | 47 return outsets; |
48 } | 48 } |
49 | 49 |
50 void ShadowList::adjustRectForShadow(LayoutRect& rect) const | |
51 { | |
52 rect.expand(rectOutsetsIncludingOriginal()); | |
53 } | |
54 | |
55 void ShadowList::adjustRectForShadow(FloatRect& rect) const | 50 void ShadowList::adjustRectForShadow(FloatRect& rect) const |
56 { | 51 { |
57 rect.expand(rectOutsetsIncludingOriginal()); | 52 rect.expand(rectOutsetsIncludingOriginal()); |
58 } | 53 } |
59 | 54 |
60 PassRefPtr<ShadowList> ShadowList::blend(const ShadowList* from, const ShadowLis
t* to, double progress, const Color& currentColor) | 55 PassRefPtr<ShadowList> ShadowList::blend(const ShadowList* from, const ShadowLis
t* to, double progress, const Color& currentColor) |
61 { | 56 { |
62 size_t fromLength = from ? from->shadows().size() : 0; | 57 size_t fromLength = from ? from->shadows().size() : 0; |
63 size_t toLength = to ? to->shadows().size() : 0; | 58 size_t toLength = to ? to->shadows().size() : 0; |
64 if (!fromLength && !toLength) | 59 if (!fromLength && !toLength) |
(...skipping 26 matching lines...) Expand all Loading... |
91 float shadowX = isHorizontal ? shadow.x() : shadow.y(); | 86 float shadowX = isHorizontal ? shadow.x() : shadow.y(); |
92 float shadowY = isHorizontal ? shadow.y() : -shadow.x(); | 87 float shadowY = isHorizontal ? shadow.y() : -shadow.x(); |
93 drawLooperBuilder->addShadow(FloatSize(shadowX, shadowY), shadow.blur(),
shadow.color().resolve(currentColor), | 88 drawLooperBuilder->addShadow(FloatSize(shadowX, shadowY), shadow.blur(),
shadow.color().resolve(currentColor), |
94 DrawLooperBuilder::ShadowRespectsTransforms, alphaMode); | 89 DrawLooperBuilder::ShadowRespectsTransforms, alphaMode); |
95 } | 90 } |
96 drawLooperBuilder->addUnmodifiedContent(); | 91 drawLooperBuilder->addUnmodifiedContent(); |
97 return drawLooperBuilder.release(); | 92 return drawLooperBuilder.release(); |
98 } | 93 } |
99 | 94 |
100 } // namespace blink | 95 } // namespace blink |
OLD | NEW |