Modified: trunk/Source/WebCore/ChangeLog (119761 => 119762)
--- trunk/Source/WebCore/ChangeLog 2012-06-07 22:27:32 UTC (rev 119761)
+++ trunk/Source/WebCore/ChangeLog 2012-06-07 22:37:50 UTC (rev 119762)
@@ -1,3 +1,16 @@
+2012-06-07 Sheriff Bot <[email protected]>
+
+ Unreviewed, rolling out r119744.
+ http://trac.webkit.org/changeset/119744
+ https://bugs.webkit.org/show_bug.cgi?id=88584
+
+ Fails assertions in debug builds (Requested by jamesr_ on
+ #webkit).
+
+ * platform/graphics/chromium/cc/CCIOSurfaceLayerImpl.cpp:
+ (WebCore::CCIOSurfaceLayerImpl::~CCIOSurfaceLayerImpl):
+ (WebCore::CCIOSurfaceLayerImpl::willDraw):
+
2012-06-07 Julien Chaffraix <[email protected]>
Cache RenderLayer::isRootLayer for better performance
Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCIOSurfaceLayerImpl.cpp (119761 => 119762)
--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCIOSurfaceLayerImpl.cpp 2012-06-07 22:27:32 UTC (rev 119761)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCIOSurfaceLayerImpl.cpp 2012-06-07 22:37:50 UTC (rev 119762)
@@ -33,7 +33,6 @@
#include "GraphicsContext3D.h"
#include "LayerRendererChromium.h"
#include "cc/CCIOSurfaceDrawQuad.h"
-#include "cc/CCLayerTreeHostImpl.h"
#include "cc/CCProxy.h"
#include "cc/CCQuadCuller.h"
@@ -49,14 +48,9 @@
CCIOSurfaceLayerImpl::~CCIOSurfaceLayerImpl()
{
- if (!m_ioSurfaceTextureId)
- return;
-
- CCGraphicsContext* context = layerTreeHostImpl()->context();
- // FIXME: Implement this path for software compositing.
- GraphicsContext3D* context3d = context->context3D();
- if (context3d)
- context3d->deleteTexture(m_ioSurfaceTextureId);
+ // FIXME: it seems there is no layer renderer / GraphicsContext3D available here. Ideally we
+ // would like to delete m_ioSurfaceTextureId.
+ m_ioSurfaceTextureId = 0;
}
void CCIOSurfaceLayerImpl::willDraw(CCRenderer* layerRenderer, CCGraphicsContext* context)
@@ -73,7 +67,6 @@
ASSERT(extensions->supports("GL_CHROMIUM_iosurface"));
ASSERT(extensions->supports("GL_ARB_texture_rectangle"));
- // FIXME: Do this in a way that we can track memory usage.
if (!m_ioSurfaceTextureId)
m_ioSurfaceTextureId = context3d->createTexture();
Modified: trunk/Source/WebKit/chromium/ChangeLog (119761 => 119762)
--- trunk/Source/WebKit/chromium/ChangeLog 2012-06-07 22:27:32 UTC (rev 119761)
+++ trunk/Source/WebKit/chromium/ChangeLog 2012-06-07 22:37:50 UTC (rev 119762)
@@ -1,3 +1,14 @@
+2012-06-07 Sheriff Bot <[email protected]>
+
+ Unreviewed, rolling out r119744.
+ http://trac.webkit.org/changeset/119744
+ https://bugs.webkit.org/show_bug.cgi?id=88584
+
+ Fails assertions in debug builds (Requested by jamesr_ on
+ #webkit).
+
+ * tests/CCLayerTreeHostImplTest.cpp:
+
2012-06-07 Adam Barth <[email protected]>
Settings::defaultDeviceScaleFactor is redundant with Page::deviceScaleFactor
Modified: trunk/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp (119761 => 119762)
--- trunk/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp 2012-06-07 22:27:32 UTC (rev 119761)
+++ trunk/Source/WebKit/chromium/tests/CCLayerTreeHostImplTest.cpp 2012-06-07 22:37:50 UTC (rev 119762)
@@ -31,7 +31,6 @@
#include "FakeWebGraphicsContext3D.h"
#include "GraphicsContext3DPrivate.h"
#include "LayerRendererChromium.h"
-#include "cc/CCIOSurfaceLayerImpl.h"
#include "cc/CCLayerImpl.h"
#include "cc/CCLayerTilingData.h"
#include "cc/CCQuadCuller.h"
@@ -1718,15 +1717,6 @@
videoLayer->setDrawsContent(true);
rootLayer->addChild(videoLayer.release());
- OwnPtr<CCIOSurfaceLayerImpl> ioSurfaceLayer = CCIOSurfaceLayerImpl::create(4);
- ioSurfaceLayer->setBounds(IntSize(10, 10));
- ioSurfaceLayer->setAnchorPoint(FloatPoint(0, 0));
- ioSurfaceLayer->setContentBounds(IntSize(10, 10));
- ioSurfaceLayer->setDrawsContent(true);
- ioSurfaceLayer->setIOSurfaceProperties(1, IntSize(10, 10));
- ioSurfaceLayer->setLayerTreeHostImpl(m_hostImpl.get());
- rootLayer->addChild(ioSurfaceLayer.release());
-
m_hostImpl->setRootLayer(rootLayer.release());
CCLayerTreeHostImpl::FrameData frame;
@@ -1744,106 +1734,4 @@
m_hostImpl->swapBuffers();
}
-// Fake WebGraphicsContext3D that tracks the number of textures in use.
-class TrackingWebGraphicsContext3D : public FakeWebGraphicsContext3D {
-public:
- TrackingWebGraphicsContext3D()
- : m_nextTextureId(1)
- , m_numTextures(0)
- { }
-
- virtual WebGLId createTexture()
- {
- WebGLId id = m_nextTextureId;
- ++m_nextTextureId;
-
- m_textures.set(id, true);
- ++m_numTextures;
- return id;
- }
-
- virtual void deleteTexture(WebGLId id)
- {
- if (!m_textures.get(id))
- return;
- m_textures.set(id, false);
- --m_numTextures;
- }
-
- PassRefPtr<GraphicsContext3D> createGraphicsContext()
- {
- return GraphicsContext3DPrivate::createGraphicsContextFromWebContext(adoptPtr(this), GraphicsContext3D::RenderDirectlyToHostWindow);
- }
-
- unsigned numTextures() const { return m_numTextures; }
-
-private:
- WebGLId m_nextTextureId;
- HashMap<WebGLId, bool> m_textures;
- unsigned m_numTextures;
-};
-
-TEST_F(CCLayerTreeHostImplTest, layersFreeTextures)
-{
- OwnPtr<CCLayerImpl> rootLayer(CCLayerImpl::create(0));
- rootLayer->setBounds(IntSize(10, 10));
- rootLayer->setAnchorPoint(FloatPoint(0, 0));
-
- OwnPtr<CCTiledLayerImpl> tileLayer = CCTiledLayerImpl::create(1);
- tileLayer->setBounds(IntSize(10, 10));
- tileLayer->setAnchorPoint(FloatPoint(0, 0));
- tileLayer->setContentBounds(IntSize(10, 10));
- tileLayer->setDrawsContent(true);
- tileLayer->setSkipsDraw(false);
- OwnPtr<CCLayerTilingData> tilingData(CCLayerTilingData::create(IntSize(10, 10), CCLayerTilingData::NoBorderTexels));
- tilingData->setBounds(IntSize(10, 10));
- tileLayer->setTilingData(*tilingData);
- tileLayer->pushTileProperties(0, 0, 1, IntRect(0, 0, 10, 10));
- rootLayer->addChild(tileLayer.release());
-
- OwnPtr<CCTextureLayerImpl> textureLayer = CCTextureLayerImpl::create(2);
- textureLayer->setBounds(IntSize(10, 10));
- textureLayer->setAnchorPoint(FloatPoint(0, 0));
- textureLayer->setContentBounds(IntSize(10, 10));
- textureLayer->setDrawsContent(true);
- textureLayer->setTextureId(1);
- rootLayer->addChild(textureLayer.release());
-
- FakeVideoFrameProvider provider;
- OwnPtr<CCVideoLayerImpl> videoLayer = CCVideoLayerImpl::create(3, &provider);
- videoLayer->setBounds(IntSize(10, 10));
- videoLayer->setAnchorPoint(FloatPoint(0, 0));
- videoLayer->setContentBounds(IntSize(10, 10));
- videoLayer->setDrawsContent(true);
- videoLayer->setLayerTreeHostImpl(m_hostImpl.get());
- rootLayer->addChild(videoLayer.release());
-
- OwnPtr<CCIOSurfaceLayerImpl> ioSurfaceLayer = CCIOSurfaceLayerImpl::create(4);
- ioSurfaceLayer->setBounds(IntSize(10, 10));
- ioSurfaceLayer->setAnchorPoint(FloatPoint(0, 0));
- ioSurfaceLayer->setContentBounds(IntSize(10, 10));
- ioSurfaceLayer->setDrawsContent(true);
- ioSurfaceLayer->setIOSurfaceProperties(1, IntSize(10, 10));
- ioSurfaceLayer->setLayerTreeHostImpl(m_hostImpl.get());
- rootLayer->addChild(ioSurfaceLayer.release());
-
- // Lose the context, replacing it with a TrackingWebGraphicsContext3D, that
- // tracks the number of textures allocated. This pointer is owned by its
- // GraphicsContext3D.
- TrackingWebGraphicsContext3D* trackingWebGraphicsContext = new TrackingWebGraphicsContext3D();
- m_hostImpl->initializeLayerRenderer(CCGraphicsContext::create3D(trackingWebGraphicsContext->createGraphicsContext()), UnthrottledUploader);
-
- m_hostImpl->setRootLayer(rootLayer.release());
-
- CCLayerTreeHostImpl::FrameData frame;
- EXPECT_TRUE(m_hostImpl->prepareToDraw(frame));
- m_hostImpl->drawLayers(frame);
- m_hostImpl->didDrawAllLayers(frame);
- m_hostImpl->swapBuffers();
-
- // Kill the layer tree. There should be no textures left in use after.
- m_hostImpl.clear();
- EXPECT_EQ(0u, trackingWebGraphicsContext->numTextures());
-}
-
} // namespace