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

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

Issue 1584903002: Improvement handling of background and outline paint phases (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@PaintPhaseRename
Patch Set: Created 4 years, 11 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 // 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/ReplacedPainter.h" 5 #include "core/paint/ReplacedPainter.h"
6 6
7 #include "core/layout/LayoutReplaced.h" 7 #include "core/layout/LayoutReplaced.h"
8 #include "core/layout/api/SelectionState.h" 8 #include "core/layout/api/SelectionState.h"
9 #include "core/layout/svg/LayoutSVGRoot.h" 9 #include "core/layout/svg/LayoutSVGRoot.h"
10 #include "core/paint/BoxPainter.h" 10 #include "core/paint/BoxPainter.h"
(...skipping 23 matching lines...) Expand all
34 m_layoutReplaced.paintBoxDecorationBackground(paintInfo, adjustedPaintOf fset); 34 m_layoutReplaced.paintBoxDecorationBackground(paintInfo, adjustedPaintOf fset);
35 35
36 if (paintInfo.phase == PaintPhaseMask) { 36 if (paintInfo.phase == PaintPhaseMask) {
37 m_layoutReplaced.paintMask(paintInfo, adjustedPaintOffset); 37 m_layoutReplaced.paintMask(paintInfo, adjustedPaintOffset);
38 return; 38 return;
39 } 39 }
40 40
41 if (paintInfo.phase == PaintPhaseClippingMask && (!m_layoutReplaced.hasLayer () || !m_layoutReplaced.layer()->hasCompositedClippingMask())) 41 if (paintInfo.phase == PaintPhaseClippingMask && (!m_layoutReplaced.hasLayer () || !m_layoutReplaced.layer()->hasCompositedClippingMask()))
42 return; 42 return;
43 43
44 if (paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSel fOutline) { 44 if (shouldPaintSelfOutline(paintInfo.phase)) {
45 if (m_layoutReplaced.styleRef().outlineWidth()) 45 ObjectPainter(m_layoutReplaced).paintOutline(paintInfo, adjustedPaintOff set);
46 ObjectPainter(m_layoutReplaced).paintOutline(paintInfo, adjustedPain tOffset);
47 return; 46 return;
48 } 47 }
49 48
50 if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhase Selection && !m_layoutReplaced.canHaveChildren() && paintInfo.phase != PaintPhas eClippingMask) 49 if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhase Selection && !m_layoutReplaced.canHaveChildren() && paintInfo.phase != PaintPhas eClippingMask)
51 return; 50 return;
52 51
53 if (!paintInfo.shouldPaintWithinRoot(&m_layoutReplaced)) 52 if (!paintInfo.shouldPaintWithinRoot(&m_layoutReplaced))
54 return; 53 return;
55 54
56 if (paintInfo.phase == PaintPhaseSelection) 55 if (paintInfo.phase == PaintPhaseSelection)
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 LayoutRect selectionPaintingRect = m_layoutReplaced.localSelectionRect() ; 92 LayoutRect selectionPaintingRect = m_layoutReplaced.localSelectionRect() ;
94 selectionPaintingRect.moveBy(adjustedPaintOffset); 93 selectionPaintingRect.moveBy(adjustedPaintOffset);
95 IntRect selectionPaintingIntRect = pixelSnappedIntRect(selectionPainting Rect); 94 IntRect selectionPaintingIntRect = pixelSnappedIntRect(selectionPainting Rect);
96 95
97 LayoutObjectDrawingRecorder drawingRecorder(paintInfo.context, m_layoutR eplaced, DisplayItem::SelectionTint, selectionPaintingIntRect, adjustedPaintOffs et); 96 LayoutObjectDrawingRecorder drawingRecorder(paintInfo.context, m_layoutR eplaced, DisplayItem::SelectionTint, selectionPaintingIntRect, adjustedPaintOffs et);
98 paintInfo.context.fillRect(selectionPaintingIntRect, m_layoutReplaced.se lectionBackgroundColor()); 97 paintInfo.context.fillRect(selectionPaintingIntRect, m_layoutReplaced.se lectionBackgroundColor());
99 } 98 }
100 } 99 }
101 100
102 } // namespace blink 101 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/PartPainter.cpp ('k') | third_party/WebKit/Source/core/paint/SVGContainerPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698