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

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

Issue 2439113003: Fix the bug that negative outline-offset is covered up by composited (Closed)
Patch Set: Update decoration layer existing condition Created 4 years, 1 month 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/PaintLayerPainter.h" 5 #include "core/paint/PaintLayerPainter.h"
6 6
7 #include "core/frame/LocalFrame.h" 7 #include "core/frame/LocalFrame.h"
8 #include "core/layout/LayoutInline.h" 8 #include "core/layout/LayoutInline.h"
9 #include "core/layout/LayoutView.h" 9 #include "core/layout/LayoutView.h"
10 #include "core/paint/ClipPathClipper.h" 10 #include "core/paint/ClipPathClipper.h"
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 239
240 bool isSelfPaintingLayer = m_paintLayer.isSelfPaintingLayer(); 240 bool isSelfPaintingLayer = m_paintLayer.isSelfPaintingLayer();
241 bool isPaintingOverlayScrollbars = 241 bool isPaintingOverlayScrollbars =
242 paintFlags & PaintLayerPaintingOverlayScrollbars; 242 paintFlags & PaintLayerPaintingOverlayScrollbars;
243 bool isPaintingScrollingContent = 243 bool isPaintingScrollingContent =
244 paintFlags & PaintLayerPaintingCompositingScrollingPhase; 244 paintFlags & PaintLayerPaintingCompositingScrollingPhase;
245 bool isPaintingCompositedForeground = 245 bool isPaintingCompositedForeground =
246 paintFlags & PaintLayerPaintingCompositingForegroundPhase; 246 paintFlags & PaintLayerPaintingCompositingForegroundPhase;
247 bool isPaintingCompositedBackground = 247 bool isPaintingCompositedBackground =
248 paintFlags & PaintLayerPaintingCompositingBackgroundPhase; 248 paintFlags & PaintLayerPaintingCompositingBackgroundPhase;
249 bool isPaintingCompositedDecoration =
250 paintFlags & PaintLayerPaintingCompositingDecorationPhase;
249 bool isPaintingOverflowContents = 251 bool isPaintingOverflowContents =
250 paintFlags & PaintLayerPaintingOverflowContents; 252 paintFlags & PaintLayerPaintingOverflowContents;
251 // Outline always needs to be painted even if we have no visible content. 253 // Outline always needs to be painted even if we have no visible content.
252 // Also, the outline is painted in the background phase during composited 254 // It used to be painted in either the foreground phase or the background
flackr 2016/10/25 21:26:30 No need to mention where it used to be painted, we
yigu 2016/10/27 20:21:26 Done.
253 // scrolling. If it were painted in the foreground phase, it would move with 255 // phase. Now it is painted in the decoration phase.
254 // the scrolled content. When not composited scrolling, the outline is painted
255 // in the foreground phase. Since scrolled contents are moved by paint
256 // invalidation in this case, the outline won't get 'dragged along'.
257 bool shouldPaintSelfOutline = 256 bool shouldPaintSelfOutline =
258 isSelfPaintingLayer && !isPaintingOverlayScrollbars && 257 isSelfPaintingLayer && !isPaintingOverlayScrollbars &&
259 ((isPaintingScrollingContent && isPaintingCompositedBackground) || 258 (isPaintingCompositedDecoration || !isPaintingScrollingContent) &&
260 (!isPaintingScrollingContent && isPaintingCompositedForeground)) &&
261 m_paintLayer.layoutObject()->styleRef().hasOutline(); 259 m_paintLayer.layoutObject()->styleRef().hasOutline();
260
262 bool shouldPaintContent = m_paintLayer.hasVisibleContent() && 261 bool shouldPaintContent = m_paintLayer.hasVisibleContent() &&
263 isSelfPaintingLayer && !isPaintingOverlayScrollbars; 262 isSelfPaintingLayer && !isPaintingOverlayScrollbars;
264 263
265 PaintResult result = FullyPainted; 264 PaintResult result = FullyPainted;
266 265
267 if (paintFlags & PaintLayerPaintingRootBackgroundOnly && 266 if (paintFlags & PaintLayerPaintingRootBackgroundOnly &&
268 !m_paintLayer.layoutObject()->isLayoutView()) 267 !m_paintLayer.layoutObject()->isLayoutView())
269 return result; 268 return result;
270 269
271 if (m_paintLayer.layoutObject()->view()->frame() && 270 if (m_paintLayer.layoutObject()->view()->frame() &&
(...skipping 799 matching lines...) Expand 10 before | Expand all | Expand 10 after
1071 1070
1072 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, 1071 PaintLayerPaintingInfo paintingInfo(&m_paintLayer,
1073 LayoutRect(enclosingIntRect(damageRect)), 1072 LayoutRect(enclosingIntRect(damageRect)),
1074 paintFlags, LayoutSize()); 1073 paintFlags, LayoutSize());
1075 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); 1074 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars);
1076 1075
1077 m_paintLayer.setContainsDirtyOverlayScrollbars(false); 1076 m_paintLayer.setContainsDirtyOverlayScrollbars(false);
1078 } 1077 }
1079 1078
1080 } // namespace blink 1079 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698