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

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

Issue 1224933002: Combine outline and focus ring code paths (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix empty focus ring on Mac Created 5 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/paint/PartPainter.cpp ('k') | Source/core/paint/SVGContainerPainter.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "config.h" 5 #include "config.h"
6 #include "core/paint/ReplacedPainter.h" 6 #include "core/paint/ReplacedPainter.h"
7 7
8 #include "core/layout/LayoutReplaced.h" 8 #include "core/layout/LayoutReplaced.h"
9 #include "core/layout/api/SelectionState.h" 9 #include "core/layout/api/SelectionState.h"
10 #include "core/paint/BoxPainter.h" 10 #include "core/paint/BoxPainter.h"
(...skipping 20 matching lines...) Expand all
31 if (paintInfo.phase == PaintPhaseMask) { 31 if (paintInfo.phase == PaintPhaseMask) {
32 m_layoutReplaced.paintMask(paintInfo, adjustedPaintOffset); 32 m_layoutReplaced.paintMask(paintInfo, adjustedPaintOffset);
33 return; 33 return;
34 } 34 }
35 35
36 if (paintInfo.phase == PaintPhaseClippingMask && (!m_layoutReplaced.hasLayer () || !m_layoutReplaced.layer()->hasCompositedClippingMask())) 36 if (paintInfo.phase == PaintPhaseClippingMask && (!m_layoutReplaced.hasLayer () || !m_layoutReplaced.layer()->hasCompositedClippingMask()))
37 return; 37 return;
38 38
39 if (paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSel fOutline) { 39 if (paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSel fOutline) {
40 if (m_layoutReplaced.styleRef().outlineWidth()) 40 if (m_layoutReplaced.styleRef().outlineWidth())
41 ObjectPainter(m_layoutReplaced).paintOutline(paintInfo, m_layoutRepl aced.visualOverflowRect(), borderRect.size(), adjustedPaintOffset); 41 ObjectPainter(m_layoutReplaced).paintOutline(paintInfo, adjustedPain tOffset);
42 return; 42 return;
43 } 43 }
44 44
45 if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhase Selection && !m_layoutReplaced.canHaveChildren() && paintInfo.phase != PaintPhas eClippingMask) 45 if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhase Selection && !m_layoutReplaced.canHaveChildren() && paintInfo.phase != PaintPhas eClippingMask)
46 return; 46 return;
47 47
48 if (!paintInfo.shouldPaintWithinRoot(&m_layoutReplaced)) 48 if (!paintInfo.shouldPaintWithinRoot(&m_layoutReplaced))
49 return; 49 return;
50 50
51 if (paintInfo.phase == PaintPhaseSelection) 51 if (paintInfo.phase == PaintPhaseSelection)
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 LayoutRect selectionPaintingRect = m_layoutReplaced.localSelectionRect() ; 88 LayoutRect selectionPaintingRect = m_layoutReplaced.localSelectionRect() ;
89 selectionPaintingRect.moveBy(adjustedPaintOffset); 89 selectionPaintingRect.moveBy(adjustedPaintOffset);
90 IntRect selectionPaintingIntRect = pixelSnappedIntRect(selectionPainting Rect); 90 IntRect selectionPaintingIntRect = pixelSnappedIntRect(selectionPainting Rect);
91 91
92 LayoutObjectDrawingRecorder drawingRecorder(*paintInfo.context, m_layout Replaced, DisplayItem::SelectionTint, selectionPaintingIntRect); 92 LayoutObjectDrawingRecorder drawingRecorder(*paintInfo.context, m_layout Replaced, DisplayItem::SelectionTint, selectionPaintingIntRect);
93 paintInfo.context->fillRect(selectionPaintingIntRect, m_layoutReplaced.s electionBackgroundColor()); 93 paintInfo.context->fillRect(selectionPaintingIntRect, m_layoutReplaced.s electionBackgroundColor());
94 } 94 }
95 } 95 }
96 96
97 } // namespace blink 97 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/paint/PartPainter.cpp ('k') | Source/core/paint/SVGContainerPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698