| Differences between
and this patch
- a/Source/WebCore/ChangeLog +23 lines
Lines 1-3 a/Source/WebCore/ChangeLog_sec1
1
2012-12-12  No'am Rosenthal  <noam.rosenthal@nokia.com>
2
3
        Disambiguate "background color" and "contents as solid color" on GraphicsLayer
4
        https://bugs.webkit.org/show_bug.cgi?id=104842
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        Rename overloads in GraphicsLayerTextureMapper and GraphicsLayerChromium to account for the rename in GraphicsLayer.
9
10
        Covered by existing tests.
11
12
        * platform/graphics/chromium/GraphicsLayerChromium.cpp:
13
        * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
14
        (WebCore::GraphicsLayerTextureMapper::setContentsToSolidColor):
15
        * platform/graphics/texmap/GraphicsLayerTextureMapper.h:
16
        (GraphicsLayerTextureMapper):
17
        (WebCore::GraphicsLayerTextureMapper::solidColor):
18
        * platform/graphics/texmap/TextureMapperLayer.cpp:
19
        (WebCore::TextureMapperLayer::paintSelf):
20
        (WebCore::TextureMapperLayer::flushCompositingStateSelf):
21
        * platform/graphics/texmap/TextureMapperLayer.h:
22
        (State):
23
1
2012-12-12  Simon Fraser  <simon.fraser@apple.com>
24
2012-12-12  Simon Fraser  <simon.fraser@apple.com>
2
25
3
        Disambiguate "background color" and "contents as solid color" on GraphicsLayer
26
        Disambiguate "background color" and "contents as solid color" on GraphicsLayer
- a/Source/WebKit2/ChangeLog +18 lines
Lines 1-3 a/Source/WebKit2/ChangeLog_sec1
1
2012-12-12  No'am Rosenthal  <noam.rosenthal@nokia.com>
2
3
        Disambiguate "background color" and "contents as solid color" on GraphicsLayer
4
        https://bugs.webkit.org/show_bug.cgi?id=104842
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        Rename overloads in coordinated graphics to account for the rename in GraphicsLayer.
9
10
        * Shared/CoordinatedGraphics/CoordinatedLayerInfo.h:
11
        (CoordinatedLayerInfo):
12
        * UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp:
13
        (WebKit::LayerTreeRenderer::setLayerState):
14
        * WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp:
15
        (WebCore::CoordinatedGraphicsLayer::setContentsToSolidColor):
16
        * WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.h:
17
        (CoordinatedGraphicsLayer):
18
1
2012-12-12  Seokju Kwon  <seokju.kwon@gmail.com>
19
2012-12-12  Seokju Kwon  <seokju.kwon@gmail.com>
2
20
3
        [EFL] Refactor duplicate code into EflInspectorUtilities
21
        [EFL] Refactor duplicate code into EflInspectorUtilities
- a/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp -1 / +1 lines
Lines 808-814 void GraphicsLayerChromium::updateLayerBackgroundColor() a/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp_sec1
808
        return;
808
        return;
809
809
810
    // We never create the contents layer just for background color yet.
810
    // We never create the contents layer just for background color yet.
811
    if (m_backgroundColorSet)
811
    if (m_backgroundColor.isValid())
812
        contentsLayer->setBackgroundColor(m_backgroundColor.rgb());
812
        contentsLayer->setBackgroundColor(m_backgroundColor.rgb());
813
    else
813
    else
814
        contentsLayer->setBackgroundColor(static_cast<RGBA32>(0));
814
        contentsLayer->setBackgroundColor(static_cast<RGBA32>(0));
- a/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp -4 / +3 lines
Lines 351-363 void GraphicsLayerTextureMapper::setContentsRect(const IntRect& value) a/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp_sec1
351
    notifyChange(TextureMapperLayer::ContentsRectChange);
351
    notifyChange(TextureMapperLayer::ContentsRectChange);
352
}
352
}
353
353
354
void GraphicsLayerTextureMapper::setContentsToBackgroundColor(const Color& color)
354
void GraphicsLayerTextureMapper::setContentsToSolidColor(const Color& color)
355
{
355
{
356
    if (color == m_backgroundColor)
356
    if (color == m_solidColor)
357
        return;
357
        return;
358
358
359
    m_backgroundColor = color;
359
    m_solidColor = color;
360
    setBackgroundColor(color);
361
    notifyChange(TextureMapperLayer::ContentChange);
360
    notifyChange(TextureMapperLayer::ContentChange);
362
}
361
}
363
362
- a/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h -3 / +3 lines
Lines 66-73 public: a/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h_sec1
66
    virtual void setContentsRect(const IntRect& r);
