| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2012 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 m_scaleFactor = 1; | 101 m_scaleFactor = 1; |
| 102 | 102 |
| 103 if (!m_imagesInSet.size()) | 103 if (!m_imagesInSet.size()) |
| 104 fillImageSet(); | 104 fillImageSet(); |
| 105 | 105 |
| 106 if (!m_accessedBestFitImage) { | 106 if (!m_accessedBestFitImage) { |
| 107 // FIXME: In the future, we want to take much more than deviceScaleFacto
r into acount here. | 107 // FIXME: In the future, we want to take much more than deviceScaleFacto
r into acount here. |
| 108 // All forms of scale should be included: Page::pageScaleFactor(), Frame
::pageZoomFactor(), | 108 // All forms of scale should be included: Page::pageScaleFactor(), Frame
::pageZoomFactor(), |
| 109 // and any CSS transforms. https://bugs.webkit.org/show_bug.cgi?id=81698 | 109 // and any CSS transforms. https://bugs.webkit.org/show_bug.cgi?id=81698 |
| 110 ImageWithScale image = bestImageForScaleFactor(); | 110 ImageWithScale image = bestImageForScaleFactor(); |
| 111 CachedResourceRequest request(ResourceRequest(document->completeURL(imag
e.imageURL))); | 111 CachedResourceRequest request(ResourceRequest(document->completeURL(imag
e.imageURL)), cachedResourceRequestInitiators().css); |
| 112 request.setInitiator(cachedResourceRequestInitiators().css); | |
| 113 if (CachedResourceHandle<CachedImage> cachedImage = loader->requestImage
(request)) { | 112 if (CachedResourceHandle<CachedImage> cachedImage = loader->requestImage
(request)) { |
| 114 m_imageSet = StyleCachedImageSet::create(cachedImage.get(), image.sc
aleFactor, this); | 113 m_imageSet = StyleCachedImageSet::create(cachedImage.get(), image.sc
aleFactor, this); |
| 115 m_accessedBestFitImage = true; | 114 m_accessedBestFitImage = true; |
| 116 } | 115 } |
| 117 } | 116 } |
| 118 | 117 |
| 119 return (m_imageSet && m_imageSet->isCachedImageSet()) ? static_cast<StyleCac
hedImageSet*>(m_imageSet.get()) : 0; | 118 return (m_imageSet && m_imageSet->isCachedImageSet()) ? static_cast<StyleCac
hedImageSet*>(m_imageSet.get()) : 0; |
| 120 } | 119 } |
| 121 | 120 |
| 122 StyleImage* CSSImageSetValue::cachedOrPendingImageSet(Document* document) | 121 StyleImage* CSSImageSetValue::cachedOrPendingImageSet(Document* document) |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 info.addMember(m_imagesInSet, "imagesInSet"); | 197 info.addMember(m_imagesInSet, "imagesInSet"); |
| 199 } | 198 } |
| 200 | 199 |
| 201 void CSSImageSetValue::ImageWithScale::reportMemoryUsage(MemoryObjectInfo* memor
yObjectInfo) const | 200 void CSSImageSetValue::ImageWithScale::reportMemoryUsage(MemoryObjectInfo* memor
yObjectInfo) const |
| 202 { | 201 { |
| 203 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); | 202 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS); |
| 204 info.addMember(imageURL, "imageURL"); | 203 info.addMember(imageURL, "imageURL"); |
| 205 } | 204 } |
| 206 | 205 |
| 207 } // namespace WebCore | 206 } // namespace WebCore |
| OLD | NEW |