| Differences between
and this patch
- a/Source/WebCore/ChangeLog +14 lines
Lines 1-5 a/Source/WebCore/ChangeLog_sec1
1
2011-11-08  Andreas Kling  <kling@webkit.org>
1
2011-11-08  Andreas Kling  <kling@webkit.org>
2
2
3
        CSSGradientValue: Devirtualize createGradient().
4
        <http://webkit.org/b/71800>
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        Make createGradient() non-virtual and call the appropriate subclass
9
        implementation in image() based on is{Linear,Radial}Gradient().
10
11
        * css/CSSGradientValue.cpp:
12
        (WebCore::CSSGradientValue::image):
13
        * css/CSSGradientValue.h:
14
15
2011-11-08  Andreas Kling  <kling@webkit.org>
16
3
        CSSCanvasValue: Remove inheritance from CanvasObserver.
17
        CSSCanvasValue: Remove inheritance from CanvasObserver.
4
        <http://webkit.org/b/71796>
18
        <http://webkit.org/b/71796>
5
19
- a/Source/WebCore/css/CSSGradientValue.cpp -1 / +10 lines
Lines 58-64 PassRefPtr<Image> CSSGradientValue::image(RenderObject* renderer, const IntSize& a/Source/WebCore/css/CSSGradientValue.cpp_sec1
58
    }
58
    }
59
59
60
    // We need to create an image.
60
    // We need to create an image.
61
    RefPtr<Image> newImage = GeneratedImage::create(createGradient(renderer, size), size);
61
    RefPtr<Gradient> gradient;
62
63
    if (isLinearGradient())
64
        gradient = static_cast<CSSLinearGradientValue*>(this)->createGradient(renderer, size);
65
    else {
66
        ASSERT(isRadialGradient());
67
        gradient = static_cast<CSSRadialGradientValue*>(this)->createGradient(renderer, size);
68
    }
69
70
    RefPtr<Image> newImage = GeneratedImage::create(gradient, size);
62
    if (cacheable)
71
    if (cacheable)
63
        putImage(size, newImage);
72
        putImage(size, newImage);
64
73
- a/Source/WebCore/css/CSSGradientValue.h -9 / +6 lines
Lines 77-85 protected: a/Source/WebCore/css/CSSGradientValue.h_sec1
77
77
78
    void addStops(Gradient*, RenderObject*, RenderStyle* rootStyle, float maxLengthForRepeat = 0);
78
    void addStops(Gradient*, RenderObject*, RenderStyle* rootStyle, float maxLengthForRepeat = 0);
79
79
80
    // Create the gradient for a given size.
81
    virtual PassRefPtr<Gradient> createGradient(RenderObject*, const IntSize&) = 0;
82
83
    // Resolve points/radii to front end values.
80
    // Resolve points/radii to front end values.
84
    FloatPoint computeEndPoint(CSSPrimitiveValue*, CSSPrimitiveValue*, RenderStyle*, RenderStyle* rootStyle, const IntSize&);
81
    FloatPoint computeEndPoint(CSSPrimitiveValue*, CSSPrimitiveValue*, RenderStyle*, RenderStyle* rootStyle, const IntSize&);
85
82
Lines 111-125 public: a/Source/WebCore/css/CSSGradientValue.h_sec2
111
108
112
    virtual String cssText() const;
109
    virtual String cssText() const;
113
110
111
    // Create the gradient for a given size.
112
    PassRefPtr<Gradient> createGradient(RenderObject*, const IntSize&);
113
114
private:
114
private:
115
    CSSLinearGradientValue(CSSGradientRepeat repeat, bool deprecatedType = false)
115
    CSSLinearGradientValue(CSSGradientRepeat repeat, bool deprecatedType = false)
116
        : CSSGradientValue(LinearGradientClass, repeat, deprecatedType)
116
        : CSSGradientValue(LinearGradientClass, repeat, deprecatedType)
117
    {
117
    {
118
    }
118
    }
119
119
120
    // Create the gradient for a given size.
121
    virtual PassRefPtr<Gradient> createGradient(RenderObject*, const IntSize&);
122
123
    RefPtr<CSSPrimitiveValue> m_angle; // may be null.
120
    RefPtr<CSSPrimitiveValue> m_angle; // may be null.
124
};
121
};
125
122
Lines 141-155 public: a/Source/WebCore/css/CSSGradientValue.h_sec3
141
    void setEndHorizontalSize(PassRefPtr<CSSPrimitiveValue> val) { m_endHorizontalSize = val; }
138
    void setEndHorizontalSize(PassRefPtr<CSSPrimitiveValue> val) { m_endHorizontalSize = val; }
142
    void setEndVerticalSize(PassRefPtr<CSSPrimitiveValue> val) { m_endVerticalSize = val; }
139
    void setEndVerticalSize(PassRefPtr<CSSPrimitiveValue> val) { m_endVerticalSize = val; }
143
140
141
    // Create the gradient for a given size.
142
    PassRefPtr<Gradient> createGradient(RenderObject*, const IntSize&);
143
144
private:
144
private:
145
    CSSRadialGradientValue(CSSGradientRepeat repeat, bool deprecatedType = false)
145
    CSSRadialGradientValue(CSSGradientRepeat repeat, bool deprecatedType = false)
146
        : CSSGradientValue(RadialGradientClass, repeat, deprecatedType)
146
        : CSSGradientValue(RadialGradientClass, repeat, deprecatedType)
147
    {
147
    {
148
    }
148
    }
149
149
150
    // Create the gradient for a given size.
151
    virtual PassRefPtr<Gradient> createGradient(RenderObject*, const IntSize&);
152
153
    // Resolve points/radii to front end values.
150
    // Resolve points/radii to front end values.
154
    float resolveRadius(CSSPrimitiveValue*, RenderStyle*, RenderStyle* rootStyle, float* widthOrHeight = 0);
151
    float resolveRadius(CSSPrimitiveValue*, RenderStyle*, RenderStyle* rootStyle, float* widthOrHeight = 0);
155
152

Return to Bug 71800