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

Unified Diff: Source/core/layout/compositing/CompositedLayerMapping.cpp

Issue 949303002: Fix invalidation during painting of scrollbars (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: TestExpectations Created 5 years, 10 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
Index: Source/core/layout/compositing/CompositedLayerMapping.cpp
diff --git a/Source/core/layout/compositing/CompositedLayerMapping.cpp b/Source/core/layout/compositing/CompositedLayerMapping.cpp
index 410240fa30e13f039a0ae66b4c2f259ff5b4814d..b3688a6d6326a56d23130e78f9207c0f11731da3 100644
--- a/Source/core/layout/compositing/CompositedLayerMapping.cpp
+++ b/Source/core/layout/compositing/CompositedLayerMapping.cpp
@@ -716,7 +716,7 @@ void CompositedLayerMapping::updateGraphicsLayerGeometry(const Layer* compositin
updateChildClippingMaskLayerGeometry();
if (m_owningLayer.scrollableArea() && m_owningLayer.scrollableArea()->scrollsOverflow())
- m_owningLayer.scrollableArea()->positionOverflowControls(IntSize());
+ m_owningLayer.scrollableArea()->positionOverflowControls();
if (RuntimeEnabledFeatures::cssCompositingEnabled()) {
updateLayerBlendMode(renderer()->styleRef());
@@ -1322,13 +1322,13 @@ bool CompositedLayerMapping::updateOverflowControlsLayers(bool needsHorizontalSc
return horizontalScrollbarLayerChanged || verticalScrollbarLayerChanged || scrollCornerLayerChanged;
}
-void CompositedLayerMapping::positionOverflowControlsLayers(const IntSize& offsetFromRoot)
+void CompositedLayerMapping::positionOverflowControlsLayers()
{
IntSize offsetFromRenderer = m_graphicsLayer->offsetFromRenderer() - roundedIntSize(m_owningLayer.subpixelAccumulation());
if (GraphicsLayer* layer = layerForHorizontalScrollbar()) {
Scrollbar* hBar = m_owningLayer.scrollableArea()->horizontalScrollbar();
if (hBar) {
- layer->setPosition(hBar->frameRect().location() - offsetFromRoot - offsetFromRenderer);
+ layer->setPosition(hBar->frameRect().location() - offsetFromRenderer);
layer->setSize(hBar->frameRect().size());
if (layer->hasContentsLayer())
layer->setContentsRect(IntRect(IntPoint(), hBar->frameRect().size()));
@@ -1339,7 +1339,7 @@ void CompositedLayerMapping::positionOverflowControlsLayers(const IntSize& offse
if (GraphicsLayer* layer = layerForVerticalScrollbar()) {
Scrollbar* vBar = m_owningLayer.scrollableArea()->verticalScrollbar();
if (vBar) {
- layer->setPosition(vBar->frameRect().location() - offsetFromRoot - offsetFromRenderer);
+ layer->setPosition(vBar->frameRect().location() - offsetFromRenderer);
layer->setSize(vBar->frameRect().size());
if (layer->hasContentsLayer())
layer->setContentsRect(IntRect(IntPoint(), vBar->frameRect().size()));
@@ -2163,13 +2163,11 @@ static void paintScrollbar(Scrollbar* scrollbar, GraphicsContext& context, const
if (!scrollbar)
return;
- context.save();
const IntRect& scrollbarRect = scrollbar->frameRect();
- context.translate(-scrollbarRect.x(), -scrollbarRect.y());
+ TransformRecorder transformRecorder(context, scrollbar->displayItemClient(), AffineTransform::translation(-scrollbarRect.x(), -scrollbarRect.y()));
IntRect transformedClip = clip;
transformedClip.moveBy(scrollbarRect.location());
scrollbar->paint(&context, transformedClip);
- context.restore();
}
// Up-call from compositing layer drawing callback.

Powered by Google App Engine
This is Rietveld 408576698