66
    virtual void setContentsRect(const IntRect& r);
67
    virtual void setReplicatedByLayer(GraphicsLayer*);
67
    virtual void setReplicatedByLayer(GraphicsLayer*);
68
    virtual void setContentsToImage(Image*);
68
    virtual void setContentsToImage(Image*);
69
    virtual void setContentsToBackgroundColor(const Color&);
69
    virtual void setContentsToSolidColor(const Color&);
70
    Color backgroundColor() const { return m_backgroundColor; }
70
    Color solidColor() const { return m_solidColor; }
71
    virtual void setContentsToMedia(PlatformLayer*);
71
    virtual void setContentsToMedia(PlatformLayer*);
72
    virtual void setContentsToCanvas(PlatformLayer* canvas) { setContentsToMedia(canvas); }
72
    virtual void setContentsToCanvas(PlatformLayer* canvas) { setContentsToMedia(canvas); }
73
    virtual void flushCompositingState(const FloatRect&);
73
    virtual void flushCompositingState(const FloatRect&);
Lines 116-122 private: a/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h_sec2
116
    bool m_needsDisplay;
116
    bool m_needsDisplay;
117
    bool m_hasOwnBackingStore;
117
    bool m_hasOwnBackingStore;
118
    bool m_fixedToViewport;
118
    bool m_fixedToViewport;
119
    Color m_backgroundColor;
119
    Color m_solidColor;
120
120
121
    Color m_debugBorderColor;
121
    Color m_debugBorderColor;
122
    float m_debugBorderWidth;
122
    float m_debugBorderWidth;
- a/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp -3 / +7 lines
Lines 109-120 void TextureMapperLayer::paintSelf(const TextureMapperPaintOptions& options) a/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp_sec1
109
    float opacity = options.opacity;
109
    float opacity = options.opacity;
110
    RefPtr<BitmapTexture> mask = options.mask;
110
    RefPtr<BitmapTexture> mask = options.mask;
111
111
112
    if (m_state.backgroundColor.alpha() && !m_state.contentsRect.isEmpty()) {
112
    if (m_state.solidColor.isValid() && !m_state.contentsRect.isEmpty()) {
113
        Color color = m_state.backgroundColor;
113
        if (!m_state.solidColor.alpha())
114
            return;
115
116
        Color color = m_state.solidColor;
114
        float r, g, b, a;
117
        float r, g, b, a;
115
        color.getRGBA(r, g, b, a);
118
        color.getRGBA(r, g, b, a);
116
        color = Color(r * opacity, g * opacity, b * opacity, a * opacity);
119
        color = Color(r * opacity, g * opacity, b * opacity, a * opacity);
117
        options.textureMapper->drawSolidColor(m_state.contentsRect, transform, color);
120
        options.textureMapper->drawSolidColor(m_state.contentsRect, transform, color);
121
        return;
118
    }
122
    }
