Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Side by Side Diff: Source/core/fetch/ImageResource.h

Issue 481753002: Use Shadow DOM to display fallback content for images (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
53 ImageResource(const ResourceRequest&, blink::Image*); 53 ImageResource(const ResourceRequest&, blink::Image*);
54 virtual ~ImageResource(); 54 virtual ~ImageResource();
55 55
56 virtual void load(ResourceFetcher*, const ResourceLoaderOptions&) override; 56 virtual void load(ResourceFetcher*, const ResourceLoaderOptions&) override;
57 57
58 blink::Image* image(); // Returns the nullImage() if the image is not availa ble yet. 58 blink::Image* image(); // Returns the nullImage() if the image is not availa ble yet.
59 blink::Image* imageForRenderer(const RenderObject*); // Returns the nullImag e() if the image is not available yet. 59 blink::Image* imageForRenderer(const RenderObject*); // Returns the nullImag e() if the image is not available yet.
60 bool hasImage() const { return m_image.get(); } 60 bool hasImage() const { return m_image.get(); }
61 bool currentFrameKnownToBeOpaque(const RenderObject*); // Side effect: ensur es decoded image is in cache, therefore should only be called when about to draw the image. 61 bool currentFrameKnownToBeOpaque(const RenderObject*); // Side effect: ensur es decoded image is in cache, therefore should only be called when about to draw the image.
62 62
63 static std::pair<blink::Image*, float> brokenImage(float deviceScaleFactor); // Returns an image and the image's resolution scale factor.
64 bool willPaintBrokenImage() const;
65
66 bool canRender(const RenderObject& renderer, float multiplier) { return !err orOccurred() && !imageSizeForRenderer(&renderer, multiplier).isEmpty(); } 63 bool canRender(const RenderObject& renderer, float multiplier) { return !err orOccurred() && !imageSizeForRenderer(&renderer, multiplier).isEmpty(); }
67 64
68 void setContainerSizeForRenderer(const ImageResourceClient*, const IntSize&, float); 65 void setContainerSizeForRenderer(const ImageResourceClient*, const IntSize&, float);
69 bool usesImageContainerSize() const; 66 bool usesImageContainerSize() const;
70 bool imageHasRelativeWidth() const; 67 bool imageHasRelativeWidth() const;
71 bool imageHasRelativeHeight() const; 68 bool imageHasRelativeHeight() const;
72 // 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.
73 float devicePixelRatioHeaderValue() const { return m_devicePixelRatioHeaderV alue; } 70 float devicePixelRatioHeaderValue() const { return m_devicePixelRatioHeaderV alue; }
74 bool hasDevicePixelRatioHeaderValue() const { return m_hasDevicePixelRatioHe aderValue; } 71 bool hasDevicePixelRatioHeaderValue() const { return m_hasDevicePixelRatioHe aderValue; }
75 72
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 OwnPtr<SVGImageCache> m_svgImageCache; 131 OwnPtr<SVGImageCache> m_svgImageCache;
135 bool m_loadingMultipartContent; 132 bool m_loadingMultipartContent;
136 bool m_hasDevicePixelRatioHeaderValue; 133 bool m_hasDevicePixelRatioHeaderValue;
137 }; 134 };
138 135
139 DEFINE_RESOURCE_TYPE_CASTS(Image); 136 DEFINE_RESOURCE_TYPE_CASTS(Image);
140 137
141 } 138 }
142 139
143 #endif 140 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698