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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 ImageResource(blink::Image*); | 53 ImageResource(blink::Image*); |
54 // Exposed for testing | 54 // Exposed for testing |
55 ImageResource(const ResourceRequest&, blink::Image*); | 55 ImageResource(const ResourceRequest&, blink::Image*); |
56 ~ImageResource() override; | 56 ~ImageResource() override; |
57 | 57 |
58 void load(ResourceFetcher*, const ResourceLoaderOptions&) override; | 58 void load(ResourceFetcher*, const ResourceLoaderOptions&) override; |
59 | 59 |
60 blink::Image* image(); // Returns the nullImage() if the image is not availa
ble yet. | 60 blink::Image* image(); // Returns the nullImage() if the image is not availa
ble yet. |
61 bool hasImage() const { return m_image.get(); } | 61 bool hasImage() const { return m_image.get(); } |
62 // Side effect: ensures decoded image is in cache, therefore should only be
called when about to draw the image. | 62 // Side effect: ensures decoded image is in cache, therefore should only be
called when about to draw the image. |
63 // FIXME: Decoding image on the main thread is expensive, so rather than for
cing decode, consider returning false | |
64 // when image is not decoded yet, as we do in case of deferred decoding. | |
65 bool currentFrameKnownToBeOpaque(const LayoutObject*); | 63 bool currentFrameKnownToBeOpaque(const LayoutObject*); |
66 | 64 |
67 static std::pair<blink::Image*, float> brokenImage(float deviceScaleFactor);
// Returns an image and the image's resolution scale factor. | 65 static std::pair<blink::Image*, float> brokenImage(float deviceScaleFactor);
// Returns an image and the image's resolution scale factor. |
68 bool willPaintBrokenImage() const; | 66 bool willPaintBrokenImage() const; |
69 | 67 |
70 // Assumes that image rotation or scale doesn't effect the image size being
empty or not. | 68 // Assumes that image rotation or scale doesn't effect the image size being
empty or not. |
71 bool canRender() { return !errorOccurred() && !imageSizeForLayoutObject(null
ptr, 1).isEmpty(); } | 69 bool canRender() { return !errorOccurred() && !imageSizeForLayoutObject(null
ptr, 1).isEmpty(); } |
72 | 70 |
73 bool usesImageContainerSize() const; | 71 bool usesImageContainerSize() const; |
74 bool imageHasRelativeWidth() const; | 72 bool imageHasRelativeWidth() const; |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 | 143 |
146 RefPtr<blink::Image> m_image; | 144 RefPtr<blink::Image> m_image; |
147 bool m_hasDevicePixelRatioHeaderValue; | 145 bool m_hasDevicePixelRatioHeaderValue; |
148 }; | 146 }; |
149 | 147 |
150 DEFINE_RESOURCE_TYPE_CASTS(Image); | 148 DEFINE_RESOURCE_TYPE_CASTS(Image); |
151 | 149 |
152 } | 150 } |
153 | 151 |
154 #endif | 152 #endif |
OLD | NEW |