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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 | 81 |
82 ASSERT_NOT_REACHED(); | 82 ASSERT_NOT_REACHED(); |
83 | 83 |
84 return nullptr; | 84 return nullptr; |
85 } | 85 } |
86 | 86 |
87 static Image* renderableImageForCSSValue(CSSValue* value, const LayoutObject* la
youtObject) | 87 static Image* renderableImageForCSSValue(CSSValue* value, const LayoutObject* la
youtObject) |
88 { | 88 { |
89 ImageResource* cachedImage = cachedImageForCSSValue(value, &layoutObject->do
cument()); | 89 ImageResource* cachedImage = cachedImageForCSSValue(value, &layoutObject->do
cument()); |
90 | 90 |
91 // If the image can be rendered at 1 zoom it will have non-empty dimension | 91 if (!cachedImage || !cachedImage->canRender()) |
92 // and should be able to render at other scales as well. | |
93 if (!cachedImage || !cachedImage->canRender(*layoutObject, 1)) | |
94 return nullptr; | 92 return nullptr; |
95 | 93 |
96 return cachedImage->image(); | 94 return cachedImage->image(); |
97 } | 95 } |
98 | 96 |
99 CSSCrossfadeValue::~CSSCrossfadeValue() | 97 CSSCrossfadeValue::~CSSCrossfadeValue() |
100 { | 98 { |
101 if (m_cachedFromImage) | 99 if (m_cachedFromImage) |
102 m_cachedFromImage->removeClient(&m_crossfadeSubimageObserver); | 100 m_cachedFromImage->removeClient(&m_crossfadeSubimageObserver); |
103 if (m_cachedToImage) | 101 if (m_cachedToImage) |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 DEFINE_TRACE_AFTER_DISPATCH(CSSCrossfadeValue) | 233 DEFINE_TRACE_AFTER_DISPATCH(CSSCrossfadeValue) |
236 { | 234 { |
237 visitor->trace(m_fromValue); | 235 visitor->trace(m_fromValue); |
238 visitor->trace(m_toValue); | 236 visitor->trace(m_toValue); |
239 visitor->trace(m_percentageValue); | 237 visitor->trace(m_percentageValue); |
240 visitor->trace(m_crossfadeSubimageObserver); | 238 visitor->trace(m_crossfadeSubimageObserver); |
241 CSSImageGeneratorValue::traceAfterDispatch(visitor); | 239 CSSImageGeneratorValue::traceAfterDispatch(visitor); |
242 } | 240 } |
243 | 241 |
244 } // namespace blink | 242 } // namespace blink |
OLD | NEW |