summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform/graphics/chromium/WebGLLayerChromium.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/platform/graphics/chromium/WebGLLayerChromium.cpp')
-rw-r--r--Source/WebCore/platform/graphics/chromium/WebGLLayerChromium.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/Source/WebCore/platform/graphics/chromium/WebGLLayerChromium.cpp b/Source/WebCore/platform/graphics/chromium/WebGLLayerChromium.cpp
index e83d045..652e752 100644
--- a/Source/WebCore/platform/graphics/chromium/WebGLLayerChromium.cpp
+++ b/Source/WebCore/platform/graphics/chromium/WebGLLayerChromium.cpp
@@ -47,10 +47,11 @@ PassRefPtr<WebGLLayerChromium> WebGLLayerChromium::create(GraphicsLayerChromium*
WebGLLayerChromium::WebGLLayerChromium(GraphicsLayerChromium* owner)
: CanvasLayerChromium(owner)
, m_context(0)
+ , m_textureUpdated(false)
{
}
-void WebGLLayerChromium::updateContentsIfDirty()
+void WebGLLayerChromium::updateCompositorResources()
{
if (!m_contentsDirty)
return;
@@ -68,19 +69,28 @@ void WebGLLayerChromium::updateContentsIfDirty()
m_textureChanged = false;
}
// Update the contents of the texture used by the compositor.
- if (m_contentsDirty) {
+ if (m_contentsDirty && m_textureUpdated) {
m_context->prepareTexture();
+ m_context->markLayerComposited();
m_contentsDirty = false;
+ m_textureUpdated = false;
}
}
+void WebGLLayerChromium::setTextureUpdated()
+{
+ m_textureUpdated = true;
+}
+
void WebGLLayerChromium::setContext(const GraphicsContext3D* context)
{
m_context = const_cast<GraphicsContext3D*>(context);
unsigned int textureId = m_context->platformTexture();
- if (textureId != m_textureId)
+ if (textureId != m_textureId) {
m_textureChanged = true;
+ m_textureUpdated = true;
+ }
m_textureId = textureId;
m_premultipliedAlpha = m_context->getContextAttributes().premultipliedAlpha;
}