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

Side by Side Diff: third_party/WebKit/Source/core/paint/PartPainter.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/PartPainter.h" 5 #include "core/paint/PartPainter.h"
6 6
7 #include "core/layout/LayoutPart.h" 7 #include "core/layout/LayoutPart.h"
8 #include "core/paint/BoxPainter.h" 8 #include "core/paint/BoxPainter.h"
9 #include "core/paint/LayoutObjectDrawingRecorder.h" 9 #include "core/paint/LayoutObjectDrawingRecorder.h"
10 #include "core/paint/PaintInfo.h" 10 #include "core/paint/PaintInfo.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 LayoutRect borderRect(adjustedPaintOffset, m_layoutPart.size()); 48 LayoutRect borderRect(adjustedPaintOffset, m_layoutPart.size());
49 49
50 if (m_layoutPart.hasBoxDecorationBackground() && (paintInfo.phase == PaintPh aseForeground || paintInfo.phase == PaintPhaseSelection)) 50 if (m_layoutPart.hasBoxDecorationBackground() && (paintInfo.phase == PaintPh aseForeground || paintInfo.phase == PaintPhaseSelection))
51 BoxPainter(m_layoutPart).paintBoxDecorationBackground(paintInfo, adjuste dPaintOffset); 51 BoxPainter(m_layoutPart).paintBoxDecorationBackground(paintInfo, adjuste dPaintOffset);
52 52
53 if (paintInfo.phase == PaintPhaseMask) { 53 if (paintInfo.phase == PaintPhaseMask) {
54 BoxPainter(m_layoutPart).paintMask(paintInfo, adjustedPaintOffset); 54 BoxPainter(m_layoutPart).paintMask(paintInfo, adjustedPaintOffset);
55 return; 55 return;
56 } 56 }
57 57
58 if ((paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSe lfOutline) && m_layoutPart.style()->hasOutline()) 58 if (shouldPaintSelfOutline(paintInfo.phase))
59 ObjectPainter(m_layoutPart).paintOutline(paintInfo, adjustedPaintOffset) ; 59 ObjectPainter(m_layoutPart).paintOutline(paintInfo, adjustedPaintOffset) ;
60 60
61 if (paintInfo.phase != PaintPhaseForeground) 61 if (paintInfo.phase != PaintPhaseForeground)
62 return; 62 return;
63 63
64 { 64 {
65 Optional<RoundedInnerRectClipper> clipper; 65 Optional<RoundedInnerRectClipper> clipper;
66 if (m_layoutPart.style()->hasBorderRadius()) { 66 if (m_layoutPart.style()->hasBorderRadius()) {
67 if (borderRect.isEmpty()) 67 if (borderRect.isEmpty())
68 return; 68 return;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 // When painting widgets into compositing layers, tx and ty are relative to the enclosing compositing layer, 111 // When painting widgets into compositing layers, tx and ty are relative to the enclosing compositing layer,
112 // not the root. In this case, shift the CTM and adjust the CullRect to be r oot-relative to fix plugin drawing. 112 // not the root. In this case, shift the CTM and adjust the CullRect to be r oot-relative to fix plugin drawing.
113 TransformRecorder transform(paintInfo.context, m_layoutPart, 113 TransformRecorder transform(paintInfo.context, m_layoutPart,
114 AffineTransform::translation(widgetPaintOffset.width(), widgetPaintOffse t.height())); 114 AffineTransform::translation(widgetPaintOffset.width(), widgetPaintOffse t.height()));
115 115
116 CullRect adjustedCullRect(paintInfo.cullRect(), -widgetPaintOffset); 116 CullRect adjustedCullRect(paintInfo.cullRect(), -widgetPaintOffset);
117 widget->paint(paintInfo.context, adjustedCullRect); 117 widget->paint(paintInfo.context, adjustedCullRect);
118 } 118 }
119 119
120 } // namespace blink 120 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintPhase.h ('k') | third_party/WebKit/Source/core/paint/ReplacedPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698