| Index: Source/core/platform/graphics/GraphicsLayer.cpp
|
| diff --git a/Source/core/platform/graphics/GraphicsLayer.cpp b/Source/core/platform/graphics/GraphicsLayer.cpp
|
| index f48c07505835007c8d86a93dc5c70bfdbabb14ed..1e8be8daa6f70fc7b57905a6a43c74f07b6aaec3 100644
|
| --- a/Source/core/platform/graphics/GraphicsLayer.cpp
|
| +++ b/Source/core/platform/graphics/GraphicsLayer.cpp
|
| @@ -995,6 +995,27 @@ void GraphicsLayer::setContentsToNinePatch(Image* image, const IntRect& aperture
|
| setContentsTo(m_ninePatchLayer ? m_ninePatchLayer->layer() : 0);
|
| }
|
|
|
| +void GraphicsLayer::setContentsToSolidColor(const Color& color)
|
| +{
|
| + if (color == m_contentsSolidColor)
|
| + return;
|
| +
|
| + m_contentsSolidColor = color;
|
| + if (color.isValid() && color.alpha()) {
|
| + if (!m_solidColorLayer) {
|
| + m_solidColorLayer = adoptPtr(Platform::current()->compositorSupport()->createSolidColorLayer());
|
| + registerContentsLayer(m_solidColorLayer->layer());
|
| + }
|
| + m_solidColorLayer->setBackgroundColor(color.rgb());
|
| + } else {
|
| + if (!m_solidColorLayer)
|
| + return;
|
| + unregisterContentsLayer(m_solidColorLayer->layer());
|
| + m_solidColorLayer.clear();
|
| + }
|
| + setContentsTo(m_solidColorLayer ? m_solidColorLayer->layer() : 0);
|
| +}
|
| +
|
| void GraphicsLayer::setContentsToCanvas(WebLayer* layer)
|
| {
|
| setContentsTo(layer);
|
|
|