Diff
Modified: trunk/Source/WebCore/ChangeLog (95364 => 95365)
--- trunk/Source/WebCore/ChangeLog 2011-09-17 04:28:36 UTC (rev 95364)
+++ trunk/Source/WebCore/ChangeLog 2011-09-17 04:39:45 UTC (rev 95365)
@@ -1,3 +1,29 @@
+2011-09-16 Shawn Singh <shawnsi...@chromium.org>
+
+ Remove m_contentsDirty from LayerChromium because it
+ is redundant with m_dirtyRect.
+ https://bugs.webkit.org/show_bug.cgi?id=68213
+
+ Reviewed by James Robinson.
+
+ Code cleanup towards unit testing.
+
+ * platform/graphics/chromium/Canvas2DLayerChromium.cpp:
+ (WebCore::Canvas2DLayerChromium::updateCompositorResources):
+ * platform/graphics/chromium/ContentLayerChromium.cpp:
+ (WebCore::ContentLayerChromium::paintContentsIfDirty):
+ * platform/graphics/chromium/ImageLayerChromium.cpp:
+ (WebCore::ImageLayerChromium::paintContentsIfDirty):
+ * platform/graphics/chromium/LayerChromium.cpp:
+ (WebCore::LayerChromium::LayerChromium):
+ (WebCore::LayerChromium::setNeedsDisplay):
+ (WebCore::LayerChromium::resetNeedsDisplay):
+ * platform/graphics/chromium/LayerChromium.h:
+ * platform/graphics/chromium/VideoLayerChromium.cpp:
+ (WebCore::VideoLayerChromium::updateCompositorResources):
+ * platform/graphics/chromium/WebGLLayerChromium.cpp:
+ (WebCore::WebGLLayerChromium::updateCompositorResources):
+
2011-09-16 Dmitry Lomov <dslo...@google.com>
https://bugs.webkit.org/show_bug.cgi?id=66714
Modified: trunk/Source/WebCore/platform/graphics/chromium/Canvas2DLayerChromium.cpp (95364 => 95365)
--- trunk/Source/WebCore/platform/graphics/chromium/Canvas2DLayerChromium.cpp 2011-09-17 04:28:36 UTC (rev 95364)
+++ trunk/Source/WebCore/platform/graphics/chromium/Canvas2DLayerChromium.cpp 2011-09-17 04:39:45 UTC (rev 95365)
@@ -66,22 +66,20 @@
void Canvas2DLayerChromium::updateCompositorResources(GraphicsContext3D*)
{
- if (!m_contentsDirty || !drawsContent())
+ if (m_dirtyRect.isEmpty() || !drawsContent())
return;
- if (m_contentsDirty) {
- if (m_context) {
+ if (m_context) {
#if USE(SKIA)
- GrContext* grContext = m_context->grContext();
- if (grContext) {
- m_context->makeContextCurrent();
- grContext->flush();
- }
-#endif
- m_context->flush();
+ GrContext* grContext = m_context->grContext();
+ if (grContext) {
+ m_context->makeContextCurrent();
+ grContext->flush();
}
- m_contentsDirty = false;
+#endif
+ m_context->flush();
}
+ resetNeedsDisplay();
}
}
Modified: trunk/Source/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp (95364 => 95365)
--- trunk/Source/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp 2011-09-17 04:28:36 UTC (rev 95364)
+++ trunk/Source/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp 2011-09-17 04:39:45 UTC (rev 95365)
@@ -110,7 +110,7 @@
return;
prepareToUpdate(layerRect);
- m_dirtyRect = FloatRect();
+ resetNeedsDisplay();
}
bool ContentLayerChromium::drawsContent() const
Modified: trunk/Source/WebCore/platform/graphics/chromium/ImageLayerChromium.cpp (95364 => 95365)
--- trunk/Source/WebCore/platform/graphics/chromium/ImageLayerChromium.cpp 2011-09-17 04:28:36 UTC (rev 95364)
+++ trunk/Source/WebCore/platform/graphics/chromium/ImageLayerChromium.cpp 2011-09-17 04:39:45 UTC (rev 95365)
@@ -152,7 +152,7 @@
IntRect paintRect(IntPoint(), contentBounds());
if (!m_dirtyRect.isEmpty()) {
invalidateRect(paintRect);
- m_dirtyRect = IntRect();
+ resetNeedsDisplay();
}
}
Modified: trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp (95364 => 95365)
--- trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp 2011-09-17 04:28:36 UTC (rev 95364)
+++ trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp 2011-09-17 04:39:45 UTC (rev 95365)
@@ -58,7 +58,6 @@
LayerChromium::LayerChromium(CCLayerDelegate* delegate)
: m_delegate(delegate)
- , m_contentsDirty(false)
, m_layerId(s_nextLayerId++)
, m_parent(0)
, m_anchorPoint(0.5, 0.5)
@@ -274,8 +273,6 @@
// Simply mark the contents as dirty. For non-root layers, the call to
// setNeedsCommit will schedule a fresh compositing pass.
// For the root layer, setNeedsCommit has no effect.
- m_contentsDirty = true;
-
m_dirtyRect.unite(dirtyRect);
setNeedsCommit();
}
@@ -284,14 +281,12 @@
{
m_dirtyRect.setLocation(FloatPoint());
m_dirtyRect.setSize(bounds());
- m_contentsDirty = true;
setNeedsCommit();
}
void LayerChromium::resetNeedsDisplay()
{
m_dirtyRect = FloatRect();
- m_contentsDirty = false;
}
void LayerChromium::pushPropertiesTo(CCLayerImpl* layer)
Modified: trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.h (95364 => 95365)
--- trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.h 2011-09-17 04:28:36 UTC (rev 95364)
+++ trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.h 2011-09-17 04:39:45 UTC (rev 95365)
@@ -222,7 +222,6 @@
virtual void cleanupResources();
FloatRect m_dirtyRect;
- bool m_contentsDirty;
RefPtr<LayerChromium> m_maskLayer;
Modified: trunk/Source/WebCore/platform/graphics/chromium/VideoLayerChromium.cpp (95364 => 95365)
--- trunk/Source/WebCore/platform/graphics/chromium/VideoLayerChromium.cpp 2011-09-17 04:28:36 UTC (rev 95364)
+++ trunk/Source/WebCore/platform/graphics/chromium/VideoLayerChromium.cpp 2011-09-17 04:39:45 UTC (rev 95365)
@@ -79,7 +79,7 @@
void VideoLayerChromium::updateCompositorResources(GraphicsContext3D* context)
{
- if (!m_contentsDirty || !m_delegate)
+ if (m_dirtyRect.isEmpty() || !m_delegate)
return;
ASSERT(drawsContent());
@@ -119,8 +119,7 @@
updateTexture(context, texture, frame->data(plane));
}
- m_dirtyRect.setSize(FloatSize());
- m_contentsDirty = false;
+ resetNeedsDisplay();
m_provider->putCurrentFrame(frame);
}
Modified: trunk/Source/WebCore/platform/graphics/chromium/WebGLLayerChromium.cpp (95364 => 95365)
--- trunk/Source/WebCore/platform/graphics/chromium/WebGLLayerChromium.cpp 2011-09-17 04:28:36 UTC (rev 95364)
+++ trunk/Source/WebCore/platform/graphics/chromium/WebGLLayerChromium.cpp 2011-09-17 04:39:45 UTC (rev 95365)
@@ -70,7 +70,7 @@
if (!drawsContent())
return;
- if (!m_contentsDirty)
+ if (m_dirtyRect.isEmpty())
return;
if (m_textureChanged) {
@@ -84,13 +84,13 @@
m_textureChanged = false;
}
// Update the contents of the texture used by the compositor.
- if (m_contentsDirty && m_textureUpdated) {
+ if (!m_dirtyRect.isEmpty() && m_textureUpdated) {
// prepareTexture copies the contents of the off-screen render target into the texture
// used by the compositor.
//
m_context->prepareTexture();
m_context->markLayerComposited();
- m_contentsDirty = false;
+ resetNeedsDisplay();
m_textureUpdated = false;
}
}