Changeset 104782 in webkit
- Timestamp:
- Jan 11, 2012 7:46:47 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r104781 r104782 1 2012-01-11 Adrienne Walker <enne@google.com> 2 3 Repaint all graphics layers when their renderer offset changes 4 https://bugs.webkit.org/show_bug.cgi?id=75730 5 6 Reviewed by Simon Fraser. 7 8 * compositing/geometry/foreground-offset-change-expected.png: Added. 9 * compositing/geometry/foreground-offset-change-expected.txt: Added. 10 * compositing/geometry/foreground-offset-change.html: Added. 11 1 12 2012-01-11 Dmitry Titov <dimich@chromium.org> 2 13 -
trunk/Source/WebCore/ChangeLog
r104780 r104782 1 2012-01-11 Adrienne Walker <enne@google.com> 2 3 Repaint all graphics layers when their renderer offset changes 4 https://bugs.webkit.org/show_bug.cgi?id=75730 5 6 Reviewed by Simon Fraser. 7 8 In RenderLayerBacking, only the main graphics layer gets repainted 9 when the offset changes. If the offset on other graphics layers (e.g. 10 the foreground layer) changes, they should get repainted as well. 11 12 Test: compositing/geometry/foreground-offset-change.html 13 14 * platform/graphics/GraphicsLayer.cpp: 15 (WebCore::GraphicsLayer::setOffsetFromRenderer): 16 (WebCore::GraphicsLayer::paintGraphicsLayerContents): 17 * platform/graphics/GraphicsLayer.h: 18 * rendering/RenderLayerBacking.cpp: 19 (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry): 20 (WebCore::RenderLayerBacking::paintContents): 21 1 22 2012-01-11 Scott Violet <sky@google.com> 2 23 -
trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp
r102608 r104782 31 31 32 32 #include "FloatPoint.h" 33 #include "GraphicsContext.h" 34 #include "LayoutTypes.h" 33 35 #include "RotateTransformOperation.h" 34 36 #include "TextStream.h" … … 262 264 } 263 265 266 void GraphicsLayer::setOffsetFromRenderer(const IntSize& offset) 267 { 268 if (offset == m_offsetFromRenderer) 269 return; 270 271 m_offsetFromRenderer = offset; 272 273 // If the compositing layer offset changes, we need to repaint. 274 setNeedsDisplay(); 275 } 276 264 277 void GraphicsLayer::setBackgroundColor(const Color& color) 265 278 { … … 279 292 s_inPaintContents = true; 280 293 #endif 281 if (m_client) 282 m_client->paintContents(this, context, m_paintingPhase, clip); 294 if (m_client) { 295 LayoutSize offset = offsetFromRenderer(); 296 context.translate(-offset); 297 298 LayoutRect clipRect(clip); 299 clipRect.move(offset); 300 301 m_client->paintContents(this, context, m_paintingPhase, clipRect); 302 } 283 303 #ifndef NDEBUG 284 304 s_inPaintContents = false; -
trunk/Source/WebCore/platform/graphics/GraphicsLayer.h
r104698 r104782 259 259 // Offset is origin of the renderer minus origin of the graphics layer (so either zero or negative). 260 260 IntSize offsetFromRenderer() const { return m_offsetFromRenderer; } 261 void setOffsetFromRenderer(const IntSize& offset) { m_offsetFromRenderer = offset; }261 void setOffsetFromRenderer(const IntSize&); 262 262 263 263 // The position of the layer (the location of its top-left corner in its parent) -
trunk/Source/WebCore/rendering/RenderLayerBacking.cpp
r104698 r104782 454 454 455 455 m_graphicsLayer->setPosition(FloatPoint() + (relativeCompositingBounds.location() - graphicsLayerParentLocation)); 456 457 LayoutSize oldOffsetFromRenderer = m_graphicsLayer->offsetFromRenderer();458 456 m_graphicsLayer->setOffsetFromRenderer(localCompositingBounds.location() - LayoutPoint()); 459 460 // If the compositing layer offset changes, we need to repaint.461 if (oldOffsetFromRenderer != m_graphicsLayer->offsetFromRenderer())462 m_graphicsLayer->setNeedsDisplay();463 457 464 458 FloatSize oldSize = m_graphicsLayer->size(); … … 1235 1229 InspectorInstrumentationCookie cookie = InspectorInstrumentation::willPaint(m_owningLayer->renderer()->frame(), clip); 1236 1230 1237 LayoutSize offset = graphicsLayer->offsetFromRenderer();1238 context.translate(-offset);1239 1240 LayoutRect clipRect(clip);1241 clipRect.move(offset);1242 1243 1231 // The dirtyRect is in the coords of the painting root. 1244 1232 LayoutRect dirtyRect = compositedBounds(); 1245 dirtyRect.intersect(clip Rect);1233 dirtyRect.intersect(clip); 1246 1234 1247 1235 // We have to use the same root as for hit testing, because both methods can compute and cache clipRects.
Note: See TracChangeset
for help on using the changeset viewer.