| OLD | NEW |
| 1 /* | 1 /* |
| 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) | 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) |
| 3 Copyright (C) 2001 Dirk Mueller <mueller@kde.org> | 3 Copyright (C) 2001 Dirk Mueller <mueller@kde.org> |
| 4 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) | 4 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) |
| 5 Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. | 5 Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. |
| 6 | 6 |
| 7 This library is free software; you can redistribute it and/or | 7 This library is free software; you can redistribute it and/or |
| 8 modify it under the terms of the GNU Library General Public | 8 modify it under the terms of the GNU Library General Public |
| 9 License as published by the Free Software Foundation; either | 9 License as published by the Free Software Foundation; either |
| 10 version 2 of the License, or (at your option) any later version. | 10 version 2 of the License, or (at your option) any later version. |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 | 58 |
| 59 static std::pair<WebCore::Image*, float> brokenImage(float deviceScaleFactor
); // Returns an image and the image's resolution scale factor. | 59 static std::pair<WebCore::Image*, float> brokenImage(float deviceScaleFactor
); // Returns an image and the image's resolution scale factor. |
| 60 bool willPaintBrokenImage() const; | 60 bool willPaintBrokenImage() const; |
| 61 | 61 |
| 62 bool canRender(const RenderObject* renderer, float multiplier) { return !err
orOccurred() && !imageSizeForRenderer(renderer, multiplier).isEmpty(); } | 62 bool canRender(const RenderObject* renderer, float multiplier) { return !err
orOccurred() && !imageSizeForRenderer(renderer, multiplier).isEmpty(); } |
| 63 | 63 |
| 64 void setContainerSizeForRenderer(const ImageResourceClient*, const IntSize&,
float); | 64 void setContainerSizeForRenderer(const ImageResourceClient*, const IntSize&,
float); |
| 65 bool usesImageContainerSize() const; | 65 bool usesImageContainerSize() const; |
| 66 bool imageHasRelativeWidth() const; | 66 bool imageHasRelativeWidth() const; |
| 67 bool imageHasRelativeHeight() const; | 67 bool imageHasRelativeHeight() const; |
| 68 void setDeviceScaleFactor(float scale) { m_deviceScaleFactor = scale; } |
| 68 // The device pixel ratio we got from the server for this image, or 1.0. | 69 // The device pixel ratio we got from the server for this image, or 1.0. |
| 69 float devicePixelRatioHeaderValue() const { return m_devicePixelRatioHeaderV
alue; } | 70 float devicePixelRatioHeaderValue() const { return m_devicePixelRatioHeaderV
alue; } |
| 70 bool hasDevicePixelRatioHeaderValue() const { return m_hasDevicePixelRatioHe
aderValue; } | 71 bool hasDevicePixelRatioHeaderValue() const { return m_hasDevicePixelRatioHe
aderValue; } |
| 71 | 72 |
| 72 enum SizeType { | 73 enum SizeType { |
| 73 NormalSize, // Report the size of the image associated with a certain re
nderer | 74 NormalSize, // Report the size of the image associated with a certain re
nderer |
| 74 IntrinsicSize // Report the intrinsic size, i.e. ignore whatever has bee
n set extrinsically. | 75 IntrinsicSize // Report the intrinsic size, i.e. ignore whatever has bee
n set extrinsically. |
| 75 }; | 76 }; |
| 76 // This method takes a zoom multiplier that can be used to increase the natu
ral size of the image by the zoom. | 77 // This method takes a zoom multiplier that can be used to increase the natu
ral size of the image by the zoom. |
| 77 LayoutSize imageSizeForRenderer(const RenderObject*, float multiplier, SizeT
ype = NormalSize); // returns the size of the complete image. | 78 LayoutSize imageSizeForRenderer(const RenderObject*, float multiplier, SizeT
ype = NormalSize); // returns the size of the complete image. |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 void clearImage(); | 114 void clearImage(); |
| 114 // If not null, changeRect is the changed part of the image. | 115 // If not null, changeRect is the changed part of the image. |
| 115 void notifyObservers(const IntRect* changeRect = 0); | 116 void notifyObservers(const IntRect* changeRect = 0); |
| 116 | 117 |
| 117 virtual void switchClientsToRevalidatedResource() OVERRIDE; | 118 virtual void switchClientsToRevalidatedResource() OVERRIDE; |
| 118 | 119 |
| 119 typedef pair<IntSize, float> SizeAndZoom; | 120 typedef pair<IntSize, float> SizeAndZoom; |
| 120 typedef HashMap<const ImageResourceClient*, SizeAndZoom> ContainerSizeReques
ts; | 121 typedef HashMap<const ImageResourceClient*, SizeAndZoom> ContainerSizeReques
ts; |
| 121 ContainerSizeRequests m_pendingContainerSizeRequests; | 122 ContainerSizeRequests m_pendingContainerSizeRequests; |
| 122 float m_devicePixelRatioHeaderValue; | 123 float m_devicePixelRatioHeaderValue; |
| 124 float m_deviceScaleFactor; |
| 123 | 125 |
| 124 RefPtr<WebCore::Image> m_image; | 126 RefPtr<WebCore::Image> m_image; |
| 125 OwnPtr<SVGImageCache> m_svgImageCache; | 127 OwnPtr<SVGImageCache> m_svgImageCache; |
| 126 bool m_loadingMultipartContent; | 128 bool m_loadingMultipartContent; |
| 127 bool m_hasDevicePixelRatioHeaderValue; | 129 bool m_hasDevicePixelRatioHeaderValue; |
| 128 }; | 130 }; |
| 129 | 131 |
| 130 DEFINE_RESOURCE_TYPE_CASTS(Image); | 132 DEFINE_RESOURCE_TYPE_CASTS(Image); |
| 131 | 133 |
| 132 } | 134 } |
| 133 | 135 |
| 134 #endif | 136 #endif |
| OLD | NEW |