| 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 if (!fromShadow) | 91 if (!fromShadow) |
| 92 fromShadow = toShadow->style() == Inset ? &defaultInsetShadowData :
&defaultShadowData; | 92 fromShadow = toShadow->style() == Inset ? &defaultInsetShadowData :
&defaultShadowData; |
| 93 else if (!toShadow) | 93 else if (!toShadow) |
| 94 toShadow = fromShadow->style() == Inset ? &defaultInsetShadowData :
&defaultShadowData; | 94 toShadow = fromShadow->style() == Inset ? &defaultInsetShadowData :
&defaultShadowData; |
| 95 shadows.append(toShadow->blend(*fromShadow, progress)); | 95 shadows.append(toShadow->blend(*fromShadow, progress)); |
| 96 } | 96 } |
| 97 | 97 |
| 98 return ShadowList::adopt(shadows); | 98 return ShadowList::adopt(shadows); |
| 99 } | 99 } |
| 100 | 100 |
| 101 PassOwnPtr<DrawLooperBuilder> ShadowList::createDrawLooper(DrawLooperBuilder::Sh
adowAlphaMode alphaMode, bool isHorizontal) const | 101 PassOwnPtr<DrawLooperBuilder> ShadowList::createDrawLooper(DrawLooperBuilder::Sh
adowAlphaMode alphaMode) const |
| 102 { | 102 { |
| 103 OwnPtr<DrawLooperBuilder> drawLooperBuilder = DrawLooperBuilder::create(); | 103 OwnPtr<DrawLooperBuilder> drawLooperBuilder = DrawLooperBuilder::create(); |
| 104 for (size_t i = shadows().size(); i--; ) { | 104 for (size_t i = shadows().size(); i--; ) { |
| 105 const ShadowData& shadow = shadows()[i]; | 105 const ShadowData& shadow = shadows()[i]; |
| 106 float shadowX = isHorizontal ? shadow.x() : shadow.y(); | 106 drawLooperBuilder->addShadow(FloatSize(shadow.x(), shadow.y()), shadow.b
lur(), shadow.color(), |
| 107 float shadowY = isHorizontal ? shadow.y() : -shadow.x(); | |
| 108 drawLooperBuilder->addShadow(FloatSize(shadowX, shadowY), shadow.blur(),
shadow.color(), | |
| 109 DrawLooperBuilder::ShadowRespectsTransforms, alphaMode); | 107 DrawLooperBuilder::ShadowRespectsTransforms, alphaMode); |
| 110 } | 108 } |
| 111 drawLooperBuilder->addUnmodifiedContent(); | 109 drawLooperBuilder->addUnmodifiedContent(); |
| 112 return drawLooperBuilder.release(); | 110 return drawLooperBuilder.release(); |
| 113 } | 111 } |
| 114 | 112 |
| 115 } // namespace blink | 113 } // namespace blink |
| OLD | NEW |