diff options
Diffstat (limited to 'Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp')
-rw-r--r-- | Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp b/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp index 6edbe6a..3196895 100644 --- a/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp +++ b/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp @@ -1,5 +1,6 @@ /* * Copyright (C) 2009 The Android Open Source Project + * Copyright (C) 2011, Sony Ericsson Mobile Communications AB * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -106,6 +107,9 @@ GraphicsLayerAndroid::GraphicsLayerAndroid(GraphicsLayerClient* client) : m_haveContents(false), m_newImage(false), m_image(0), +#if ENABLE(WEBGL) + m_is3DCanvas(false), +#endif m_fixedBackgroundLayer(0), m_foregroundLayer(0), m_foregroundClipLayer(0) @@ -478,6 +482,14 @@ void GraphicsLayerAndroid::setNeedsDisplay() setNeedsDisplayInRect(rect); } +#if ENABLE(WEBGL) +void GraphicsLayerAndroid::setContentsNeedsDisplay() +{ + if (m_is3DCanvas) + setNeedsDisplay(); +} +#endif + // Helper to set and clear the painting phase as well as auto restore the // original phase. class PaintingPhase { @@ -1074,6 +1086,28 @@ void GraphicsLayerAndroid::setContentsToMedia(PlatformLayer* mediaLayer) } } +#if ENABLE(WEBGL) +void GraphicsLayerAndroid::setContentsToCanvas(PlatformLayer* canvasLayer) +{ + if (m_contentLayer != canvasLayer && canvasLayer) { + // Copy data from the original content layer to the new one + canvasLayer->setPosition(m_contentLayer->getPosition().fX, + m_contentLayer->getPosition().fY); + canvasLayer->setSize(m_contentLayer->getWidth(), m_contentLayer->getHeight()); + canvasLayer->setDrawTransform(*m_contentLayer->drawTransform()); + + canvasLayer->ref(); + m_contentLayer->unref(); + m_contentLayer = canvasLayer; + + m_needsSyncChildren = true; + m_is3DCanvas = true; + + setDrawsContent(true); + } +} +#endif + PlatformLayer* GraphicsLayerAndroid::platformLayer() const { ALOGV("platformLayer"); |