| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008 Apple 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 | 103 |
| 104 void CSSImageGeneratorValue::putImage(const IntSize& size, PassRefPtr<Image> ima
ge) | 104 void CSSImageGeneratorValue::putImage(const IntSize& size, PassRefPtr<Image> ima
ge) |
| 105 { | 105 { |
| 106 m_images.add(size, image); | 106 m_images.add(size, image); |
| 107 } | 107 } |
| 108 | 108 |
| 109 PassRefPtr<Image> CSSImageGeneratorValue::image(RenderObject* renderer, const In
tSize& size) | 109 PassRefPtr<Image> CSSImageGeneratorValue::image(RenderObject* renderer, const In
tSize& size) |
| 110 { | 110 { |
| 111 switch (classType()) { | 111 switch (classType()) { |
| 112 case CanvasClass: | 112 case CanvasClass: |
| 113 return static_cast<CSSCanvasValue*>(this)->image(renderer, size); | 113 return toCSSCanvasValue(this)->image(renderer, size); |
| 114 case CrossfadeClass: | 114 case CrossfadeClass: |
| 115 return static_cast<CSSCrossfadeValue*>(this)->image(renderer, size); | 115 return toCSSCrossfadeValue(this)->image(renderer, size); |
| 116 case LinearGradientClass: | 116 case LinearGradientClass: |
| 117 return toCSSLinearGradientValue(this)->image(renderer, size); | 117 return toCSSLinearGradientValue(this)->image(renderer, size); |
| 118 case RadialGradientClass: | 118 case RadialGradientClass: |
| 119 return toCSSRadialGradientValue(this)->image(renderer, size); | 119 return toCSSRadialGradientValue(this)->image(renderer, size); |
| 120 default: | 120 default: |
| 121 ASSERT_NOT_REACHED(); | 121 ASSERT_NOT_REACHED(); |
| 122 } | 122 } |
| 123 return 0; | 123 return 0; |
| 124 } | 124 } |
| 125 | 125 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 137 default: | 137 default: |
| 138 ASSERT_NOT_REACHED(); | 138 ASSERT_NOT_REACHED(); |
| 139 } | 139 } |
| 140 return false; | 140 return false; |
| 141 } | 141 } |
| 142 | 142 |
| 143 IntSize CSSImageGeneratorValue::fixedSize(const RenderObject* renderer) | 143 IntSize CSSImageGeneratorValue::fixedSize(const RenderObject* renderer) |
| 144 { | 144 { |
| 145 switch (classType()) { | 145 switch (classType()) { |
| 146 case CanvasClass: | 146 case CanvasClass: |
| 147 return static_cast<CSSCanvasValue*>(this)->fixedSize(renderer); | 147 return toCSSCanvasValue(this)->fixedSize(renderer); |
| 148 case CrossfadeClass: | 148 case CrossfadeClass: |
| 149 return static_cast<CSSCrossfadeValue*>(this)->fixedSize(renderer); | 149 return toCSSCrossfadeValue(this)->fixedSize(renderer); |
| 150 case LinearGradientClass: | 150 case LinearGradientClass: |
| 151 return toCSSLinearGradientValue(this)->fixedSize(renderer); | 151 return toCSSLinearGradientValue(this)->fixedSize(renderer); |
| 152 case RadialGradientClass: | 152 case RadialGradientClass: |
| 153 return toCSSRadialGradientValue(this)->fixedSize(renderer); | 153 return toCSSRadialGradientValue(this)->fixedSize(renderer); |
| 154 default: | 154 default: |
| 155 ASSERT_NOT_REACHED(); | 155 ASSERT_NOT_REACHED(); |
| 156 } | 156 } |
| 157 return IntSize(); | 157 return IntSize(); |
| 158 } | 158 } |
| 159 | 159 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 188 default: | 188 default: |
| 189 ASSERT_NOT_REACHED(); | 189 ASSERT_NOT_REACHED(); |
| 190 } | 190 } |
| 191 return false; | 191 return false; |
| 192 } | 192 } |
| 193 | 193 |
| 194 void CSSImageGeneratorValue::loadSubimages(ResourceFetcher* fetcher) | 194 void CSSImageGeneratorValue::loadSubimages(ResourceFetcher* fetcher) |
| 195 { | 195 { |
| 196 switch (classType()) { | 196 switch (classType()) { |
| 197 case CrossfadeClass: | 197 case CrossfadeClass: |
| 198 static_cast<CSSCrossfadeValue*>(this)->loadSubimages(fetcher); | 198 toCSSCrossfadeValue(this)->loadSubimages(fetcher); |
| 199 break; | 199 break; |
| 200 case CanvasClass: | 200 case CanvasClass: |
| 201 static_cast<CSSCanvasValue*>(this)->loadSubimages(fetcher); | 201 toCSSCanvasValue(this)->loadSubimages(fetcher); |
| 202 break; | 202 break; |
| 203 case LinearGradientClass: | 203 case LinearGradientClass: |
| 204 toCSSLinearGradientValue(this)->loadSubimages(fetcher); | 204 toCSSLinearGradientValue(this)->loadSubimages(fetcher); |
| 205 break; | 205 break; |
| 206 case RadialGradientClass: | 206 case RadialGradientClass: |
| 207 toCSSRadialGradientValue(this)->loadSubimages(fetcher); | 207 toCSSRadialGradientValue(this)->loadSubimages(fetcher); |
| 208 break; | 208 break; |
| 209 default: | 209 default: |
| 210 ASSERT_NOT_REACHED(); | 210 ASSERT_NOT_REACHED(); |
| 211 } | 211 } |
| 212 } | 212 } |
| 213 | 213 |
| 214 } // namespace WebCore | 214 } // namespace WebCore |
| OLD | NEW |