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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 const ShadowList* to, | 53 const ShadowList* to, |
54 double progress, | 54 double progress, |
55 const Color& currentColor) { | 55 const Color& currentColor) { |
56 size_t fromLength = from ? from->shadows().size() : 0; | 56 size_t fromLength = from ? from->shadows().size() : 0; |
57 size_t toLength = to ? to->shadows().size() : 0; | 57 size_t toLength = to ? to->shadows().size() : 0; |
58 if (!fromLength && !toLength) | 58 if (!fromLength && !toLength) |
59 return nullptr; | 59 return nullptr; |
60 | 60 |
61 ShadowDataVector shadows; | 61 ShadowDataVector shadows; |
62 | 62 |
63 DEFINE_STATIC_LOCAL( | 63 DEFINE_STATIC_LOCAL(ShadowData, defaultShadowData, |
64 ShadowData, defaultShadowData, | 64 (ShadowData::neutralValue())); |
65 (FloatPoint(), 0, 0, Normal, StyleColor(Color::transparent))); | |
66 DEFINE_STATIC_LOCAL( | 65 DEFINE_STATIC_LOCAL( |
67 ShadowData, defaultInsetShadowData, | 66 ShadowData, defaultInsetShadowData, |
68 (FloatPoint(), 0, 0, Inset, StyleColor(Color::transparent))); | 67 (FloatPoint(), 0, 0, Inset, StyleColor(Color::transparent))); |
69 | 68 |
70 size_t maxLength = std::max(fromLength, toLength); | 69 size_t maxLength = std::max(fromLength, toLength); |
71 for (size_t i = 0; i < maxLength; ++i) { | 70 for (size_t i = 0; i < maxLength; ++i) { |
72 const ShadowData* fromShadow = i < fromLength ? &from->shadows()[i] : 0; | 71 const ShadowData* fromShadow = i < fromLength ? &from->shadows()[i] : 0; |
73 const ShadowData* toShadow = i < toLength ? &to->shadows()[i] : 0; | 72 const ShadowData* toShadow = i < toLength ? &to->shadows()[i] : 0; |
74 if (!fromShadow) | 73 if (!fromShadow) |
75 fromShadow = toShadow->style() == Inset ? &defaultInsetShadowData | 74 fromShadow = toShadow->style() == Inset ? &defaultInsetShadowData |
(...skipping 19 matching lines...) Expand all Loading... |
95 drawLooperBuilder.addShadow(FloatSize(shadowX, shadowY), shadow.blur(), | 94 drawLooperBuilder.addShadow(FloatSize(shadowX, shadowY), shadow.blur(), |
96 shadow.color().resolve(currentColor), | 95 shadow.color().resolve(currentColor), |
97 DrawLooperBuilder::ShadowRespectsTransforms, | 96 DrawLooperBuilder::ShadowRespectsTransforms, |
98 alphaMode); | 97 alphaMode); |
99 } | 98 } |
100 drawLooperBuilder.addUnmodifiedContent(); | 99 drawLooperBuilder.addUnmodifiedContent(); |
101 return drawLooperBuilder.detachDrawLooper(); | 100 return drawLooperBuilder.detachDrawLooper(); |
102 } | 101 } |
103 | 102 |
104 } // namespace blink | 103 } // namespace blink |
OLD | NEW |