[chromium] Push drawsContent and contentsVisible into accelerated compositor

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

Patch by Shawn Singh <shawnsingh@chromium.org> on 2012-01-03
Reviewed by James Robinson.

Source/WebCore:

Tests: compositing/visibility/visibility-simple-canvas2d-layer.html
       compositing/visibility/visibility-simple-video-layer.html
       compositing/visibility/visibility-simple-webgl-layer.html

Rebaselined compositing/visibility/visibility-image-layers.html

The CSS visibility property was not being properly obeyed by many
specialized layer types in the accelerated compositor. The root of
the problem was that drawsContent and contentsVisible flags were
not properly propagated into the compositor. This patch removes
the drawsContent() callback, and instead makes sure that
drawsContent and contentsVisible are "pushed" through the
accelerated compositor.

* platform/graphics/chromium/Canvas2DLayerChromium.cpp:
(WebCore::Canvas2DLayerChromium::drawsContent):
* platform/graphics/chromium/ContentLayerChromium.cpp:
* platform/graphics/chromium/ContentLayerChromium.h:
* platform/graphics/chromium/GraphicsLayerChromium.cpp:
(WebCore::GraphicsLayerChromium::setDrawsContent):
(WebCore::GraphicsLayerChromium::setContentsVisible):
(WebCore::GraphicsLayerChromium::setContentsToImage):
(WebCore::GraphicsLayerChromium::setContentsToCanvas):
(WebCore::GraphicsLayerChromium::setContentsToMedia):
(WebCore::GraphicsLayerChromium::updateLayerIsDrawable):
(WebCore::GraphicsLayerChromium::setupContentsLayer):
* platform/graphics/chromium/GraphicsLayerChromium.h:
* platform/graphics/chromium/LayerChromium.cpp:
(WebCore::LayerChromium::LayerChromium):
(WebCore::LayerChromium::setIsDrawable):
* platform/graphics/chromium/LayerChromium.h:
(WebCore::LayerChromium::drawsContent):
* platform/graphics/chromium/PluginLayerChromium.h:
* platform/graphics/chromium/TiledLayerChromium.cpp:
(WebCore::TiledLayerChromium::drawsContent):
* platform/graphics/chromium/VideoLayerChromium.h:
* platform/graphics/chromium/WebGLLayerChromium.cpp:
(WebCore::WebGLLayerChromium::drawsContent):
* platform/graphics/chromium/cc/CCLayerImpl.cpp:
(WebCore::CCLayerImpl::dumpLayerProperties):

Source/WebKit/chromium:

* src/WebContentLayerImpl.cpp:
(WebKit::WebContentLayerImpl::WebContentLayerImpl):
(WebKit::WebContentLayerImpl::setDrawsContent):
* src/WebContentLayerImpl.h:
* src/WebExternalTextureLayerImpl.cpp:
(WebKit::WebExternalTextureLayerImpl::drawsContent):
* src/WebLayerImpl.cpp:
(WebKit::WebLayerImpl::WebLayerImpl):
* src/WebLayerImpl.h:
* tests/CCLayerTreeHostTest.cpp:
(WTF::ContentLayerChromiumWithUpdateTracking::ContentLayerChromiumWithUpdateTracking):
* tests/Canvas2DLayerChromiumTest.cpp:
* tests/LayerChromiumTest.cpp:
* tests/TiledLayerChromiumTest.cpp:
(WTF::FakeTiledLayerChromium::FakeTiledLayerChromium):

LayoutTests:

