Commit b4c9ed61 authored by enne@google.com's avatar enne@google.com
Browse files

[chromium] Fix scrollbar layers holding onto invalid textures after lost context

https://bugs.webkit.org/show_bug.cgi?id=81841

Reviewed by James Robinson.

Source/WebCore:

Unit test: CCLayerTreeHostImplTest.scrollbarLayerLostContext

* platform/graphics/chromium/cc/CCScrollbarLayerImpl.cpp:
(WebCore::CCScrollbarLayerImpl::willDraw):

Source/WebKit/chromium:

* tests/CCLayerTreeHostImplTest.cpp:
(WebKitTests::TEST_F):
(WebKitTests):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@111708 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 4c876962
2012-03-22 Adrienne Walker <enne@google.com>
[chromium] Fix scrollbar layers holding onto invalid textures after lost context
https://bugs.webkit.org/show_bug.cgi?id=81841
Reviewed by James Robinson.
Unit test: CCLayerTreeHostImplTest.scrollbarLayerLostContext
* platform/graphics/chromium/cc/CCScrollbarLayerImpl.cpp:
(WebCore::CCScrollbarLayerImpl::willDraw):
2012-03-22 Philippe Normand <pnormand@igalia.com>
 
[GTK] ASSERT bug in WebAudio (AudioFileReader)
......@@ -58,6 +58,10 @@ void CCScrollbarLayerImpl::willDraw(LayerRendererChromium* layerRenderer)
if (!m_texture)
m_texture = ManagedTexture::create(layerRenderer->renderSurfaceTextureManager());
// The context could have been lost since the last frame and the old texture
// manager may no longer be valid.
m_texture->setTextureManager(layerRenderer->renderSurfaceTextureManager());
IntSize textureSize = contentBounds();
if (!m_texture->reserve(textureSize, GraphicsContext3D::RGBA))
return;
......
2012-03-22 Adrienne Walker <enne@google.com>
[chromium] Fix scrollbar layers holding onto invalid textures after lost context
https://bugs.webkit.org/show_bug.cgi?id=81841
Reviewed by James Robinson.
* tests/CCLayerTreeHostImplTest.cpp:
(WebKitTests::TEST_F):
(WebKitTests):
2012-03-22 Dana Jansens <danakj@chromium.org>
 
[chromium] Early out in a new prepareToDraw() step if checkerboarding an accelerated animation in order to skip the frame
......@@ -25,12 +25,14 @@
#include "config.h"
#include "cc/CCLayerTreeHostImpl.h"
#include "cc/CCQuadCuller.h"
#include "CCAnimationTestCommon.h"
#include "FakeWebGraphicsContext3D.h"
#include "GraphicsContext3DPrivate.h"
#include "LayerRendererChromium.h"
#include "cc/CCLayerImpl.h"
#include "cc/CCScrollbarLayerImpl.h"
#include "cc/CCSingleThreadProxy.h"
#include "cc/CCTileDrawQuad.h"
#include <gtest/gtest.h>
......@@ -1084,4 +1086,27 @@ TEST_F(CCLayerTreeHostImplTest, finishAllRenderingAfterContextLost)
m_hostImpl->finishAllRendering();
}
TEST_F(CCLayerTreeHostImplTest, scrollbarLayerLostContext)
{
m_hostImpl->initializeLayerRenderer(createContext());
m_hostImpl->setViewportSize(IntSize(10, 10));
m_hostImpl->setRootLayer(CCScrollbarLayerImpl::create(0));
CCScrollbarLayerImpl* scrollbar = static_cast<CCScrollbarLayerImpl*>(m_hostImpl->rootLayer());
scrollbar->setBounds(IntSize(1, 1));
scrollbar->setContentBounds(IntSize(1, 1));
scrollbar->setDrawsContent(true);
for (int i = 0; i < 2; ++i) {
CCLayerTreeHostImpl::FrameData frame;
EXPECT_TRUE(m_hostImpl->prepareToDraw(frame));
ASSERT(frame.renderPasses.size() == 1);
CCRenderPass* renderPass = frame.renderPasses[0].get();
// Scrollbar layer should always generate quads, even after lost context
EXPECT_GT(renderPass->quadList().size(), 0u);
m_hostImpl->initializeLayerRenderer(createContext());
}
}
} // namespace
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment