diff options
Diffstat (limited to 'Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp')
-rw-r--r-- | Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp b/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp index 47c03cbe9..075749e9a 100644 --- a/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp +++ b/Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp @@ -49,6 +49,7 @@ #include "FloatConversion.h" #include "FloatRect.h" #include "GraphicsContext.h" +#include "GraphicsLayerFactory.h" #include "Image.h" #include "NativeImageSkia.h" #include "PlatformContextSkia.h" @@ -77,6 +78,14 @@ using namespace WebKit; namespace WebCore { +PassOwnPtr<GraphicsLayer> GraphicsLayer::create(GraphicsLayerFactory* factory, GraphicsLayerClient* client) +{ + if (!factory) + return adoptPtr(new GraphicsLayerChromium(client)); + + return factory->createGraphicsLayer(client); +} + PassOwnPtr<GraphicsLayer> GraphicsLayer::create(GraphicsLayerClient* client) { return adoptPtr(new GraphicsLayerChromium(client)); @@ -459,7 +468,8 @@ void GraphicsLayerChromium::setContentsRect(const IntRect& rect) void GraphicsLayerChromium::setContentsToImage(Image* image) { bool childrenChanged = false; - if (image) { + NativeImageSkia* nativeImage = image ? image->nativeImageForCurrentFrame() : 0; + if (nativeImage) { if (m_contentsLayerPurpose != ContentsLayerForImage) { m_imageLayer = adoptPtr(Platform::current()->compositorSupport()->createImageLayer()); registerContentsLayer(m_imageLayer->layer()); @@ -468,7 +478,6 @@ void GraphicsLayerChromium::setContentsToImage(Image* image) m_contentsLayerPurpose = ContentsLayerForImage; childrenChanged = true; } - NativeImageSkia* nativeImage = image->nativeImageForCurrentFrame(); m_imageLayer->setBitmap(nativeImage->bitmap()); m_imageLayer->layer()->setOpaque(image->isBitmapImage() && !image->currentFrameHasAlpha()); updateContentsRect(); |