| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2011 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 16 matching lines...) Expand all Loading... |
| 27 #include "core/css/CSSCrossfadeValue.h" | 27 #include "core/css/CSSCrossfadeValue.h" |
| 28 | 28 |
| 29 #include "core/css/CSSImageValue.h" | 29 #include "core/css/CSSImageValue.h" |
| 30 #include "core/layout/LayoutObject.h" | 30 #include "core/layout/LayoutObject.h" |
| 31 #include "core/style/StyleFetchedImage.h" | 31 #include "core/style/StyleFetchedImage.h" |
| 32 #include "platform/graphics/CrossfadeGeneratedImage.h" | 32 #include "platform/graphics/CrossfadeGeneratedImage.h" |
| 33 #include "wtf/text/StringBuilder.h" | 33 #include "wtf/text/StringBuilder.h" |
| 34 | 34 |
| 35 namespace blink { | 35 namespace blink { |
| 36 | 36 |
| 37 static bool subimageIsPending(CSSValue value) | 37 static bool subimageIsPending(const CSSValue& value) |
| 38 { | 38 { |
| 39 if (value.isImageValue()) | 39 if (value.isImageValue()) |
| 40 return toCSSImageValue(value).cachedOrPendingImage()->isPendingImage(); | 40 return toCSSImageValue(value).cachedOrPendingImage()->isPendingImage(); |
| 41 | 41 |
| 42 if (value.isImageGeneratorValue()) | 42 if (value.isImageGeneratorValue()) |
| 43 return toCSSImageGeneratorValue(value).isPending(); | 43 return toCSSImageGeneratorValue(value).isPending(); |
| 44 | 44 |
| 45 ASSERT_NOT_REACHED(); | 45 ASSERT_NOT_REACHED(); |
| 46 | 46 |
| 47 return false; | 47 return false; |
| 48 } | 48 } |
| 49 | 49 |
| 50 static bool subimageKnownToBeOpaque(CSSValue value, const LayoutObject* layoutOb
ject) | 50 static bool subimageKnownToBeOpaque(const CSSValue& value, const LayoutObject* l
ayoutObject) |
| 51 { | 51 { |
| 52 if (value.isImageValue()) | 52 if (value.isImageValue()) |
| 53 return toCSSImageValue(value).knownToBeOpaque(layoutObject); | 53 return toCSSImageValue(value).knownToBeOpaque(layoutObject); |
| 54 | 54 |
| 55 if (value.isImageGeneratorValue()) | 55 if (value.isImageGeneratorValue()) |
| 56 return toCSSImageGeneratorValue(value).knownToBeOpaque(layoutObject); | 56 return toCSSImageGeneratorValue(value).knownToBeOpaque(layoutObject); |
| 57 | 57 |
| 58 ASSERT_NOT_REACHED(); | 58 ASSERT_NOT_REACHED(); |
| 59 | 59 |
| 60 return false; | 60 return false; |
| 61 } | 61 } |
| 62 | 62 |
| 63 static ImageResource* cachedImageForCSSValue(CSSValue value, Document* document) | 63 static ImageResource* cachedImageForCSSValue(const CSSValue& value, Document* do
cument) |
| 64 { | 64 { |
| 65 if (value.isImageValue()) { | 65 if (value.isImageValue()) { |
| 66 StyleFetchedImage* styleImageResource = toCSSImageValue(value).cachedIma
ge(document); | 66 StyleFetchedImage* styleImageResource = toCSSImageValue(value).cachedIma
ge(document); |
| 67 if (!styleImageResource) | 67 if (!styleImageResource) |
| 68 return 0; | 68 return 0; |
| 69 | 69 |
| 70 return styleImageResource->cachedImage(); | 70 return styleImageResource->cachedImage(); |
| 71 } | 71 } |
| 72 | 72 |
| 73 if (value.isImageGeneratorValue()) { | 73 if (value.isImageGeneratorValue()) { |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 | 216 |
| 217 DEFINE_TRACE_AFTER_DISPATCH(CSSCrossfadeValue) | 217 DEFINE_TRACE_AFTER_DISPATCH(CSSCrossfadeValue) |
| 218 { | 218 { |
| 219 visitor->trace(m_fromValue); | 219 visitor->trace(m_fromValue); |
| 220 visitor->trace(m_toValue); | 220 visitor->trace(m_toValue); |
| 221 visitor->trace(m_percentageValue); | 221 visitor->trace(m_percentageValue); |
| 222 CSSImageGeneratorValue::traceAfterDispatch(visitor); | 222 CSSImageGeneratorValue::traceAfterDispatch(visitor); |
| 223 } | 223 } |
| 224 | 224 |
| 225 } // namespace blink | 225 } // namespace blink |
| OLD | NEW |