Diff
Modified: trunk/Source/WebCore/ChangeLog (105844 => 105845)
--- trunk/Source/WebCore/ChangeLog 2012-01-25 02:47:06 UTC (rev 105844)
+++ trunk/Source/WebCore/ChangeLog 2012-01-25 03:28:08 UTC (rev 105845)
@@ -1,3 +1,21 @@
+2012-01-24 Vangelis Kokkevis <[email protected]>
+
+ [chromium] Ignore m_skipsDraw in TiledLayerChromium::drawsContent()
+ https://bugs.webkit.org/show_bug.cgi?id=76735
+
+ This is to add skipped layers to their RenderSurface's layer list so that they
+ are considered in the next update. Without this change, m_skipsDraw = false sticks
+ with the layer for the remainder of its lifetime.
+
+ Reviewed by James Robinson.
+
+ Tests: Unit test (TiledLayerChromiumTest.cpp)
+
+ * platform/graphics/chromium/TiledLayerChromium.cpp:
+ (WebCore::TiledLayerChromium::drawsContent):
+ * platform/graphics/chromium/TiledLayerChromium.h:
+ (WebCore::TiledLayerChromium::skipsDraw):
+
2012-01-24 Kentaro Hara <[email protected]>
Invalidate r105697, r105766, r105809 and r105805
Modified: trunk/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp (105844 => 105845)
--- trunk/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp 2012-01-25 02:47:06 UTC (rev 105844)
+++ trunk/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp 2012-01-25 03:28:08 UTC (rev 105845)
@@ -160,7 +160,7 @@
if (m_tilingOption == NeverTile && m_tiler->numTiles() > 1)
return false;
- return !m_skipsDraw;
+ return true;
}
bool TiledLayerChromium::needsContentsScale() const
Modified: trunk/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.h (105844 => 105845)
--- trunk/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.h 2012-01-25 02:47:06 UTC (rev 105844)
+++ trunk/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.h 2012-01-25 03:28:08 UTC (rev 105845)
@@ -88,6 +88,8 @@
// After preparing an update, returns true if more pre-painting is needed.
bool needsIdlePaint(const IntRect& layerRect);
+ bool skipsDraw() const { return m_skipsDraw; }
+
virtual void protectVisibleTileTextures();
virtual TextureManager* textureManager() const;
Modified: trunk/Source/WebKit/chromium/ChangeLog (105844 => 105845)
--- trunk/Source/WebKit/chromium/ChangeLog 2012-01-25 02:47:06 UTC (rev 105844)
+++ trunk/Source/WebKit/chromium/ChangeLog 2012-01-25 03:28:08 UTC (rev 105845)
@@ -1,3 +1,27 @@
+2012-01-24 Vangelis Kokkevis <[email protected]>
+
+ Adding a test to verify that m_skipsDraw gets reset between frames for
+ tiled layers.
+ https://bugs.webkit.org/show_bug.cgi?id=76735
+
+ Reviewed by James Robinson.
+
+ * WebKit.gypi:
+ * tests/FakeCCLayerTreeHostClient.h: Added.
+ (WebCore::FakeCCLayerTreeHostClient::updateAnimations):
+ (WebCore::FakeCCLayerTreeHostClient::layout):
+ (WebCore::FakeCCLayerTreeHostClient::applyScrollAndScale):
+ (WebCore::FakeCCLayerTreeHostClient::createLayerTreeHostContext3D):
+ (WebCore::FakeCCLayerTreeHostClient::didRecreateGraphicsContext):
+ (WebCore::FakeCCLayerTreeHostClient::didCommitAndDrawFrame):
+ (WebCore::FakeCCLayerTreeHostClient::didCompleteSwapBuffers):
+ (WebCore::FakeCCLayerTreeHostClient::scheduleComposite):
+ * tests/LayerChromiumTest.cpp:
+ * tests/TiledLayerChromiumTest.cpp:
+ (WTF::FakeTiledLayerChromium::skipsDraw):
+ (WTF::FakeTiledLayerChromium::paintContentsIfDirty):
+ (WTF::TEST):
+
2012-01-24 Dmitry Lomov <[email protected]>
Unreviewed: removing WebWorker.h again after r105684.
Modified: trunk/Source/WebKit/chromium/WebKit.gypi (105844 => 105845)
--- trunk/Source/WebKit/chromium/WebKit.gypi 2012-01-25 02:47:06 UTC (rev 105844)
+++ trunk/Source/WebKit/chromium/WebKit.gypi 2012-01-25 03:28:08 UTC (rev 105845)
@@ -86,6 +86,7 @@
'tests/CCTimerTest.cpp',
'tests/CompositorFakeGraphicsContext3D.h',
'tests/CompositorFakeWebGraphicsContext3D.h',
+ 'tests/FakeCCLayerTreeHostClient.h',
'tests/FakeGraphicsContext3DTest.cpp',
'tests/FakeWebGraphicsContext3D.h',
'tests/FloatQuadTest.cpp',
Added: trunk/Source/WebKit/chromium/tests/FakeCCLayerTreeHostClient.h (0 => 105845)
--- trunk/Source/WebKit/chromium/tests/FakeCCLayerTreeHostClient.h (rev 0)
+++ trunk/Source/WebKit/chromium/tests/FakeCCLayerTreeHostClient.h 2012-01-25 03:28:08 UTC (rev 105845)
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef FakeCCLayerTreeHostClient_h
+#define FakeCCLayerTreeHostClient_h
+
+#include "config.h"
+
+#include "cc/CCLayerTreeHost.h"
+#include "CompositorFakeGraphicsContext3D.h"
+
+namespace WebCore {
+
+class FakeCCLayerTreeHostClient : public CCLayerTreeHostClient {
+public:
+ virtual void updateAnimations(double frameBeginTime) { }
+ virtual void layout() { }
+ virtual void applyScrollAndScale(const IntSize& scrollDelta, float pageScale) { }
+ virtual PassRefPtr<GraphicsContext3D> createLayerTreeHostContext3D()
+ {
+ GraphicsContext3D::Attributes attrs;
+ return createCompositorMockGraphicsContext3D(attrs);
+ }
+ virtual void didRecreateGraphicsContext(bool success) { }
+ virtual void didCommitAndDrawFrame() { }
+ virtual void didCompleteSwapBuffers() { }
+
+ // Used only in the single-threaded path.
+ virtual void scheduleComposite() { }
+};
+
+}
+#endif // FakeCCLayerTreeHostClient_h
\ No newline at end of file
Property changes on: trunk/Source/WebKit/chromium/tests/FakeCCLayerTreeHostClient.h
___________________________________________________________________
Added: svn:executable
Modified: trunk/Source/WebKit/chromium/tests/LayerChromiumTest.cpp (105844 => 105845)
--- trunk/Source/WebKit/chromium/tests/LayerChromiumTest.cpp 2012-01-25 02:47:06 UTC (rev 105844)
+++ trunk/Source/WebKit/chromium/tests/LayerChromiumTest.cpp 2012-01-25 03:28:08 UTC (rev 105845)
@@ -28,6 +28,7 @@
#include "cc/CCLayerTreeHost.h"
#include "CCLayerTreeTestCommon.h"
+#include "FakeCCLayerTreeHostClient.h"
#include "LayerPainterChromium.h"
#include "NonCompositedContentHost.h"
#include "WebCompositor.h"
@@ -50,20 +51,6 @@
namespace {
-class FakeCCLayerTreeHostClient : public CCLayerTreeHostClient {
-public:
- virtual void updateAnimations(double frameBeginTime) { }
- virtual void layout() { }
- virtual void applyScrollAndScale(const IntSize& scrollDelta, float pageScale) { }
- virtual PassRefPtr<GraphicsContext3D> createLayerTreeHostContext3D() { return 0; }
- virtual void didRecreateGraphicsContext(bool success) { }
- virtual void didCommitAndDrawFrame() { }
- virtual void didCompleteSwapBuffers() { }
-
- // Used only in the single-threaded path.
- virtual void scheduleComposite() { }
-};
-
class MockCCLayerTreeHost : public CCLayerTreeHost {
public:
MockCCLayerTreeHost()
Modified: trunk/Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp (105844 => 105845)
--- trunk/Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp 2012-01-25 02:47:06 UTC (rev 105844)
+++ trunk/Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp 2012-01-25 03:28:08 UTC (rev 105845)
@@ -27,8 +27,10 @@
#include "TiledLayerChromium.h"
#include "CCLayerTreeTestCommon.h"
+#include "FakeCCLayerTreeHostClient.h"
#include "LayerTextureUpdater.h"
#include "TextureManager.h"
+#include "WebCompositor.h"
#include "cc/CCSingleThreadProxy.h" // For DebugScopedSetImplThread
#include "cc/CCTextureUpdater.h"
#include "cc/CCTiledLayerImpl.h"
@@ -128,10 +130,20 @@
return TiledLayerChromium::needsIdlePaint(rect);
}
+ bool skipsDraw() const
+ {
+ return TiledLayerChromium::skipsDraw();
+ }
+
FakeLayerTextureUpdater* fakeLayerTextureUpdater() { return m_fakeTextureUpdater.get(); }
virtual TextureManager* textureManager() const { return m_textureManager; }
+ virtual void paintContentsIfDirty()
+ {
+ prepareToUpdate(visibleLayerRect());
+ }
+
private:
virtual void createTextureUpdater(const CCLayerTreeHost*) { }
@@ -395,4 +407,57 @@
EXPECT_FLOAT_RECT_EQ(FloatRect(45, 80, 15, 8), layer->updateRect());
}
+TEST(TiledLayerChromiumTest, skipsDrawGetsReset)
+{
+ // Initialize without threading support.
+ WebKit::WebCompositor::initialize(0);
+ FakeCCLayerTreeHostClient fakeCCLayerTreeHostClient;
+ RefPtr<CCLayerTreeHost> ccLayerTreeHost = CCLayerTreeHost::create(&fakeCCLayerTreeHostClient, CCSettings());
+
+ // Create two 300 x 300 tiled layers.
+ IntSize contentBounds(300, 300);
+ IntRect contentRect(IntPoint::zero(), contentBounds);
+
+ RefPtr<FakeTiledLayerChromium> rootLayer = adoptRef(new FakeTiledLayerChromium(ccLayerTreeHost->contentsTextureManager()));
+ RefPtr<FakeTiledLayerChromium> childLayer = adoptRef(new FakeTiledLayerChromium(ccLayerTreeHost->contentsTextureManager()));
+ rootLayer->addChild(childLayer);
+
+ rootLayer->setBounds(contentBounds);
+ rootLayer->setPosition(FloatPoint(150, 150));
+ childLayer->setBounds(contentBounds);
+ childLayer->setPosition(FloatPoint(150, 150));
+ rootLayer->invalidateRect(contentRect);
+ childLayer->invalidateRect(contentRect);
+
+ // We have enough memory for only one of the two layers.
+ int memoryLimit = 4 * 300 * 300; // 4 bytes per pixel.
+
+ FakeTextureAllocator textureAllocator;
+ CCTextureUpdater updater(&textureAllocator);
+
+ ccLayerTreeHost->setRootLayer(rootLayer);
+ ccLayerTreeHost->setViewportSize(IntSize(300, 300));
+ ccLayerTreeHost->contentsTextureManager()->setMaxMemoryLimitBytes(memoryLimit);
+ ccLayerTreeHost->updateLayers();
+ ccLayerTreeHost->updateCompositorResources(ccLayerTreeHost->context(), updater);
+
+ // We'll skip the root layer.
+ EXPECT_TRUE(rootLayer->skipsDraw());
+ EXPECT_FALSE(childLayer->skipsDraw());
+
+ ccLayerTreeHost->commitComplete();
+
+ // Remove the child layer.
+ rootLayer->removeAllChildren();
+
+ // Need to set the max limit again as it gets overwritten by updateLayers().
+ ccLayerTreeHost->contentsTextureManager()->setMaxMemoryLimitBytes(memoryLimit);
+ ccLayerTreeHost->updateLayers();
+ EXPECT_FALSE(rootLayer->skipsDraw());
+
+ ccLayerTreeHost->setRootLayer(0);
+ ccLayerTreeHost.clear();
+ WebKit::WebCompositor::shutdown();
+}
+
} // namespace