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

Side by Side Diff: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp

Issue 2144413002: Fix invalidation under scroll, and cull rect testing, of flipped-block writing mode elements. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: none Created 4 years, 5 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 997 matching lines...) Expand 10 before | Expand all | Expand 10 after
1008 DoubleSize scrollingContentsOffset(overflowClipRect.location().x() - adjuste dScrollOffset.width(), overflowClipRect.location().y() - adjustedScrollOffset.he ight()); 1008 DoubleSize scrollingContentsOffset(overflowClipRect.location().x() - adjuste dScrollOffset.width(), overflowClipRect.location().y() - adjustedScrollOffset.he ight());
1009 // The scroll offset change is compared using floating point so that fractio nal scroll offset 1009 // The scroll offset change is compared using floating point so that fractio nal scroll offset
1010 // change can be propagated to compositor. 1010 // change can be propagated to compositor.
1011 if (scrollingContentsOffset != m_scrollingContentsOffset || scrollSize != m_ scrollingContentsLayer->size()) { 1011 if (scrollingContentsOffset != m_scrollingContentsOffset || scrollSize != m_ scrollingContentsLayer->size()) {
1012 bool coordinatorHandlesOffset = compositor()->scrollingLayerDidChange(&m _owningLayer); 1012 bool coordinatorHandlesOffset = compositor()->scrollingLayerDidChange(&m _owningLayer);
1013 m_scrollingContentsLayer->setPosition(coordinatorHandlesOffset ? FloatPo int() : FloatPoint(-toFloatSize(adjustedScrollOffset))); 1013 m_scrollingContentsLayer->setPosition(coordinatorHandlesOffset ? FloatPo int() : FloatPoint(-toFloatSize(adjustedScrollOffset)));
1014 } 1014 }
1015 m_scrollingContentsOffset = scrollingContentsOffset; 1015 m_scrollingContentsOffset = scrollingContentsOffset;
1016 1016
1017 m_scrollingContentsLayer->setSize(FloatSize(scrollSize)); 1017 m_scrollingContentsLayer->setSize(FloatSize(scrollSize));
1018 m_scrollingContentsLayer->setOffsetDoubleFromLayoutObject(toIntSize(overflow ClipRect.location()), GraphicsLayer::DontSetNeedsDisplay); 1018
1019 IntPoint scrollingContentsLayerOffsetFromLayoutObject;
1020 if (PaintLayerScrollableArea* scrollableArea = m_owningLayer.getScrollableAr ea()) {
1021 scrollingContentsLayerOffsetFromLayoutObject = -scrollableArea->scrollOr igin();
1022 }
1023 scrollingContentsLayerOffsetFromLayoutObject.moveBy(overflowClipRect.locatio n());
1024
1025 m_scrollingContentsLayer->setOffsetDoubleFromLayoutObject(toIntSize(scrollin gContentsLayerOffsetFromLayoutObject), GraphicsLayer::DontSetNeedsDisplay);
1019 1026
1020 if (m_foregroundLayer) { 1027 if (m_foregroundLayer) {
1021 if (m_foregroundLayer->size() != m_scrollingContentsLayer->size()) 1028 if (m_foregroundLayer->size() != m_scrollingContentsLayer->size())
1022 m_foregroundLayer->setSize(m_scrollingContentsLayer->size()); 1029 m_foregroundLayer->setSize(m_scrollingContentsLayer->size());
1023 m_foregroundLayer->setNeedsDisplay(); 1030 m_foregroundLayer->setNeedsDisplay();
1024 m_foregroundLayer->setOffsetFromLayoutObject(m_scrollingContentsLayer->o ffsetFromLayoutObject()); 1031 m_foregroundLayer->setOffsetFromLayoutObject(m_scrollingContentsLayer->o ffsetFromLayoutObject());
1025 } 1032 }
1026 } 1033 }
1027 1034
1028 void CompositedLayerMapping::updateChildClippingMaskLayerGeometry() 1035 void CompositedLayerMapping::updateChildClippingMaskLayerGeometry()
(...skipping 1357 matching lines...) Expand 10 before | Expand all | Expand 10 after
2386 } 2393 }
2387 2394
2388 bool CompositedLayerMapping::needsRepaint(const GraphicsLayer& graphicsLayer) co nst 2395 bool CompositedLayerMapping::needsRepaint(const GraphicsLayer& graphicsLayer) co nst
2389 { 2396 {
2390 return isScrollableAreaLayer(&graphicsLayer) ? true : m_owningLayer.needsRep aint(); 2397 return isScrollableAreaLayer(&graphicsLayer) ? true : m_owningLayer.needsRep aint();
2391 } 2398 }
2392 2399
2393 void CompositedLayerMapping::adjustForCompositedScrolling(const GraphicsLayer* g raphicsLayer, IntSize& offset) const 2400 void CompositedLayerMapping::adjustForCompositedScrolling(const GraphicsLayer* g raphicsLayer, IntSize& offset) const
2394 { 2401 {
2395 if (graphicsLayer == m_scrollingContentsLayer.get() || graphicsLayer == m_fo regroundLayer.get()) { 2402 if (graphicsLayer == m_scrollingContentsLayer.get() || graphicsLayer == m_fo regroundLayer.get()) {
2396 if (m_owningLayer.getScrollableArea()) { 2403 if (PaintLayerScrollableArea* scrollableArea = m_owningLayer.getScrollab leArea()) {
2397 DoubleSize adjustedScrollOffset = m_owningLayer.getScrollableArea()- >adjustedScrollOffset(); 2404 // Note: this is just the scroll offset, *not* the "adjusted scroll offset". Scroll offset
2398 offset.expand(-adjustedScrollOffset.width(), -adjustedScrollOffset.h eight()); 2405 // does not include the origin adjustment. That is instead baked alr eady into offsetFromLayoutObject.
2406 DoubleSize scrollOffset = scrollableArea->scrollOffset();
2407 offset.expand(-scrollOffset.width(), -scrollOffset.height());
2399 } 2408 }
2400 } 2409 }
2401 } 2410 }
2402 2411
2403 void CompositedLayerMapping::paintContents(const GraphicsLayer* graphicsLayer, G raphicsContext& context, 2412 void CompositedLayerMapping::paintContents(const GraphicsLayer* graphicsLayer, G raphicsContext& context,
2404 GraphicsLayerPaintingPhase graphicsLayerPaintingPhase, const IntRect& intere stRect) const 2413 GraphicsLayerPaintingPhase graphicsLayerPaintingPhase, const IntRect& intere stRect) const
2405 { 2414 {
2406 // https://code.google.com/p/chromium/issues/detail?id=343772 2415 // https://code.google.com/p/chromium/issues/detail?id=343772
2407 DisableCompositingQueryAsserts disabler; 2416 DisableCompositingQueryAsserts disabler;
2408 // Allow throttling to make sure no painting paths (e.g., 2417 // Allow throttling to make sure no painting paths (e.g.,
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
2666 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { 2675 } else if (graphicsLayer == m_scrollingContentsLayer.get()) {
2667 name = "Scrolling Contents Layer"; 2676 name = "Scrolling Contents Layer";
2668 } else { 2677 } else {
2669 ASSERT_NOT_REACHED(); 2678 ASSERT_NOT_REACHED();
2670 } 2679 }
2671 2680
2672 return name; 2681 return name;
2673 } 2682 }
2674 2683
2675 } // namespace blink 2684 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutObject.cpp ('k') | third_party/WebKit/Source/core/paint/BlockPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698