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

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: Use rebaseline-o-matic because rebaseline-cl doesn't work on this 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/LayoutView.h" 8 #include "core/layout/LayoutView.h"
9 #include "core/paint/ClipPathClipper.h" 9 #include "core/paint/ClipPathClipper.h"
10 #include "core/paint/FilterPainter.h" 10 #include "core/paint/FilterPainter.h"
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 260
261 bool isSelfPaintingLayer = m_paintLayer.isSelfPaintingLayer(); 261 bool isSelfPaintingLayer = m_paintLayer.isSelfPaintingLayer();
262 bool isPaintingOverlayScrollbars = 262 bool isPaintingOverlayScrollbars =
263 paintFlags & PaintLayerPaintingOverlayScrollbars; 263 paintFlags & PaintLayerPaintingOverlayScrollbars;
264 bool isPaintingScrollingContent = 264 bool isPaintingScrollingContent =
265 paintFlags & PaintLayerPaintingCompositingScrollingPhase; 265 paintFlags & PaintLayerPaintingCompositingScrollingPhase;
266 bool isPaintingCompositedForeground = 266 bool isPaintingCompositedForeground =
267 paintFlags & PaintLayerPaintingCompositingForegroundPhase; 267 paintFlags & PaintLayerPaintingCompositingForegroundPhase;
268 bool isPaintingCompositedBackground = 268 bool isPaintingCompositedBackground =
269 paintFlags & PaintLayerPaintingCompositingBackgroundPhase; 269 paintFlags & PaintLayerPaintingCompositingBackgroundPhase;
270 bool isPaintingCompositedDecoration =
271 paintFlags & PaintLayerPaintingCompositingDecorationPhase;
270 bool isPaintingOverflowContents = 272 bool isPaintingOverflowContents =
271 paintFlags & PaintLayerPaintingOverflowContents; 273 paintFlags & PaintLayerPaintingOverflowContents;
272 // Outline always needs to be painted even if we have no visible content. 274 // Outline always needs to be painted even if we have no visible content.
273 // Also, the outline is painted in the background phase during composited 275 // It is painted as part of the decoration phase which paints content that
274 // scrolling. If it were painted in the foreground phase, it would move with 276 // is not scrolled and should be above scrolled content.
275 // the scrolled content. When not composited scrolling, the outline is painted
276 // in the foreground phase. Since scrolled contents are moved by paint
277 // invalidation in this case, the outline won't get 'dragged along'.
278 bool shouldPaintSelfOutline = 277 bool shouldPaintSelfOutline =
279 isSelfPaintingLayer && !isPaintingOverlayScrollbars && 278 isSelfPaintingLayer && !isPaintingOverlayScrollbars &&
280 ((isPaintingScrollingContent && isPaintingCompositedBackground) || 279 (isPaintingCompositedDecoration || !isPaintingScrollingContent) &&
281 (!isPaintingScrollingContent && isPaintingCompositedForeground)) &&
282 m_paintLayer.layoutObject()->styleRef().hasOutline(); 280 m_paintLayer.layoutObject()->styleRef().hasOutline();
281
283 bool shouldPaintContent = m_paintLayer.hasVisibleContent() && 282 bool shouldPaintContent = m_paintLayer.hasVisibleContent() &&
284 isSelfPaintingLayer && !isPaintingOverlayScrollbars; 283 isSelfPaintingLayer && !isPaintingOverlayScrollbars;
285 284
286 PaintResult result = FullyPainted; 285 PaintResult result = FullyPainted;
287 286
288 if (paintFlags & PaintLayerPaintingRootBackgroundOnly && 287 if (paintFlags & PaintLayerPaintingRootBackgroundOnly &&
289 !m_paintLayer.layoutObject()->isLayoutView()) 288 !m_paintLayer.layoutObject()->isLayoutView())
290 return result; 289 return result;
291 290
292 if (m_paintLayer.layoutObject()->view()->frame() && 291 if (m_paintLayer.layoutObject()->view()->frame() &&
(...skipping 805 matching lines...) Expand 10 before | Expand all | Expand 10 after
1098 1097
1099 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, 1098 PaintLayerPaintingInfo paintingInfo(&m_paintLayer,
1100 LayoutRect(enclosingIntRect(damageRect)), 1099 LayoutRect(enclosingIntRect(damageRect)),
1101 paintFlags, LayoutSize()); 1100 paintFlags, LayoutSize());
1102 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); 1101 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars);
1103 1102
1104 m_paintLayer.setContainsDirtyOverlayScrollbars(false); 1103 m_paintLayer.setContainsDirtyOverlayScrollbars(false);
1105 } 1104 }
1106 1105
1107 } // namespace blink 1106 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698