| OLD | NEW |
| (Empty) |
| 1 /* | |
| 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) | |
| 3 * (C) 2000 Antti Koivisto (koivisto@kde.org) | |
| 4 * (C) 2000 Dirk Mueller (mueller@kde.org) | |
| 5 * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | |
| 6 * | |
| 7 * This library is free software; you can redistribute it and/or | |
| 8 * modify it under the terms of the GNU Library General Public | |
| 9 * License as published by the Free Software Foundation; either | |
| 10 * version 2 of the License, or (at your option) any later version. | |
| 11 * | |
| 12 * This library is distributed in the hope that it will be useful, | |
| 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 15 * Library General Public License for more details. | |
| 16 * | |
| 17 * You should have received a copy of the GNU Library General Public License | |
| 18 * along with this library; see the file COPYING.LIB. If not, write to | |
| 19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | |
| 20 * Boston, MA 02110-1301, USA. | |
| 21 * | |
| 22 */ | |
| 23 | |
| 24 #include "sky/engine/core/rendering/style/StyleFetchedImage.h" | |
| 25 | |
| 26 #include "sky/engine/core/css/CSSImageValue.h" | |
| 27 #include "sky/engine/core/fetch/ImageResource.h" | |
| 28 #include "sky/engine/core/rendering/RenderObject.h" | |
| 29 | |
| 30 namespace blink { | |
| 31 | |
| 32 StyleFetchedImage::StyleFetchedImage(ImageResource* image) | |
| 33 : m_image(image) | |
| 34 { | |
| 35 m_isImageResource = true; | |
| 36 m_image->addClient(this); | |
| 37 } | |
| 38 | |
| 39 StyleFetchedImage::~StyleFetchedImage() | |
| 40 { | |
| 41 m_image->removeClient(this); | |
| 42 } | |
| 43 | |
| 44 PassRefPtr<CSSValue> StyleFetchedImage::cssValue() const | |
| 45 { | |
| 46 return CSSImageValue::create(m_image->url(), const_cast<StyleFetchedImage*>(
this)); | |
| 47 } | |
| 48 | |
| 49 bool StyleFetchedImage::canRender(const RenderObject& renderer) const | |
| 50 { | |
| 51 return m_image->canRender(renderer); | |
| 52 } | |
| 53 | |
| 54 bool StyleFetchedImage::isLoaded() const | |
| 55 { | |
| 56 return m_image->isLoaded(); | |
| 57 } | |
| 58 | |
| 59 bool StyleFetchedImage::errorOccurred() const | |
| 60 { | |
| 61 return m_image->errorOccurred(); | |
| 62 } | |
| 63 | |
| 64 LayoutSize StyleFetchedImage::imageSize(const RenderObject* renderer) const | |
| 65 { | |
| 66 return m_image->imageSizeForRenderer(renderer); | |
| 67 } | |
| 68 | |
| 69 bool StyleFetchedImage::imageHasRelativeWidth() const | |
| 70 { | |
| 71 return m_image->imageHasRelativeWidth(); | |
| 72 } | |
| 73 | |
| 74 bool StyleFetchedImage::imageHasRelativeHeight() const | |
| 75 { | |
| 76 return m_image->imageHasRelativeHeight(); | |
| 77 } | |
| 78 | |
| 79 void StyleFetchedImage::computeIntrinsicDimensions(const RenderObject*, Length&
intrinsicWidth, Length& intrinsicHeight, FloatSize& intrinsicRatio) | |
| 80 { | |
| 81 m_image->computeIntrinsicDimensions(intrinsicWidth, intrinsicHeight, intrins
icRatio); | |
| 82 } | |
| 83 | |
| 84 bool StyleFetchedImage::usesImageContainerSize() const | |
| 85 { | |
| 86 return m_image->usesImageContainerSize(); | |
| 87 } | |
| 88 | |
| 89 void StyleFetchedImage::setContainerSizeForRenderer(const RenderObject* renderer
, const IntSize& imageContainerSize) | |
| 90 { | |
| 91 m_image->setContainerSizeForRenderer(renderer, imageContainerSize); | |
| 92 } | |
| 93 | |
| 94 void StyleFetchedImage::addClient(RenderObject* renderer) | |
| 95 { | |
| 96 m_image->addClient(renderer); | |
| 97 } | |
| 98 | |
| 99 void StyleFetchedImage::removeClient(RenderObject* renderer) | |
| 100 { | |
| 101 m_image->removeClient(renderer); | |
| 102 } | |
| 103 | |
| 104 PassRefPtr<Image> StyleFetchedImage::image(RenderObject* renderer, const IntSize
&) const | |
| 105 { | |
| 106 return m_image->imageForRenderer(renderer); | |
| 107 } | |
| 108 | |
| 109 bool StyleFetchedImage::knownToBeOpaque(const RenderObject* renderer) const | |
| 110 { | |
| 111 return m_image->currentFrameKnownToBeOpaque(renderer); | |
| 112 } | |
| 113 | |
| 114 } | |
| OLD | NEW |