| 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 { | 121 { |
| 122 switch (getClassType()) { | 122 switch (getClassType()) { |
| 123 case CrossfadeClass: | 123 case CrossfadeClass: |
| 124 return toCSSCrossfadeValue(this)->image(layoutObject, size); | 124 return toCSSCrossfadeValue(this)->image(layoutObject, size); |
| 125 case LinearGradientClass: | 125 case LinearGradientClass: |
| 126 return toCSSLinearGradientValue(this)->image(layoutObject, size); | 126 return toCSSLinearGradientValue(this)->image(layoutObject, size); |
| 127 case PaintClass: | 127 case PaintClass: |
| 128 return toCSSPaintValue(this)->image(layoutObject, size); | 128 return toCSSPaintValue(this)->image(layoutObject, size); |
| 129 case RadialGradientClass: | 129 case RadialGradientClass: |
| 130 return toCSSRadialGradientValue(this)->image(layoutObject, size); | 130 return toCSSRadialGradientValue(this)->image(layoutObject, size); |
| 131 case ConicGradientClass: |
| 132 return toCSSConicGradientValue(this)->image(layoutObject, size); |
| 131 default: | 133 default: |
| 132 ASSERT_NOT_REACHED(); | 134 ASSERT_NOT_REACHED(); |
| 133 } | 135 } |
| 134 return nullptr; | 136 return nullptr; |
| 135 } | 137 } |
| 136 | 138 |
| 137 bool CSSImageGeneratorValue::isFixedSize() const | 139 bool CSSImageGeneratorValue::isFixedSize() const |
| 138 { | 140 { |
| 139 switch (getClassType()) { | 141 switch (getClassType()) { |
| 140 case CrossfadeClass: | 142 case CrossfadeClass: |
| 141 return toCSSCrossfadeValue(this)->isFixedSize(); | 143 return toCSSCrossfadeValue(this)->isFixedSize(); |
| 142 case LinearGradientClass: | 144 case LinearGradientClass: |
| 143 return toCSSLinearGradientValue(this)->isFixedSize(); | 145 return toCSSLinearGradientValue(this)->isFixedSize(); |
| 144 case PaintClass: | 146 case PaintClass: |
| 145 return toCSSPaintValue(this)->isFixedSize(); | 147 return toCSSPaintValue(this)->isFixedSize(); |
| 146 case RadialGradientClass: | 148 case RadialGradientClass: |
| 147 return toCSSRadialGradientValue(this)->isFixedSize(); | 149 return toCSSRadialGradientValue(this)->isFixedSize(); |
| 150 case ConicGradientClass: |
| 151 return toCSSConicGradientValue(this)->isFixedSize(); |
| 148 default: | 152 default: |
| 149 ASSERT_NOT_REACHED(); | 153 ASSERT_NOT_REACHED(); |
| 150 } | 154 } |
| 151 return false; | 155 return false; |
| 152 } | 156 } |
| 153 | 157 |
| 154 IntSize CSSImageGeneratorValue::fixedSize(const LayoutObject& layoutObject, cons
t FloatSize& defaultObjectSize) | 158 IntSize CSSImageGeneratorValue::fixedSize(const LayoutObject& layoutObject, cons
t FloatSize& defaultObjectSize) |
| 155 { | 159 { |
| 156 switch (getClassType()) { | 160 switch (getClassType()) { |
| 157 case CrossfadeClass: | 161 case CrossfadeClass: |
| 158 return toCSSCrossfadeValue(this)->fixedSize(layoutObject, defaultObjectS
ize); | 162 return toCSSCrossfadeValue(this)->fixedSize(layoutObject, defaultObjectS
ize); |
| 159 case LinearGradientClass: | 163 case LinearGradientClass: |
| 160 return toCSSLinearGradientValue(this)->fixedSize(layoutObject); | 164 return toCSSLinearGradientValue(this)->fixedSize(layoutObject); |
| 161 case PaintClass: | 165 case PaintClass: |
| 162 return toCSSPaintValue(this)->fixedSize(layoutObject); | 166 return toCSSPaintValue(this)->fixedSize(layoutObject); |
| 163 case RadialGradientClass: | 167 case RadialGradientClass: |
| 164 return toCSSRadialGradientValue(this)->fixedSize(layoutObject); | 168 return toCSSRadialGradientValue(this)->fixedSize(layoutObject); |
| 169 case ConicGradientClass: |
| 170 return toCSSConicGradientValue(this)->fixedSize(layoutObject); |
| 165 default: | 171 default: |
| 166 ASSERT_NOT_REACHED(); | 172 ASSERT_NOT_REACHED(); |
| 167 } | 173 } |
| 168 return IntSize(); | 174 return IntSize(); |
| 169 } | 175 } |
| 170 | 176 |
| 171 bool CSSImageGeneratorValue::isPending() const | 177 bool CSSImageGeneratorValue::isPending() const |
| 172 { | 178 { |
| 173 switch (getClassType()) { | 179 switch (getClassType()) { |
| 174 case CrossfadeClass: | 180 case CrossfadeClass: |
| 175 return toCSSCrossfadeValue(this)->isPending(); | 181 return toCSSCrossfadeValue(this)->isPending(); |
| 176 case LinearGradientClass: | 182 case LinearGradientClass: |
| 177 return toCSSLinearGradientValue(this)->isPending(); | 183 return toCSSLinearGradientValue(this)->isPending(); |
| 178 case PaintClass: | 184 case PaintClass: |
| 179 return toCSSPaintValue(this)->isPending(); | 185 return toCSSPaintValue(this)->isPending(); |
| 180 case RadialGradientClass: | 186 case RadialGradientClass: |
| 181 return toCSSRadialGradientValue(this)->isPending(); | 187 return toCSSRadialGradientValue(this)->isPending(); |
| 188 case ConicGradientClass: |
| 189 return toCSSConicGradientValue(this)->isPending(); |
| 182 default: | 190 default: |
| 183 ASSERT_NOT_REACHED(); | 191 ASSERT_NOT_REACHED(); |
| 184 } | 192 } |
| 185 return false; | 193 return false; |
| 186 } | 194 } |
| 187 | 195 |
| 188 bool CSSImageGeneratorValue::knownToBeOpaque(const LayoutObject& layoutObject) c
onst | 196 bool CSSImageGeneratorValue::knownToBeOpaque(const LayoutObject& layoutObject) c
onst |
| 189 { | 197 { |
| 190 switch (getClassType()) { | 198 switch (getClassType()) { |
| 191 case CrossfadeClass: | 199 case CrossfadeClass: |
| 192 return toCSSCrossfadeValue(this)->knownToBeOpaque(layoutObject); | 200 return toCSSCrossfadeValue(this)->knownToBeOpaque(layoutObject); |
| 193 case LinearGradientClass: | 201 case LinearGradientClass: |
| 194 return toCSSLinearGradientValue(this)->knownToBeOpaque(layoutObject); | 202 return toCSSLinearGradientValue(this)->knownToBeOpaque(layoutObject); |
| 195 case PaintClass: | 203 case PaintClass: |
| 196 return toCSSPaintValue(this)->knownToBeOpaque(layoutObject); | 204 return toCSSPaintValue(this)->knownToBeOpaque(layoutObject); |
| 197 case RadialGradientClass: | 205 case RadialGradientClass: |
| 198 return toCSSRadialGradientValue(this)->knownToBeOpaque(layoutObject); | 206 return toCSSRadialGradientValue(this)->knownToBeOpaque(layoutObject); |
| 207 case ConicGradientClass: |
| 208 return toCSSConicGradientValue(this)->knownToBeOpaque(layoutObject); |
| 199 default: | 209 default: |
| 200 ASSERT_NOT_REACHED(); | 210 ASSERT_NOT_REACHED(); |
| 201 } | 211 } |
| 202 return false; | 212 return false; |
| 203 } | 213 } |
| 204 | 214 |
| 205 void CSSImageGeneratorValue::loadSubimages(Document* document) | 215 void CSSImageGeneratorValue::loadSubimages(Document* document) |
| 206 { | 216 { |
| 207 switch (getClassType()) { | 217 switch (getClassType()) { |
| 208 case CrossfadeClass: | 218 case CrossfadeClass: |
| 209 toCSSCrossfadeValue(this)->loadSubimages(document); | 219 toCSSCrossfadeValue(this)->loadSubimages(document); |
| 210 break; | 220 break; |
| 211 case LinearGradientClass: | 221 case LinearGradientClass: |
| 212 toCSSLinearGradientValue(this)->loadSubimages(document); | 222 toCSSLinearGradientValue(this)->loadSubimages(document); |
| 213 break; | 223 break; |
| 214 case PaintClass: | 224 case PaintClass: |
| 215 toCSSPaintValue(this)->loadSubimages(document); | 225 toCSSPaintValue(this)->loadSubimages(document); |
| 216 break; | 226 break; |
| 217 case RadialGradientClass: | 227 case RadialGradientClass: |
| 218 toCSSRadialGradientValue(this)->loadSubimages(document); | 228 toCSSRadialGradientValue(this)->loadSubimages(document); |
| 219 break; | 229 break; |
| 230 case ConicGradientClass: |
| 231 toCSSConicGradientValue(this)->loadSubimages(document); |
| 232 break; |
| 220 default: | 233 default: |
| 221 ASSERT_NOT_REACHED(); | 234 ASSERT_NOT_REACHED(); |
| 222 } | 235 } |
| 223 } | 236 } |
| 224 | 237 |
| 225 } // namespace blink | 238 } // namespace blink |
| OLD | NEW |