diff options
Diffstat (limited to 'WebCore/platform/graphics/chromium/Canvas2DLayerChromium.cpp')
-rw-r--r-- | WebCore/platform/graphics/chromium/Canvas2DLayerChromium.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/WebCore/platform/graphics/chromium/Canvas2DLayerChromium.cpp b/WebCore/platform/graphics/chromium/Canvas2DLayerChromium.cpp index c2cde19..ad961aa 100644 --- a/WebCore/platform/graphics/chromium/Canvas2DLayerChromium.cpp +++ b/WebCore/platform/graphics/chromium/Canvas2DLayerChromium.cpp @@ -56,9 +56,9 @@ Canvas2DLayerChromium::~Canvas2DLayerChromium() layerRendererContext()->deleteTexture(m_textureId); } -void Canvas2DLayerChromium::updateContents() +void Canvas2DLayerChromium::updateContentsIfDirty() { - if (!m_drawingBuffer) + if (!m_contentsDirty || !m_drawingBuffer) return; if (m_textureChanged) { // We have to generate a new backing texture. GraphicsContext3D* context = layerRendererContext(); @@ -68,7 +68,7 @@ void Canvas2DLayerChromium::updateContents() context->activeTexture(GraphicsContext3D::TEXTURE0); context->bindTexture(GraphicsContext3D::TEXTURE_2D, m_textureId); IntSize size = m_drawingBuffer->size(); - context->texImage2D(GraphicsContext3D::TEXTURE_2D, 0, GraphicsContext3D::RGBA, size.width(), size.height(), 0, GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE, 0); + context->texImage2DResourceSafe(GraphicsContext3D::TEXTURE_2D, 0, GraphicsContext3D::RGBA, size.width(), size.height(), 0, GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE); // Set the min-mag filters to linear and wrap modes to GraphicsContext3D::CLAMP_TO_EDGE // to get around NPOT texture limitations of GLES. context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_MIN_FILTER, GraphicsContext3D::LINEAR); |