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

Side by Side Diff: third_party/WebKit/Source/core/css/CSSGradientValue.h

Issue 2941533002: Break StyleImage dependency on LayoutObject (Closed)
Patch Set: Address reviewer comments Created 3 years, 6 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2008 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 19 matching lines...) Expand all
30 #include "core/css/CSSImageGeneratorValue.h" 30 #include "core/css/CSSImageGeneratorValue.h"
31 #include "core/css/CSSPrimitiveValue.h" 31 #include "core/css/CSSPrimitiveValue.h"
32 #include "platform/wtf/RefPtr.h" 32 #include "platform/wtf/RefPtr.h"
33 #include "platform/wtf/Vector.h" 33 #include "platform/wtf/Vector.h"
34 34
35 namespace blink { 35 namespace blink {
36 36
37 class Color; 37 class Color;
38 class Gradient; 38 class Gradient;
39 class Document; 39 class Document;
40 class LayoutObject;
40 41
41 enum CSSGradientType { 42 enum CSSGradientType {
42 kCSSDeprecatedLinearGradient, 43 kCSSDeprecatedLinearGradient,
43 kCSSDeprecatedRadialGradient, 44 kCSSDeprecatedRadialGradient,
44 kCSSPrefixedLinearGradient, 45 kCSSPrefixedLinearGradient,
45 kCSSPrefixedRadialGradient, 46 kCSSPrefixedRadialGradient,
46 kCSSLinearGradient, 47 kCSSLinearGradient,
47 kCSSRadialGradient, 48 kCSSRadialGradient,
48 kCSSConicGradient 49 kCSSConicGradient
49 }; 50 };
(...skipping 30 matching lines...) Expand all
80 } // namespace blink 81 } // namespace blink
81 82
82 // We have to declare the VectorTraits specialization before CSSGradientValue 83 // We have to declare the VectorTraits specialization before CSSGradientValue
83 // declares its inline capacity vector below. 84 // declares its inline capacity vector below.
84 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::CSSGradientColorStop); 85 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::CSSGradientColorStop);
85 86
86 namespace blink { 87 namespace blink {
87 88
88 class CSSGradientValue : public CSSImageGeneratorValue { 89 class CSSGradientValue : public CSSImageGeneratorValue {
89 public: 90 public:
90 PassRefPtr<Image> GetImage(const LayoutObject&, const IntSize&); 91 PassRefPtr<Image> GetImage(const ImageResourceObserver&,
92 const Document&,
93 const ComputedStyle&,
94 const IntSize&);
91 95
92 void AddStop(const CSSGradientColorStop& stop) { 96 void AddStop(const CSSGradientColorStop& stop) {
93 stops_.push_back(stop); 97 stops_.push_back(stop);
94 is_cacheable_ = is_cacheable_ && stop.IsCacheable(); 98 is_cacheable_ = is_cacheable_ && stop.IsCacheable();
95 } 99 }
96 100
97 size_t StopCount() const { return stops_.size(); } 101 size_t StopCount() const { return stops_.size(); }
98 102
99 bool IsRepeating() const { return repeating_; } 103 bool IsRepeating() const { return repeating_; }
100 104
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 Member<const CSSValue> x_; 325 Member<const CSSValue> x_;
322 Member<const CSSValue> y_; 326 Member<const CSSValue> y_;
323 Member<const CSSPrimitiveValue> from_angle_; 327 Member<const CSSPrimitiveValue> from_angle_;
324 }; 328 };
325 329
326 DEFINE_CSS_VALUE_TYPE_CASTS(CSSConicGradientValue, IsConicGradientValue()); 330 DEFINE_CSS_VALUE_TYPE_CASTS(CSSConicGradientValue, IsConicGradientValue());
327 331
328 } // namespace blink 332 } // namespace blink
329 333
330 #endif // CSSGradientValue_h 334 #endif // CSSGradientValue_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSCrossfadeValue.cpp ('k') | third_party/WebKit/Source/core/css/CSSGradientValue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698