119
123
120
    if (m_backingStore) {
124
    if (m_backingStore) {
Lines 436-442 void TextureMapperLayer::flushCompositingStateSelf(GraphicsLayerTextureMapper* g a/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp_sec2
436
    m_state.backfaceVisibility = graphicsLayer->backfaceVisibility();
440
    m_state.backfaceVisibility = graphicsLayer->backfaceVisibility();
437
    m_state.childrenTransform = graphicsLayer->childrenTransform();
441
    m_state.childrenTransform = graphicsLayer->childrenTransform();
438
    m_state.opacity = graphicsLayer->opacity();
442
    m_state.opacity = graphicsLayer->opacity();
439
    m_state.backgroundColor = graphicsLayer->backgroundColor();
443
    m_state.solidColor = graphicsLayer->solidColor();
440
#if ENABLE(CSS_FILTERS)
444
#if ENABLE(CSS_FILTERS)
441
    if (changeMask & FilterChange)
445
    if (changeMask & FilterChange)
442
        m_state.filters = graphicsLayer->filters();
446
        m_state.filters = graphicsLayer->filters();
- a/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.h -1 / +1 lines
Lines 199-205 private: a/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.h_sec1
199
        int descendantsWithContent;
199
        int descendantsWithContent;
200
        TextureMapperLayer* maskLayer;
200
        TextureMapperLayer* maskLayer;
201
        TextureMapperLayer* replicaLayer;
201
        TextureMapperLayer* replicaLayer;
202
        Color backgroundColor;
202
        Color solidColor;
203
#if ENABLE(CSS_FILTERS)
203
#if ENABLE(CSS_FILTERS)
204
         FilterOperations filters;
204
         FilterOperations filters;
205
#endif
205
#endif
- a/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedLayerInfo.h -1 / +1 lines
Lines 56-62 struct CoordinatedLayerInfo { a/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedLayerInfo.h_sec1
56
    WebCore::TransformationMatrix childrenTransform;
56
    WebCore::TransformationMatrix childrenTransform;
57
    WebCore::IntRect contentsRect;
57
    WebCore::IntRect contentsRect;
58
    float opacity;
58
    float opacity;
59
    WebCore::Color backgroundColor;
59
    WebCore::Color solidColor;
60
60
61
    union {
61
    union {
62
        struct {
62
        struct {
- a/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp -1 / +1 lines
Lines 343-349 void LayerTreeRenderer::setLayerState(CoordinatedLayerID id, const CoordinatedLa a/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp_sec1
343
    layer->setBackfaceVisibility(layerInfo.backfaceVisible);
343
    layer->setBackfaceVisibility(layerInfo.backfaceVisible);
344
    layer->setContentsOpaque(layerInfo.contentsOpaque);
344
    layer->setContentsOpaque(layerInfo.contentsOpaque);
345
    layer->setContentsRect(layerInfo.contentsRect);
345
    layer->setContentsRect(layerInfo.contentsRect);
346
    layer->setContentsToBackgroundColor(layerInfo.backgroundColor);
346
    layer->setContentsToSolidColor(layerInfo.solidColor);
347
    layer->setDrawsContent(layerInfo.drawsContent);
347
    layer->setDrawsContent(layerInfo.drawsContent);
348
    layer->setContentsVisible(layerInfo.contentsVisible);
348
    layer->setContentsVisible(layerInfo.contentsVisible);
349
    toGraphicsLayerTextureMapper(layer)->setFixedToViewport(layerInfo.fixedToViewport);
349
    toGraphicsLayerTextureMapper(layer)->setFixedToViewport(layerInfo.fixedToViewport);
- a/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp -6 / +3 lines
Lines 362-375 bool CoordinatedGraphicsLayer::setFilters(const FilterOperations& newFilters) a/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp_sec1
362
}
362
}
363
#endif
363
#endif
364
364
365
void CoordinatedGraphicsLayer::setContentsToBackgroundColor(const Color& color)
365
void CoordinatedGraphicsLayer::setContentsToSolidColor(const Color& color)
366
{
366
{
367
    if (m_layerInfo.backgroundColor == color)
367
    if (m_layerInfo.solidColor == color)
368
        return;
368
        return;
369
    m_layerInfo.backgroundColor = color;
369
    m_layerInfo.solidColor = color;
370
371
    // This is in line with what CA does.
372
    setBackgroundColor(color);
373
    didChangeLayerState();
370
    didChangeLayerState();
374
}
371
}
375
372
- a/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.h -1 / +1 lines
Lines 110-116 public: a/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.h_sec1
110
    virtual void setOpacity(float) OVERRIDE;
110
    virtual void setOpacity(float) OVERRIDE;
111
    virtual void setContentsRect(const IntRect&) OVERRIDE;
111
    virtual void setContentsRect(const IntRect&) OVERRIDE;
112
    virtual void setContentsToImage(Image*) OVERRIDE;
112
    virtual void setContentsToImage(Image*) OVERRIDE;
113
    virtual void setContentsToBackgroundColor(const Color&) OVERRIDE;
113
    virtual void setContentsToSolidColor(const Color&) OVERRIDE;
114
    virtual bool shouldDirectlyCompositeImage(Image*) const OVERRIDE;
114
    virtual bool shouldDirectlyCompositeImage(Image*) const OVERRIDE;
115
    virtual void setContentsToCanvas(PlatformLayer*) OVERRIDE;
115
    virtual void setContentsToCanvas(PlatformLayer*) OVERRIDE;
116
    virtual void setMaskLayer(GraphicsLayer*) OVERRIDE;
116
    virtual void setMaskLayer(GraphicsLayer*) OVERRIDE;

Return to Bug 104842