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

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

Issue 1164553003: [SP] Pass correct cull rect to fix horizontal box shadow painting at tile edge. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Merge changes. Created 5 years, 6 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 "config.h" 5 #include "config.h"
6 #include "core/paint/InlineFlowBoxPainter.h" 6 #include "core/paint/InlineFlowBoxPainter.h"
7 7
8 #include "core/layout/LayoutBlock.h" 8 #include "core/layout/LayoutBlock.h"
9 #include "core/layout/LayoutInline.h" 9 #include "core/layout/LayoutInline.h"
10 #include "core/layout/LayoutView.h" 10 #include "core/layout/LayoutView.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 paintInfo.outlineObjects()->add(&inlineFlow); 60 paintInfo.outlineObjects()->add(&inlineFlow);
61 } 61 }
62 } 62 }
63 } else if (paintInfo.phase == PaintPhaseMask) { 63 } else if (paintInfo.phase == PaintPhaseMask) {
64 DrawingRecorder recorder(*paintInfo.context, m_inlineFlowBox, DisplayIte m::paintPhaseToDrawingType(paintInfo.phase), pixelSnappedIntRect(overflowRect)); 64 DrawingRecorder recorder(*paintInfo.context, m_inlineFlowBox, DisplayIte m::paintPhaseToDrawingType(paintInfo.phase), pixelSnappedIntRect(overflowRect));
65 if (!recorder.canUseCachedDrawing()) 65 if (!recorder.canUseCachedDrawing())
66 paintMask(paintInfo, paintOffset); 66 paintMask(paintInfo, paintOffset);
67 return; 67 return;
68 } else if (paintInfo.phase == PaintPhaseForeground) { 68 } else if (paintInfo.phase == PaintPhaseForeground) {
69 // Paint our background, border and box-shadow. 69 // Paint our background, border and box-shadow.
70 paintBoxDecorationBackground(paintInfo, paintOffset); 70 paintBoxDecorationBackground(paintInfo, paintOffset, overflowRect);
71 } 71 }
72 72
73 // Paint our children. 73 // Paint our children.
74 if (paintInfo.phase != PaintPhaseSelfOutline) { 74 if (paintInfo.phase != PaintPhaseSelfOutline) {
75 PaintInfo childInfo(paintInfo); 75 PaintInfo childInfo(paintInfo);
76 childInfo.phase = paintInfo.phase == PaintPhaseChildOutlines ? PaintPhas eOutline : paintInfo.phase; 76 childInfo.phase = paintInfo.phase == PaintPhaseChildOutlines ? PaintPhas eOutline : paintInfo.phase;
77 77
78 if (childInfo.paintingRoot && childInfo.paintingRoot->isDescendantOf(&m_ inlineFlowBox.layoutObject())) 78 if (childInfo.paintingRoot && childInfo.paintingRoot->isDescendantOf(&m_ inlineFlowBox.layoutObject()))
79 childInfo.paintingRoot = 0; 79 childInfo.paintingRoot = 0;
80 else 80 else
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 if (!hasBorderImage || (!m_inlineFlowBox.prevLineBox() && !m_inlineFlowB ox.nextLineBox())) 203 if (!hasBorderImage || (!m_inlineFlowBox.prevLineBox() && !m_inlineFlowB ox.nextLineBox()))
204 return PaintBordersWithoutClip; 204 return PaintBordersWithoutClip;
205 205
206 // We have a border image that spans multiple lines. 206 // We have a border image that spans multiple lines.
207 adjustedClipRect = clipRectForNinePieceImageStrip(&m_inlineFlowBox, bord erImage, adjustedFrameRect); 207 adjustedClipRect = clipRectForNinePieceImageStrip(&m_inlineFlowBox, bord erImage, adjustedFrameRect);
208 return PaintBordersWithClip; 208 return PaintBordersWithClip;
209 } 209 }
210 return DontPaintBorders; 210 return DontPaintBorders;
211 } 211 }
212 212
213 void InlineFlowBoxPainter::paintBoxDecorationBackground(const PaintInfo& paintIn fo, const LayoutPoint& paintOffset) 213 void InlineFlowBoxPainter::paintBoxDecorationBackground(const PaintInfo& paintIn fo, const LayoutPoint& paintOffset, const LayoutRect& cullRect)
214 { 214 {
215 ASSERT(paintInfo.phase == PaintPhaseForeground); 215 ASSERT(paintInfo.phase == PaintPhaseForeground);
216 if (!paintInfo.shouldPaintWithinRoot(&m_inlineFlowBox.layoutObject()) || m_i nlineFlowBox.layoutObject().style()->visibility() != VISIBLE) 216 if (!paintInfo.shouldPaintWithinRoot(&m_inlineFlowBox.layoutObject()) || m_i nlineFlowBox.layoutObject().style()->visibility() != VISIBLE)
217 return; 217 return;
218 218
219 // You can use p::first-line to specify a background. If so, the root line b oxes for 219 // You can use p::first-line to specify a background. If so, the root line b oxes for
220 // a line may actually have to paint a background. 220 // a line may actually have to paint a background.
221 const ComputedStyle* styleToUse = m_inlineFlowBox.layoutObject().style(m_inl ineFlowBox.isFirstLineStyle()); 221 const ComputedStyle* styleToUse = m_inlineFlowBox.layoutObject().style(m_inl ineFlowBox.isFirstLineStyle());
222 bool shouldPaintBoxDecorationBackground; 222 bool shouldPaintBoxDecorationBackground;
223 if (m_inlineFlowBox.parent()) 223 if (m_inlineFlowBox.parent())
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 rect.setHeight(logicalHeight); 351 rect.setHeight(logicalHeight);
352 } else { 352 } else {
353 rect.setX(logicalTop); 353 rect.setX(logicalTop);
354 rect.setWidth(logicalHeight); 354 rect.setWidth(logicalHeight);
355 } 355 }
356 } 356 }
357 return rect; 357 return rect;
358 } 358 }
359 359
360 } // namespace blink 360 } // namespace blink
OLDNEW
« Source/core/paint/InlineFlowBoxPainter.h ('K') | « Source/core/paint/InlineFlowBoxPainter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698