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

Side by Side Diff: Source/core/css/CSSImageSetValue.h

Issue 1305383006: Oilpan: Unship CSSValues and AnimatableValues Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 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/css/CSSImageGeneratorValue.cpp ('k') | Source/core/css/CSSImageSetValue.cpp » ('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 22 matching lines...) Expand all
33 33
34 namespace blink { 34 namespace blink {
35 35
36 class Document; 36 class Document;
37 class StyleFetchedImageSet; 37 class StyleFetchedImageSet;
38 class StyleImage; 38 class StyleImage;
39 39
40 class CSSImageSetValue : public CSSValueList { 40 class CSSImageSetValue : public CSSValueList {
41 public: 41 public:
42 42
43 static PassRefPtrWillBeRawPtr<CSSImageSetValue> create() 43 static PassRefPtr<CSSImageSetValue> create()
44 { 44 {
45 return adoptRefWillBeNoop(new CSSImageSetValue()); 45 return adoptRef(new CSSImageSetValue());
46 } 46 }
47 ~CSSImageSetValue(); 47 ~CSSImageSetValue();
48 48
49 StyleFetchedImageSet* cachedImageSet(Document*, float deviceScaleFactor, con st ResourceLoaderOptions&); 49 StyleFetchedImageSet* cachedImageSet(Document*, float deviceScaleFactor, con st ResourceLoaderOptions&);
50 StyleFetchedImageSet* cachedImageSet(Document*, float deviceScaleFactor); 50 StyleFetchedImageSet* cachedImageSet(Document*, float deviceScaleFactor);
51 51
52 // Returns a StyleFetchedImageSet if the best fit image has been cached alre ady, otherwise a StylePendingImage. 52 // Returns a StyleFetchedImageSet if the best fit image has been cached alre ady, otherwise a StylePendingImage.
53 StyleImage* cachedOrPendingImageSet(float); 53 StyleImage* cachedOrPendingImageSet(float);
54 54
55 String customCSSText() const; 55 String customCSSText() const;
56 56
57 bool isPending() const { return !m_accessedBestFitImage; } 57 bool isPending() const { return !m_accessedBestFitImage; }
58 58
59 struct ImageWithScale { 59 struct ImageWithScale {
60 ALLOW_ONLY_INLINE_ALLOCATION(); 60 ALLOW_ONLY_INLINE_ALLOCATION();
61 String imageURL; 61 String imageURL;
62 Referrer referrer; 62 Referrer referrer;
63 float scaleFactor; 63 float scaleFactor;
64 }; 64 };
65 65
66 bool hasFailedOrCanceledSubresources() const; 66 bool hasFailedOrCanceledSubresources() const;
67 67
68 DECLARE_TRACE_AFTER_DISPATCH();
69
70 protected: 68 protected:
71 ImageWithScale bestImageForScaleFactor(); 69 ImageWithScale bestImageForScaleFactor();
72 70
73 private: 71 private:
74 CSSImageSetValue(); 72 CSSImageSetValue();
75 73
76 void fillImageSet(); 74 void fillImageSet();
77 static inline bool compareByScaleFactor(ImageWithScale first, ImageWithScale second) { return first.scaleFactor < second.scaleFactor; } 75 static inline bool compareByScaleFactor(ImageWithScale first, ImageWithScale second) { return first.scaleFactor < second.scaleFactor; }
78 76
79 RefPtrWillBeMember<StyleImage> m_imageSet; 77 RefPtrWillBePersistent<StyleImage> m_imageSet;
80 bool m_accessedBestFitImage; 78 bool m_accessedBestFitImage;
81 79
82 // This represents the scale factor that we used to find the best fit image. It does not necessarily 80 // This represents the scale factor that we used to find the best fit image. It does not necessarily
83 // correspond to the scale factor of the best fit image. 81 // correspond to the scale factor of the best fit image.
84 float m_scaleFactor; 82 float m_scaleFactor;
85 83
86 Vector<ImageWithScale> m_imagesInSet; 84 Vector<ImageWithScale> m_imagesInSet;
87 }; 85 };
88 86
89 DEFINE_CSS_VALUE_TYPE_CASTS(CSSImageSetValue, isImageSetValue()); 87 DEFINE_CSS_VALUE_TYPE_CASTS(CSSImageSetValue, isImageSetValue());
90 88
91 } // namespace blink 89 } // namespace blink
92 90
93 #endif // CSSImageSetValue_h 91 #endif // CSSImageSetValue_h
OLDNEW
« no previous file with comments | « Source/core/css/CSSImageGeneratorValue.cpp ('k') | Source/core/css/CSSImageSetValue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698