Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(149)

Unified Diff: Source/WebCore/platform/graphics/GraphicsLayer.cpp

Issue 9187066: Merge 104782 - Repaint all graphics layers when their renderer offset changes (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/963/
Patch Set: Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/WebCore/platform/graphics/GraphicsLayer.h ('k') | Source/WebCore/rendering/RenderLayerBacking.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/platform/graphics/GraphicsLayer.cpp
===================================================================
--- Source/WebCore/platform/graphics/GraphicsLayer.cpp (revision 104853)
+++ Source/WebCore/platform/graphics/GraphicsLayer.cpp (working copy)
@@ -30,6 +30,8 @@
#include "GraphicsLayer.h"
#include "FloatPoint.h"
+#include "GraphicsContext.h"
+#include "LayoutTypes.h"
#include "RotateTransformOperation.h"
#include "TextStream.h"
#include <wtf/text/CString.h>
@@ -260,6 +262,17 @@
m_replicaLayer = layer;
}
+void GraphicsLayer::setOffsetFromRenderer(const IntSize& offset)
+{
+ if (offset == m_offsetFromRenderer)
+ return;
+
+ m_offsetFromRenderer = offset;
+
+ // If the compositing layer offset changes, we need to repaint.
+ setNeedsDisplay();
+}
+
void GraphicsLayer::setBackgroundColor(const Color& color)
{
m_backgroundColor = color;
@@ -277,8 +290,15 @@
#ifndef NDEBUG
s_inPaintContents = true;
#endif
- if (m_client)
- m_client->paintContents(this, context, m_paintingPhase, clip);
+ if (m_client) {
+ LayoutSize offset = offsetFromRenderer();
+ context.translate(-offset);
+
+ LayoutRect clipRect(clip);
+ clipRect.move(offset);
+
+ m_client->paintContents(this, context, m_paintingPhase, clipRect);
+ }
#ifndef NDEBUG
s_inPaintContents = false;
#endif
« no previous file with comments | « Source/WebCore/platform/graphics/GraphicsLayer.h ('k') | Source/WebCore/rendering/RenderLayerBacking.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698