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

Side by Side Diff: third_party/WebKit/Source/core/paint/LayerClipRecorder.cpp

Issue 2194273002: Fix border radius on composited children. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Switch to using the layer's offsetFromLayoutObject Created 4 years 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/paint/LayerClipRecorder.h" 5 #include "core/paint/LayerClipRecorder.h"
6 6
7 #include "core/layout/ClipRect.h" 7 #include "core/layout/ClipRect.h"
8 #include "core/layout/LayoutView.h" 8 #include "core/layout/LayoutView.h"
9 #include "core/paint/PaintLayer.h" 9 #include "core/paint/PaintLayer.h"
10 #include "platform/geometry/IntRect.h" 10 #include "platform/geometry/IntRect.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 ? &paintLayer 72 ? &paintLayer
73 : paintLayer.parent(); 73 : paintLayer.parent();
74 layer; layer = layer->parent()) { 74 layer; layer = layer->parent()) {
75 // Composited scrolling layers handle border-radius clip in the compositor 75 // Composited scrolling layers handle border-radius clip in the compositor
76 // via a mask layer. We do not want to apply a border-radius clip to the 76 // via a mask layer. We do not want to apply a border-radius clip to the
77 // layer contents itself, because that would require re-rastering every 77 // layer contents itself, because that would require re-rastering every
78 // frame to update the clip. We only want to make sure that the mask layer 78 // frame to update the clip. We only want to make sure that the mask layer
79 // is properly clipped so that it can in turn clip the scrolled contents in 79 // is properly clipped so that it can in turn clip the scrolled contents in
80 // the compositor. 80 // the compositor.
81 if (layer->needsCompositedScrolling() && 81 if (layer->needsCompositedScrolling() &&
82 !(paintFlags & PaintLayerPaintingChildClippingMaskPhase)) 82 !(paintFlags & PaintLayerPaintingChildClippingMaskPhase ||
83 paintFlags & PaintLayerPaintingAncestorClippingMaskPhase))
83 break; 84 break;
84 85
85 if (layer->layoutObject()->hasOverflowClip() && 86 if (layer->layoutObject()->hasOverflowClip() &&
86 layer->layoutObject()->style()->hasBorderRadius() && 87 layer->layoutObject()->style()->hasBorderRadius() &&
87 inContainingBlockChain(&paintLayer, layer)) { 88 inContainingBlockChain(&paintLayer, layer)) {
88 LayoutPoint delta(fragmentOffset); 89 LayoutPoint delta(fragmentOffset);
89 layer->convertToLayerCoords(localPaintingInfo.rootLayer, delta); 90 layer->convertToLayerCoords(localPaintingInfo.rootLayer, delta);
90 91
91 // The PaintLayer's size is pixel-snapped if it is a LayoutBox. We can't 92 // The PaintLayer's size is pixel-snapped if it is a LayoutBox. We can't
92 // use a pre-snapped border rect for clipping, since 93 // use a pre-snapped border rect for clipping, since
(...skipping 10 matching lines...) Expand all
103 break; 104 break;
104 } 105 }
105 } 106 }
106 107
107 LayerClipRecorder::~LayerClipRecorder() { 108 LayerClipRecorder::~LayerClipRecorder() {
108 m_graphicsContext.getPaintController().endItem<EndClipDisplayItem>( 109 m_graphicsContext.getPaintController().endItem<EndClipDisplayItem>(
109 m_layoutObject, DisplayItem::clipTypeToEndClipType(m_clipType)); 110 m_layoutObject, DisplayItem::clipTypeToEndClipType(m_clipType));
110 } 111 }
111 112
112 } // namespace blink 113 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698