* compositing/visibility/visibility-image-layers-expected.png:
* compositing/visibility/visibility-image-layers-expected.txt: Renamed from LayoutTests/platform/mac/compositing/visibility/visibility-image-layers-expected.txt.
* compositing/visibility/visibility-simple-canvas2d-layer-expected.png: Added.
* compositing/visibility/visibility-simple-canvas2d-layer-expected.txt: Added.
* compositing/visibility/visibility-simple-canvas2d-layer.html: Added.
* compositing/visibility/visibility-simple-video-layer-expected.png: Added.
* compositing/visibility/visibility-simple-video-layer-expected.txt: Added.
* compositing/visibility/visibility-simple-video-layer.html: Added.
* compositing/visibility/visibility-simple-webgl-layer-expected.png: Added.
* compositing/visibility/visibility-simple-webgl-layer-expected.txt: Added.
* compositing/visibility/visibility-simple-webgl-layer.html: Added.
* platform/chromium-mac-snowleopard/compositing/visibility/visibility-image-layers-expected.png: Removed.
* platform/chromium-win/compositing/visibility/visibility-image-layers-expected.png: Removed.
* platform/chromium/test_expectations.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@103990 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent a74dfdcd
2012-01-03 Shawn Singh <shawnsingh@chromium.org>
[chromium] Push drawsContent and contentsVisible into accelerated compositor
https://bugs.webkit.org/show_bug.cgi?id=71209
Reviewed by James Robinson.
* compositing/visibility/visibility-image-layers-expected.png:
* compositing/visibility/visibility-image-layers-expected.txt: Renamed from LayoutTests/platform/mac/compositing/visibility/visibility-image-layers-expected.txt.
* compositing/visibility/visibility-simple-canvas2d-layer-expected.png: Added.
* compositing/visibility/visibility-simple-canvas2d-layer-expected.txt: Added.
* compositing/visibility/visibility-simple-canvas2d-layer.html: Added.
* compositing/visibility/visibility-simple-video-layer-expected.png: Added.
* compositing/visibility/visibility-simple-video-layer-expected.txt: Added.
* compositing/visibility/visibility-simple-video-layer.html: Added.
* compositing/visibility/visibility-simple-webgl-layer-expected.png: Added.
* compositing/visibility/visibility-simple-webgl-layer-expected.txt: Added.
* compositing/visibility/visibility-simple-webgl-layer.html: Added.
* platform/chromium-mac-snowleopard/compositing/visibility/visibility-image-layers-expected.png: Removed.
* platform/chromium-win/compositing/visibility/visibility-image-layers-expected.png: Removed.
* platform/chromium/test_expectations.txt:
2012-01-03 Tony Chang <tony@chromium.org>
[chromium] Unreviewed, svg/carto.net/selectionlist.svg appears to
<!DOCTYPE html>
<html>
<head>
<style>
canvas {
background-color: rgba(0, 0, 0, 1);
}
.hidden {
visibility: hidden;
}
.visible {
visibility: visible;
}
.composited {
-webkit-transform: translatez(0);
}
</style>
<script>
if (window.layoutTestController)
layoutTestController.dumpAsText(true);
function drawCanvas(canvasID, color)
{
var theCanvas = document.getElementById(canvasID);
var canvasContext = theCanvas.getContext("2d");
canvasContext.fillStyle = color;
canvasContext.fillRect(0, 0, 150, 150);
}
function init()
{
drawCanvas("one", "green");
drawCanvas("two", "red");
drawCanvas("three", "red");
}
</script>
</head>
<body onload="init()">
<!-- Tests CSS visibility flag for a composited canvas2D layer. -->
<!-- Pixel test only. Only the green canvas2d should be visible. The other two should be hidden. -->
<div><canvas id="one" class="composited visible" width="150" height="150"></canvas></div>
<div><canvas id="two" class="hidden" width="150" height="150"></canvas></div>
<div><canvas id="three" class="composited hidden" width="150" height="150"></canvas></div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<style>
.box {
height: 150px;
width: 150px;
}
div {
width: 150px;
margin: 5px;
padding: 5px;
border: 1px solid black;
}
.hidden {
visibility: hidden;
}
.visible {
visibility: visible;
background-color: green;
}
.composited {
-webkit-transform: translateZ(1px);
}
</style>
<script>
if (window.layoutTestController) {
layoutTestController.dumpAsText(true);
layoutTestController.waitUntilDone();
}
var counter = 0;
function notifyVideoDone() {
counter = counter + 1;
if ((counter === 3) && (window.layoutTestController))
layoutTestController.notifyDone();
}
function playVideoOnElement(video) {
video.src = '../resources/video.' + (video.canPlayType('video/ogg') ? 'ogv' : 'mov');
video.addEventListener('ended', function(event) {
notifyVideoDone();
}, false);
}
function init() {
playVideoOnElement(document.getElementsByTagName('video')[0]);
playVideoOnElement(document.getElementsByTagName('video')[1]);
playVideoOnElement(document.getElementsByTagName('video')[2]);
}
</script>
</head>
<body onload="init()">
<!-- Tests CSS visibility flag for composited video layers. -->
<!-- Pixel test only. Only the top video should be visible, the other two should be hidden (borders should remain visible) -->
<div><video class="visible composited box" autoplay></video></div>
<div><video class="hidden box" autoplay></video></div>
<div><video class="hidden composited box" autoplay></video></div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<style>
canvas {
background-color: rgba(0, 0, 0, 1);
}
.hidden {
visibility: hidden;
}
.visible {
visibility: visible;
}
</style>
<script>
if (window.layoutTestController) {
layoutTestController.dumpAsText(true);
layoutTestController.overridePreference("WebKitWebGLEnabled", "1");
}
function drawCanvas(canvasID, clearColor)
{
var theCanvas = document.getElementById(canvasID);
var glContext = theCanvas.getContext("experimental-webgl");
glContext.clearColor(clearColor[0], clearColor[1], clearColor[2], clearColor[3]);
glContext.clear(glContext.COLOR_BUFFER_BIT);
}
function init()
{
drawCanvas("topGL", [0, 0.5, 0, 1]);
drawCanvas("bottomGL", [1, 0, 0, 1]);
}
</script>
</head>
<body onload="init()">
<!-- Tests CSS visibility flag for WebGL layers. -->
<!-- Pixel test only. Only the green webGL canvas should be visible. The red one should be hidden. -->
<div><canvas id="topGL" class="visible" width="150" height="150"></canvas></div>
<div><canvas id="bottomGL" class="hidden" width="150" height="150"></canvas></div>
</body>
</html>
......@@ -1148,6 +1148,12 @@ BUGWK66467 : fast/dom/HTMLInputElement/input-image-alt-text.html = FAIL
// and then baselined if necessary.
// ----------------------------------------------------------------------------
// These four expectations can be removed after verifying the correctness / rebaselining on all platforms.
BUGWK71209 LINUX WIN : compositing/visibility/visibility-simple-webgl-layer.html = IMAGE
BUGWK71209 LINUX WIN : compositing/visibility/visibility-simple-canvas2d-layer.html = IMAGE
BUGWK71209 LINUX WIN : compositing/visibility/visibility-simple-video-layer.html = IMAGE
BUGWK71209 LINUX WIN : compositing/visibility/visibility-image-layers.html = IMAGE
// This test isn't hanging, it just takes 12-13 seconds to run.
BUGCR30536 SLOW LINUX WIN : http/tests/misc/acid3.html = FAIL // See "SVG Tests" section too
BUGCR30536 SLOW MAC : http/tests/misc/acid3.html = IMAGE+TEXT PASS
......@@ -3661,8 +3667,6 @@ BUGWK70988 SNOWLEOPARD : http/tests/navigation/navigation-interrupted-by-fragmen
BUGWK70988 SNOWLEOPARD : jquery/traversing.html = PASS TIMEOUT
BUGWK70988 MAC DEBUG SLOW : fast/frames/calculate-fixed.html = PASS
BUGWK71209 LINUX MAC : compositing/visibility/visibility-image-layers.html = IMAGE
BUGWK71211 GPU LINUX DEBUG : fast/canvas/shadow-offset-3.html = PASS CRASH
BUGWK71214 LEOPARD CPU-CG : css2.1/20110323/block-non-replaced-width-008.htm = FAIL
......
2012-01-03 Shawn Singh <shawnsingh@chromium.org>
[chromium] Push drawsContent and contentsVisible into accelerated compositor
https://bugs.webkit.org/show_bug.cgi?id=71209
Reviewed by James Robinson.
Tests: compositing/visibility/visibility-simple-canvas2d-layer.html
compositing/visibility/visibility-simple-video-layer.html
compositing/visibility/visibility-simple-webgl-layer.html
Rebaselined compositing/visibility/visibility-image-layers.html
The CSS visibility property was not being properly obeyed by many
specialized layer types in the accelerated compositor. The root of
the problem was that drawsContent and contentsVisible flags were
not properly propagated into the compositor. This patch removes
the drawsContent() callback, and instead makes sure that
drawsContent and contentsVisible are "pushed" through the
accelerated compositor.
* platform/graphics/chromium/Canvas2DLayerChromium.cpp:
(WebCore::Canvas2DLayerChromium::drawsContent):
* platform/graphics/chromium/ContentLayerChromium.cpp:
* platform/graphics/chromium/ContentLayerChromium.h:
* platform/graphics/chromium/GraphicsLayerChromium.cpp:
(WebCore::GraphicsLayerChromium::setDrawsContent):
(WebCore::GraphicsLayerChromium::setContentsVisible):
(WebCore::GraphicsLayerChromium::setContentsToImage):
(WebCore::GraphicsLayerChromium::setContentsToCanvas):
(WebCore::GraphicsLayerChromium::setContentsToMedia):
(WebCore::GraphicsLayerChromium::updateLayerIsDrawable):
(WebCore::GraphicsLayerChromium::setupContentsLayer):
* platform/graphics/chromium/GraphicsLayerChromium.h:
* platform/graphics/chromium/LayerChromium.cpp:
(WebCore::LayerChromium::LayerChromium):
(WebCore::LayerChromium::setIsDrawable):
* platform/graphics/chromium/LayerChromium.h:
(WebCore::LayerChromium::drawsContent):
* platform/graphics/chromium/PluginLayerChromium.h:
* platform/graphics/chromium/TiledLayerChromium.cpp:
(WebCore::TiledLayerChromium::drawsContent):
* platform/graphics/chromium/VideoLayerChromium.h:
* platform/graphics/chromium/WebGLLayerChromium.cpp:
(WebCore::WebGLLayerChromium::drawsContent):
* platform/graphics/chromium/cc/CCLayerImpl.cpp:
(WebCore::CCLayerImpl::dumpLayerProperties):
2012-01-03 Shawn Singh <shawnsingh@chromium.org>
[chromium] Make sure root damage rect gets passed to renderer
......@@ -83,7 +83,7 @@ void Canvas2DLayerChromium::contentChanged()
bool Canvas2DLayerChromium::drawsContent() const
{
return m_backTextureId && !m_size.isEmpty()
return LayerChromium::drawsContent() && m_backTextureId && !m_size.isEmpty()
&& m_context && (m_context->getExtensions()->getGraphicsResetStatusARB() == GraphicsContext3D::NO_ERROR);
}
......
......@@ -122,11 +122,6 @@ void ContentLayerChromium::idlePaintContentsIfDirty()
setNeedsCommit();
}
bool ContentLayerChromium::drawsContent() const
{
return m_delegate && m_delegate->drawsContent() && TiledLayerChromium::drawsContent();
}
void ContentLayerChromium::createTextureUpdater(const CCLayerTreeHost* host)
{
#if USE(SKIA)
......
......@@ -57,7 +57,6 @@ protected:
private:
virtual void cleanupResources();
virtual bool drawsContent() const;
virtual void createTextureUpdater(const CCLayerTreeHost*);
virtual LayerTextureUpdater* textureUpdater() const { return m_textureUpdater.get(); }
......
......@@ -218,11 +218,24 @@ void GraphicsLayerChromium::setMasksToBounds(bool masksToBounds)
void GraphicsLayerChromium::setDrawsContent(bool drawsContent)
{
// Note carefully this early-exit is only correct because we also properly initialize
// LayerChromium::isDrawable() whenever m_contentsLayer is set to a new layer in setupContentsLayer().
if (drawsContent == m_drawsContent)
return;
GraphicsLayer::setDrawsContent(drawsContent);
updateLayerDrawsContent();
updateLayerIsDrawable();
}
void GraphicsLayerChromium::setContentsVisible(bool contentsVisible)
{
// Note carefully this early-exit is only correct because we also properly initialize
// LayerChromium::isDrawable() whenever m_contentsLayer is set to a new layer in setupContentsLayer().
if (contentsVisible == m_contentsVisible)
return;
GraphicsLayer::setContentsVisible(contentsVisible);
updateLayerIsDrawable();
}
void GraphicsLayerChromium::setBackgroundColor(const Color& color)
......@@ -316,7 +329,6 @@ void GraphicsLayerChromium::setContentsToImage(Image* image)
if (!m_contentsLayer.get() || m_contentsLayerPurpose != ContentsLayerForImage) {
RefPtr<ImageLayerChromium> imageLayer = ImageLayerChromium::create(this);
setupContentsLayer(imageLayer.get());
m_contentsLayer = imageLayer;
m_contentsLayerPurpose = ContentsLayerForImage;
childrenChanged = true;
}
......@@ -344,7 +356,6 @@ void GraphicsLayerChromium::setContentsToCanvas(PlatformLayer* platformLayer)
platformLayer->setDelegate(this);
if (m_contentsLayer.get() != platformLayer) {
setupContentsLayer(platformLayer);
m_contentsLayer = platformLayer;
m_contentsLayerPurpose = ContentsLayerForCanvas;
childrenChanged = true;
}
......@@ -369,7 +380,6 @@ void GraphicsLayerChromium::setContentsToMedia(PlatformLayer* layer)
if (layer) {
if (!m_contentsLayer.get() || m_contentsLayerPurpose != ContentsLayerForVideo) {
setupContentsLayer(layer);
m_contentsLayer = layer;
m_contentsLayerPurpose = ContentsLayerForVideo;
childrenChanged = true;
}
......@@ -568,8 +578,18 @@ void GraphicsLayerChromium::updateLayerPreserves3D()
updateNames();
}
void GraphicsLayerChromium::updateLayerDrawsContent()
void GraphicsLayerChromium::updateLayerIsDrawable()
{
// For the rest of the accelerated compositor code, there is no reason to make a
// distinction between drawsContent and contentsVisible. So, for m_layer, these two
// flags are combined here. m_contentsLayer shouldn't receive the drawsContent flag
// so it is only given contentsVisible.
m_layer->setIsDrawable(m_drawsContent && m_contentsVisible);
if (m_contentsLayer)
m_contentsLayer->setIsDrawable(m_contentsVisible);
if (m_drawsContent)
m_layer->setNeedsDisplay();
......@@ -626,12 +646,14 @@ void GraphicsLayerChromium::setupContentsLayer(LayerChromium* contentsLayer)
m_contentsLayer->setAnchorPoint(FloatPoint(0, 0));
// It is necessary to update setIsDrawable as soon as we receive the new contentsLayer, for
// the correctness of early exit conditions in setDrawsContent() and setContentsVisible().
m_contentsLayer->setIsDrawable(m_contentsVisible);
// Insert the content layer first. Video elements require this, because they have
// shadow content that must display in front of the video.
m_layer->insertChild(m_contentsLayer.get(), 0);
updateContentsRect();
if (showDebugBorders()) {
m_contentsLayer->setDebugBorderColor(Color(0, 0, 128, 180));
m_contentsLayer->setDebugBorderWidth(1);
......@@ -655,11 +677,6 @@ void GraphicsLayerChromium::deviceOrPageScaleFactorChanged()
m_layer->pageScaleChanged();
}
bool GraphicsLayerChromium::drawsContent() const
{
return GraphicsLayer::drawsContent();
}
void GraphicsLayerChromium::paintContents(GraphicsContext& context, const IntRect& clip)
{
paintGraphicsLayerContents(context, clip);
......
......@@ -68,6 +68,7 @@ public:
virtual void setPreserves3D(bool);
virtual void setMasksToBounds(bool);
virtual void setDrawsContent(bool);
virtual void setContentsVisible(bool);
virtual void setMaskLayer(GraphicsLayer*);
virtual void setBackgroundColor(const Color&);
......@@ -97,7 +98,6 @@ public:
virtual void deviceOrPageScaleFactorChanged();
// The following functions implement the CCLayerDelegate interface.
virtual bool drawsContent() const;
virtual void paintContents(GraphicsContext&, const IntRect& clip);
// Exposed for tests.
......@@ -117,7 +117,7 @@ private:
void updateChildrenTransform();
void updateMasksToBounds();
void updateLayerPreserves3D();
void updateLayerDrawsContent();
void updateLayerIsDrawable();
void updateLayerBackgroundColor();
void updateContentsImage();
......
......@@ -65,6 +65,7 @@ LayerChromium::LayerChromium(CCLayerDelegate* delegate)
, m_debugBorderWidth(0)
, m_opacity(1.0)
, m_anchorPointZ(0)
, m_isDrawable(false)
, m_masksToBounds(false)
, m_opaque(false)
, m_doubleSided(true)
......@@ -380,6 +381,15 @@ void LayerChromium::setDoubleSided(bool doubleSided)
setNeedsCommit();
}
void LayerChromium::setIsDrawable(bool isDrawable)
{
if (m_isDrawable == isDrawable)
return;
m_isDrawable = isDrawable;
setNeedsCommit();
}
LayerChromium* LayerChromium::parent() const
{
return m_parent;
......
......@@ -59,7 +59,6 @@ class GraphicsContext3D;
class CCLayerDelegate {
public:
virtual ~CCLayerDelegate() { }
virtual bool drawsContent() const = 0;
virtual void paintContents(GraphicsContext&, const IntRect& clip) = 0;
};
......@@ -154,11 +153,13 @@ public:
void setDelegate(CCLayerDelegate* delegate) { m_delegate = delegate; }
void setIsDrawable(bool);
void setReplicaLayer(LayerChromium*);
LayerChromium* replicaLayer() const { return m_replicaLayer.get(); }
// These methods typically need to be overwritten by derived classes.
virtual bool drawsContent() const { return false; }
virtual bool drawsContent() const { return m_isDrawable; }
virtual void paintContentsIfDirty() { }
virtual void idlePaintContentsIfDirty() { }
virtual void updateCompositorResources(GraphicsContext3D*, CCTextureUpdater&) { }
......@@ -263,6 +264,7 @@ private:
float m_debugBorderWidth;
float m_opacity;
float m_anchorPointZ;
bool m_isDrawable;
bool m_masksToBounds;
bool m_opaque;
bool m_doubleSided;
......
......@@ -37,7 +37,6 @@ namespace WebCore {
class PluginLayerChromium : public LayerChromium {
public:
static PassRefPtr<PluginLayerChromium> create(CCLayerDelegate* = 0);
virtual bool drawsContent() const { return true; }
virtual void updateCompositorResources(GraphicsContext3D*, CCTextureUpdater&);
virtual PassRefPtr<CCLayerImpl> createCCLayerImpl();
......
......@@ -150,7 +150,7 @@ void TiledLayerChromium::setBorderTexelOption(CCLayerTilingData::BorderTexelOpti
bool TiledLayerChromium::drawsContent() const
{
if (!m_delegate)
if (!LayerChromium::drawsContent() || !m_delegate)
return false;
if (m_tilingOption == NeverTile && m_tiler->numTiles() > 1)
......
......@@ -51,8 +51,6 @@ public:
virtual PassRefPtr<CCLayerImpl> createCCLayerImpl();
virtual bool drawsContent() const { return true; }
private:
VideoLayerChromium(CCLayerDelegate*, VideoFrameProvider*);
......
......@@ -66,7 +66,7 @@ WebGLLayerChromium::~WebGLLayerChromium()
bool WebGLLayerChromium::drawsContent() const
{
return (context() && context()->getExtensions()->getGraphicsResetStatusARB() == GraphicsContext3D::NO_ERROR);
return LayerChromium::drawsContent() && context() && (context()->getExtensions()->getGraphicsResetStatusARB() == GraphicsContext3D::NO_ERROR);
}
void WebGLLayerChromium::updateCompositorResources(GraphicsContext3D* rendererContext, CCTextureUpdater&)
......
......@@ -187,6 +187,9 @@ void CCLayerImpl::writeIndent(TextStream& ts, int indent)
void CCLayerImpl::dumpLayerProperties(TextStream& ts, int indent) const
{
writeIndent(ts, indent);
ts << "layer ID: " << m_layerId << "\n";
writeIndent(ts, indent);
ts << "bounds: " << bounds().width() << ", " << bounds().height() << "\n";
......@@ -201,6 +204,9 @@ void CCLayerImpl::dumpLayerProperties(TextStream& ts, int indent) const
ts << m_drawTransform.m21() << ", " << m_drawTransform.m22() << ", " << m_drawTransform.m23() << ", " << m_drawTransform.m24() << " // ";
ts << m_drawTransform.m31() << ", " << m_drawTransform.m32() << ", " << m_drawTransform.m33() << ", " << m_drawTransform.m34() << " // ";
ts << m_drawTransform.m41() << ", " << m_drawTransform.m42() << ", " << m_drawTransform.m43() << ", " << m_drawTransform.m44() << "\n";
writeIndent(ts, indent);
ts << "drawsContent: " << (m_drawsContent ? "yes" : "no") << "\n";
}
void sortLayers(Vector<RefPtr<CCLayerImpl> >::iterator first, Vector<RefPtr<CCLayerImpl> >::iterator end, CCLayerSorter* layerSorter)
......
2012-01-03 Shawn Singh <shawnsingh@chromium.org>
[chromium] Push drawsContent and contentsVisible into accelerated compositor
https://bugs.webkit.org/show_bug.cgi?id=71209
Reviewed by James Robinson.
* src/WebContentLayerImpl.cpp:
(WebKit::WebContentLayerImpl::WebContentLayerImpl):
(WebKit::WebContentLayerImpl::setDrawsContent):
* src/WebContentLayerImpl.h:
* src/WebExternalTextureLayerImpl.cpp:
(WebKit::WebExternalTextureLayerImpl::drawsContent):
* src/WebLayerImpl.cpp:
(WebKit::WebLayerImpl::WebLayerImpl):
* src/WebLayerImpl.h:
* tests/CCLayerTreeHostTest.cpp:
(WTF::ContentLayerChromiumWithUpdateTracking::ContentLayerChromiumWithUpdateTracking):
* tests/Canvas2DLayerChromiumTest.cpp:
* tests/LayerChromiumTest.cpp:
* tests/TiledLayerChromiumTest.cpp:
(WTF::FakeTiledLayerChromium::FakeTiledLayerChromium):
2012-01-03 Shawn Singh <shawnsingh@chromium.org>
[chromium] Make sure root damage rect gets passed to renderer
......
......@@ -46,8 +46,8 @@ PassRefPtr<WebContentLayerImpl> WebContentLayerImpl::create(WebContentLayerClien
WebContentLayerImpl::WebContentLayerImpl(WebContentLayerClient* contentClient)
: ContentLayerChromium(this)
, m_contentClient(contentClient)
, m_drawsContent(true)
{
setIsDrawable(true);
}
WebContentLayerImpl::~WebContentLayerImpl()
......@@ -57,13 +57,7 @@ WebContentLayerImpl::~WebContentLayerImpl()
void WebContentLayerImpl::setDrawsContent(bool drawsContent)
{
m_drawsContent = drawsContent;
setNeedsCommit();
}
bool WebContentLayerImpl::drawsContent() const
{
return m_drawsContent;
setIsDrawable(drawsContent);
}