| 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 default: | 120 default: |
| 121 ASSERT_NOT_REACHED(); | 121 ASSERT_NOT_REACHED(); |
| 122 } | 122 } |
| 123 return 0; | 123 return 0; |
| 124 } | 124 } |
| 125 | 125 |
| 126 bool CSSImageGeneratorValue::isFixedSize() const | 126 bool CSSImageGeneratorValue::isFixedSize() const |
| 127 { | 127 { |
| 128 switch (classType()) { | 128 switch (classType()) { |
| 129 case CanvasClass: | 129 case CanvasClass: |
| 130 return static_cast<const CSSCanvasValue*>(this)->isFixedSize(); | 130 return toCSSCanvasValue(this)->isFixedSize(); |
| 131 case CrossfadeClass: | 131 case CrossfadeClass: |
| 132 return static_cast<const CSSCrossfadeValue*>(this)->isFixedSize(); | 132 return toCSSCrossfadeValue(this)->isFixedSize(); |
| 133 case LinearGradientClass: | 133 case LinearGradientClass: |
| 134 return static_cast<const CSSLinearGradientValue*>(this)->isFixedSize(); | 134 return toCSSLinearGradientValue(this)->isFixedSize(); |
| 135 case RadialGradientClass: | 135 case RadialGradientClass: |
| 136 return static_cast<const CSSRadialGradientValue*>(this)->isFixedSize(); | 136 return toCSSRadialGradientValue(this)->isFixedSize(); |
| 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 toCSSCanvasValue(this)->fixedSize(renderer); | 147 return toCSSCanvasValue(this)->fixedSize(renderer); |
| 148 case CrossfadeClass: | 148 case CrossfadeClass: |
| 149 return toCSSCrossfadeValue(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 |
| 160 bool CSSImageGeneratorValue::isPending() const | 160 bool CSSImageGeneratorValue::isPending() const |
| 161 { | 161 { |
| 162 switch (classType()) { | 162 switch (classType()) { |
| 163 case CrossfadeClass: | 163 case CrossfadeClass: |
| 164 return static_cast<const CSSCrossfadeValue*>(this)->isPending(); | 164 return toCSSCrossfadeValue(this)->isPending(); |
| 165 case CanvasClass: | 165 case CanvasClass: |
| 166 return static_cast<const CSSCanvasValue*>(this)->isPending(); | 166 return toCSSCanvasValue(this)->isPending(); |
| 167 case LinearGradientClass: | 167 case LinearGradientClass: |
| 168 return static_cast<const CSSLinearGradientValue*>(this)->isPending(); | 168 return toCSSLinearGradientValue(this)->isPending(); |
| 169 case RadialGradientClass: | 169 case RadialGradientClass: |
| 170 return static_cast<const CSSRadialGradientValue*>(this)->isPending(); | 170 return toCSSRadialGradientValue(this)->isPending(); |
| 171 default: | 171 default: |
| 172 ASSERT_NOT_REACHED(); | 172 ASSERT_NOT_REACHED(); |
| 173 } | 173 } |
| 174 return false; | 174 return false; |
| 175 } | 175 } |
| 176 | 176 |
| 177 bool CSSImageGeneratorValue::knownToBeOpaque(const RenderObject* renderer) const | 177 bool CSSImageGeneratorValue::knownToBeOpaque(const RenderObject* renderer) const |
| 178 { | 178 { |
| 179 switch (classType()) { | 179 switch (classType()) { |
| 180 case CrossfadeClass: | 180 case CrossfadeClass: |
| 181 return static_cast<const CSSCrossfadeValue*>(this)->knownToBeOpaque(rend
erer); | 181 return toCSSCrossfadeValue(this)->knownToBeOpaque(renderer); |
| 182 case CanvasClass: | 182 case CanvasClass: |
| 183 return false; | 183 return false; |
| 184 case LinearGradientClass: | 184 case LinearGradientClass: |
| 185 return static_cast<const CSSLinearGradientValue*>(this)->knownToBeOpaque
(renderer); | 185 return toCSSLinearGradientValue(this)->knownToBeOpaque(renderer); |
| 186 case RadialGradientClass: | 186 case RadialGradientClass: |
| 187 return static_cast<const CSSRadialGradientValue*>(this)->knownToBeOpaque
(renderer); | 187 return toCSSRadialGradientValue(this)->knownToBeOpaque(renderer); |
| 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 toCSSCrossfadeValue(this)->loadSubimages(fetcher); | 198 toCSSCrossfadeValue(this)->loadSubimages(fetcher); |
| 199 break; | 199 break; |
| 200 case CanvasClass: | 200 case CanvasClass: |
| 201 toCSSCanvasValue(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 |