| Differences between
and this patch
- a/Source/WebCore/ChangeLog +23 lines
Lines 1-3 a/Source/WebCore/ChangeLog_sec1
1
2011-07-04  Tamas Czene  <Czene.Tamas@stud.u-szeged.hu>
2
3
        Reviewed by NOBODY (OOPS!).
4
5
        Remove virtual functions from StyleImage.
6
        https://bugs.webkit.org/show_bug.cgi?id=63909
7
8
        We can remove the virtual "isChachedImage, isPendingImage, isGeneratedImage" functions to speed up the StyleImage part of WebKit.
9
        Some profile data shows this part is significant, especially in small CSS-based sites.
10
        Removing the virtual functions - removing the calls - makes a small performance progression on this part.
11
12
        * rendering/style/StyleCachedImage.h:
13
        (WebCore::StyleCachedImage::StyleCachedImage):
14
        * rendering/style/StyleGeneratedImage.h:
15
        (WebCore::StyleGeneratedImage::StyleGeneratedImage):
16
        * rendering/style/StyleImage.h:
17
        (WebCore::StyleImage::isCachedImage):
18
        (WebCore::StyleImage::isPendingImage):
19
        (WebCore::StyleImage::isGeneratedImage):
20
        (WebCore::StyleImage::StyleImage):
21
        * rendering/style/StylePendingImage.h:
22
        (WebCore::StylePendingImage::StylePendingImage):
23
1
2011-07-04  Alexander Pavlov  <apavlov@chromium.org>
24
2011-07-04  Alexander Pavlov  <apavlov@chromium.org>
2
25
3
        Reviewed by Pavel Feldman.
26
        Reviewed by Pavel Feldman.
- a/Source/WebCore/rendering/style/StyleCachedImage.h -2 / +1 lines
Lines 36-43 public: a/Source/WebCore/rendering/style/StyleCachedImage.h_sec1
36
    static PassRefPtr<StyleCachedImage> create(CachedImage* image) { return adoptRef(new StyleCachedImage(image)); }
36
    static PassRefPtr<StyleCachedImage> create(CachedImage* image) { return adoptRef(new StyleCachedImage(image)); }
37
    virtual WrappedImagePtr data() const { return m_image.get(); }
37
    virtual WrappedImagePtr data() const { return m_image.get(); }
38
38
39
    virtual bool isCachedImage() const { return true; }
40
    
41
    virtual PassRefPtr<CSSValue> cssValue() const;
39
    virtual PassRefPtr<CSSValue> cssValue() const;
42
    
40
    
43
    CachedImage* cachedImage() const { return m_image.get(); }
41
    CachedImage* cachedImage() const { return m_image.get(); }
Lines 58-63 private: a/Source/WebCore/rendering/style/StyleCachedImage.h_sec2
58
    StyleCachedImage(CachedImage* image)
56
    StyleCachedImage(CachedImage* image)
59
        : m_image(image)
57
        : m_image(image)
60
    {
58
    {
59
         m_isCachedImage = true;
61
    }
60
    }
62
    
61
    
63
    CachedResourceHandle<CachedImage> m_image;
62
    CachedResourceHandle<CachedImage> m_image;
- a/Source/WebCore/rendering/style/StyleGeneratedImage.h -2 / +1 lines
Lines 40-47 public: a/Source/WebCore/rendering/style/StyleGeneratedImage.h_sec1
40
40
41
    virtual WrappedImagePtr data() const { return m_generator; }
41
    virtual WrappedImagePtr data() const { return m_generator; }
42
42
43
    virtual bool isGeneratedImage() const { return true; }
44
    
45
    virtual PassRefPtr<CSSValue> cssValue() const;
43
    virtual PassRefPtr<CSSValue> cssValue() const;
46
44
47
    virtual IntSize imageSize(const RenderObject*, float multiplier) const;
45
    virtual IntSize imageSize(const RenderObject*, float multiplier) const;
Lines 58-63 private: a/Source/WebCore/rendering/style/StyleGeneratedImage.h_sec2
58
        : m_generator(val)
56
        : m_generator(val)
59
        , m_fixedSize(fixedSize)
57
        , m_fixedSize(fixedSize)
60
    {
58
    {
59
         m_isGeneratedImage = true;
61
    }
60
    }
62
    
61
    
63
    CSSImageGeneratorValue* m_generator; // The generator holds a reference to us.
62
    CSSImageGeneratorValue* m_generator; // The generator holds a reference to us.
- a/Source/WebCore/rendering/style/StyleImage.h -4 / +7 lines
Lines 62-70 public: a/Source/WebCore/rendering/style/StyleImage.h_sec1
62
    virtual PassRefPtr<Image> image(RenderObject*, const IntSize&) const = 0;
62
    virtual PassRefPtr<Image> image(RenderObject*, const IntSize&) const = 0;
63
    virtual WrappedImagePtr data() const = 0;
63
    virtual WrappedImagePtr data() const = 0;
64
64
65
    virtual bool isCachedImage() const { return false; }
65
    ALWAYS_INLINE bool isCachedImage() const { return m_isCachedImage; }
66
    virtual bool isPendingImage() const { return false; }
66
    ALWAYS_INLINE bool isPendingImage() const { return m_isPendingImage; }
67
    virtual bool isGeneratedImage() const { return false; }
67
    ALWAYS_INLINE bool isGeneratedImage() const { return m_isGeneratedImage; }
68
    
68
    
69
    static  bool imagesEquivalent(StyleImage* image1, StyleImage* image2)
69
    static  bool imagesEquivalent(StyleImage* image1, StyleImage* image2)
70
    {
70
    {
Lines 77-83 public: a/Source/WebCore/rendering/style/StyleImage.h_sec2
77
    }
77
    }
78
78
79
protected:
79
protected:
80
    StyleImage() { }
80
    bool m_isCachedImage:1;
81
    bool m_isPendingImage:1;
82
    bool m_isGeneratedImage:1;
83
    StyleImage(): m_isCachedImage(false), m_isPendingImage(false), m_isGeneratedImage(false) { }
81
};
84
};
82
85
83
}
86
}
- a/Source/WebCore/rendering/style/StylePendingImage.h -3 / +1 lines
Lines 41-48 public: a/Source/WebCore/rendering/style/StylePendingImage.h_sec1
41
41
42
    virtual WrappedImagePtr data() const { return m_value; }
42
    virtual WrappedImagePtr data() const { return m_value; }
43
43
44
    virtual bool isPendingImage() const { return true; }
45
    
46
    virtual PassRefPtr<CSSValue> cssValue() const { return m_value; }
44
    virtual PassRefPtr<CSSValue> cssValue() const { return m_value; }
47
    CSSImageValue* cssImageValue() const { return m_value; }
45
    CSSImageValue* cssImageValue() const { return m_value; }
48
    
46
    
Lines 63-68 private: a/Source/WebCore/rendering/style/StylePendingImage.h_sec2
63
    StylePendingImage(CSSImageValue* value)
61
    StylePendingImage(CSSImageValue* value)
64
        : m_value(value)
62
        : m_value(value)
65
    {
63
    {
64
        m_isPendingImage = true;
66
    }
65
    }
67
66
68
    CSSImageValue* m_value; // Not retained; it owns us.
67
    CSSImageValue* m_value; // Not retained; it owns us.
69
- 

Return to Bug 63909