| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 | 57 |
| 58 LayoutObjectSizeCountMap::iterator it = m_clients.find(layoutObject); | 58 LayoutObjectSizeCountMap::iterator it = m_clients.find(layoutObject); |
| 59 if (it == m_clients.end()) { | 59 if (it == m_clients.end()) { |
| 60 m_clients.add(layoutObject, SizeAndCount(size, 1)); | 60 m_clients.add(layoutObject, SizeAndCount(size, 1)); |
| 61 } else { | 61 } else { |
| 62 SizeAndCount& sizeCount = it->value; | 62 SizeAndCount& sizeCount = it->value; |
| 63 ++sizeCount.count; | 63 ++sizeCount.count; |
| 64 } | 64 } |
| 65 } | 65 } |
| 66 | 66 |
| 67 PassRefPtrWillBeRawPtr<CSSImageGeneratorValue> CSSImageGeneratorValue::valueWith
URLsMadeAbsolute() | 67 RawPtr<CSSImageGeneratorValue> CSSImageGeneratorValue::valueWithURLsMadeAbsolute
() |
| 68 { | 68 { |
| 69 if (isCrossfadeValue()) | 69 if (isCrossfadeValue()) |
| 70 return toCSSCrossfadeValue(this)->valueWithURLsMadeAbsolute(); | 70 return toCSSCrossfadeValue(this)->valueWithURLsMadeAbsolute(); |
| 71 return this; | 71 return this; |
| 72 } | 72 } |
| 73 | 73 |
| 74 void CSSImageGeneratorValue::removeClient(const LayoutObject* layoutObject) | 74 void CSSImageGeneratorValue::removeClient(const LayoutObject* layoutObject) |
| 75 { | 75 { |
| 76 ASSERT(layoutObject); | 76 ASSERT(layoutObject); |
| 77 LayoutObjectSizeCountMap::iterator it = m_clients.find(layoutObject); | 77 LayoutObjectSizeCountMap::iterator it = m_clients.find(layoutObject); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 99 #endif | 99 #endif |
| 100 } | 100 } |
| 101 | 101 |
| 102 Image* CSSImageGeneratorValue::getImage(const LayoutObject* layoutObject, const
IntSize& size) | 102 Image* CSSImageGeneratorValue::getImage(const LayoutObject* layoutObject, const
IntSize& size) |
| 103 { | 103 { |
| 104 LayoutObjectSizeCountMap::iterator it = m_clients.find(layoutObject); | 104 LayoutObjectSizeCountMap::iterator it = m_clients.find(layoutObject); |
| 105 if (it != m_clients.end()) { | 105 if (it != m_clients.end()) { |
| 106 SizeAndCount& sizeCount = it->value; | 106 SizeAndCount& sizeCount = it->value; |
| 107 IntSize oldSize = sizeCount.size; | 107 IntSize oldSize = sizeCount.size; |
| 108 if (oldSize != size) { | 108 if (oldSize != size) { |
| 109 RefPtrWillBeRawPtr<CSSImageGeneratorValue> protect(this); | 109 RawPtr<CSSImageGeneratorValue> protect(this); |
| 110 removeClient(layoutObject); | 110 removeClient(layoutObject); |
| 111 addClient(layoutObject, size); | 111 addClient(layoutObject, size); |
| 112 } | 112 } |
| 113 } | 113 } |
| 114 | 114 |
| 115 // Don't generate an image for empty sizes. | 115 // Don't generate an image for empty sizes. |
| 116 if (size.isEmpty()) | 116 if (size.isEmpty()) |
| 117 return nullptr; | 117 return nullptr; |
| 118 | 118 |
| 119 // Look up the image in our cache. | 119 // Look up the image in our cache. |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 break; | 211 break; |
| 212 case RadialGradientClass: | 212 case RadialGradientClass: |
| 213 toCSSRadialGradientValue(this)->loadSubimages(document); | 213 toCSSRadialGradientValue(this)->loadSubimages(document); |
| 214 break; | 214 break; |
| 215 default: | 215 default: |
| 216 ASSERT_NOT_REACHED(); | 216 ASSERT_NOT_REACHED(); |
| 217 } | 217 } |
| 218 } | 218 } |
| 219 | 219 |
| 220 } // namespace blink | 220 } // namespace blink |
| OLD | NEW |