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

Side by Side Diff: Source/core/style/StyleFetchedImageSet.h

Issue 1226293002: Fix virtual/override/final usage in Source/core/{animation,css,style}/. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 5 months 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
« no previous file with comments | « Source/core/style/StyleFetchedImage.h ('k') | Source/core/style/StyleGeneratedImage.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 27 matching lines...) Expand all
38 38
39 // This class keeps one cached image and has access to a set of alternatives. 39 // This class keeps one cached image and has access to a set of alternatives.
40 40
41 class StyleFetchedImageSet final : public StyleImage, private ImageResourceClien t { 41 class StyleFetchedImageSet final : public StyleImage, private ImageResourceClien t {
42 WTF_MAKE_FAST_ALLOCATED(StyleFetchedImageSet); 42 WTF_MAKE_FAST_ALLOCATED(StyleFetchedImageSet);
43 public: 43 public:
44 static PassRefPtr<StyleFetchedImageSet> create(ImageResource* image, float i mageScaleFactor, CSSImageSetValue* value) 44 static PassRefPtr<StyleFetchedImageSet> create(ImageResource* image, float i mageScaleFactor, CSSImageSetValue* value)
45 { 45 {
46 return adoptRef(new StyleFetchedImageSet(image, imageScaleFactor, value) ); 46 return adoptRef(new StyleFetchedImageSet(image, imageScaleFactor, value) );
47 } 47 }
48 virtual ~StyleFetchedImageSet(); 48 ~StyleFetchedImageSet() override;
49 49
50 virtual PassRefPtrWillBeRawPtr<CSSValue> cssValue() const override; 50 PassRefPtrWillBeRawPtr<CSSValue> cssValue() const override;
51 51
52 // FIXME: This is used by StyleImage for equals comparison, but this impleme ntation 52 // FIXME: This is used by StyleImage for equals comparison, but this impleme ntation
53 // only looks at the image from the set that we have loaded. I'm not sure if that is 53 // only looks at the image from the set that we have loaded. I'm not sure if that is
54 // meaningful enough or not. 54 // meaningful enough or not.
55 virtual WrappedImagePtr data() const override { return m_bestFitImage.get(); } 55 WrappedImagePtr data() const override { return m_bestFitImage.get(); }
56 56
57 void clearImageSetValue() { m_imageSetValue = 0; } 57 void clearImageSetValue() { m_imageSetValue = 0; }
58 58
59 virtual bool canRender(const LayoutObject&, float multiplier) const override ; 59 bool canRender(const LayoutObject&, float multiplier) const override;
60 virtual bool isLoaded() const override; 60 bool isLoaded() const override;
61 virtual bool errorOccurred() const override; 61 bool errorOccurred() const override;
62 virtual LayoutSize imageSize(const LayoutObject*, float multiplier) const ov erride; 62 LayoutSize imageSize(const LayoutObject*, float multiplier) const override;
63 virtual bool imageHasRelativeWidth() const override; 63 bool imageHasRelativeWidth() const override;
64 virtual bool imageHasRelativeHeight() const override; 64 bool imageHasRelativeHeight() const override;
65 virtual void computeIntrinsicDimensions(const LayoutObject*, Length& intrins icWidth, Length& intrinsicHeight, FloatSize& intrinsicRatio) override; 65 void computeIntrinsicDimensions(const LayoutObject*, Length& intrinsicWidth, Length& intrinsicHeight, FloatSize& intrinsicRatio) override;
66 virtual bool usesImageContainerSize() const override; 66 bool usesImageContainerSize() const override;
67 virtual void setContainerSizeForLayoutObject(const LayoutObject*, const IntS ize&, float) override; 67 void setContainerSizeForLayoutObject(const LayoutObject*, const IntSize&, fl oat) override;
68 virtual void addClient(LayoutObject*) override; 68 void addClient(LayoutObject*) override;
69 virtual void removeClient(LayoutObject*) override; 69 void removeClient(LayoutObject*) override;
70 virtual PassRefPtr<Image> image(LayoutObject*, const IntSize&) const overrid e; 70 PassRefPtr<Image> image(LayoutObject*, const IntSize&) const override;
71 virtual float imageScaleFactor() const override { return m_imageScaleFactor; } 71 float imageScaleFactor() const override { return m_imageScaleFactor; }
72 virtual bool knownToBeOpaque(const LayoutObject*) const override; 72 bool knownToBeOpaque(const LayoutObject*) const override;
73 virtual ImageResource* cachedImage() const override { return m_bestFitImage. get(); } 73 ImageResource* cachedImage() const override { return m_bestFitImage.get(); }
74 74
75 private: 75 private:
76 StyleFetchedImageSet(ImageResource*, float imageScaleFactor, CSSImageSetValu e*); 76 StyleFetchedImageSet(ImageResource*, float imageScaleFactor, CSSImageSetValu e*);
77 77
78 ResourcePtr<ImageResource> m_bestFitImage; 78 ResourcePtr<ImageResource> m_bestFitImage;
79 float m_imageScaleFactor; 79 float m_imageScaleFactor;
80 80
81 // FIXME: oilpan: Change to RawPtrWillBeMember when moving this class onto o ilpan heap. 81 // FIXME: oilpan: Change to RawPtrWillBeMember when moving this class onto o ilpan heap.
82 // Also add "if !ENABLE(OILPAN)" around clearImageSetValue above as well as around its 82 // Also add "if !ENABLE(OILPAN)" around clearImageSetValue above as well as around its
83 // caller since it should not be needed once both of the objects are on the heap and 83 // caller since it should not be needed once both of the objects are on the heap and
84 // oilpan is enabled. 84 // oilpan is enabled.
85 CSSImageSetValue* m_imageSetValue; // Not retained; it owns us. 85 CSSImageSetValue* m_imageSetValue; // Not retained; it owns us.
86 }; 86 };
87 87
88 DEFINE_STYLE_IMAGE_TYPE_CASTS(StyleFetchedImageSet, isImageResourceSet()); 88 DEFINE_STYLE_IMAGE_TYPE_CASTS(StyleFetchedImageSet, isImageResourceSet());
89 89
90 } // namespace blink 90 } // namespace blink
91 91
92 #endif // StyleFetchedImageSet_h 92 #endif // StyleFetchedImageSet_h
OLDNEW
« no previous file with comments | « Source/core/style/StyleFetchedImage.h ('k') | Source/core/style/StyleGeneratedImage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698