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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 const ShadowDataVector& shadows() const { return m_shadows; } | 59 const ShadowDataVector& shadows() const { return m_shadows; } |
60 bool operator==(const ShadowList& o) const { return m_shadows == o.m_shadows
; } | 60 bool operator==(const ShadowList& o) const { return m_shadows == o.m_shadows
; } |
61 bool operator!=(const ShadowList& o) const { return !(*this == o); } | 61 bool operator!=(const ShadowList& o) const { return !(*this == o); } |
62 | 62 |
63 static PassRefPtr<ShadowList> blend(const ShadowList* from, const ShadowList
* to, double progress, const Color& currentColor); | 63 static PassRefPtr<ShadowList> blend(const ShadowList* from, const ShadowList
* to, double progress, const Color& currentColor); |
64 | 64 |
65 // Outsets needed to include all shadows in this list, as well as the | 65 // Outsets needed to include all shadows in this list, as well as the |
66 // source (i.e. no outsets will be negative). | 66 // source (i.e. no outsets will be negative). |
67 FloatRectOutsets rectOutsetsIncludingOriginal() const; | 67 FloatRectOutsets rectOutsetsIncludingOriginal() const; |
68 | 68 |
69 void adjustRectForShadow(LayoutRect&) const; | |
70 void adjustRectForShadow(FloatRect&) const; | 69 void adjustRectForShadow(FloatRect&) const; |
71 | 70 |
72 PassOwnPtr<DrawLooperBuilder> createDrawLooper(DrawLooperBuilder::ShadowAlph
aMode, const Color& currentColor, bool isHorizontal = true) const; | 71 PassOwnPtr<DrawLooperBuilder> createDrawLooper(DrawLooperBuilder::ShadowAlph
aMode, const Color& currentColor, bool isHorizontal = true) const; |
73 | 72 |
74 private: | 73 private: |
75 ShadowList(ShadowDataVector& shadows) | 74 ShadowList(ShadowDataVector& shadows) |
76 { | 75 { |
77 // If we have no shadows, we use a null ShadowList | 76 // If we have no shadows, we use a null ShadowList |
78 ASSERT(!shadows.isEmpty()); | 77 ASSERT(!shadows.isEmpty()); |
79 m_shadows.swap(shadows); | 78 m_shadows.swap(shadows); |
80 m_shadows.shrinkToFit(); | 79 m_shadows.shrinkToFit(); |
81 } | 80 } |
82 ShadowDataVector m_shadows; | 81 ShadowDataVector m_shadows; |
83 }; | 82 }; |
84 | 83 |
85 } // namespace blink | 84 } // namespace blink |
86 | 85 |
87 #endif // ShadowList_h | 86 #endif // ShadowList_h |
OLD | NEW |