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

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

Issue 1236183003: Add 'printing' flag to PaintInfo (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Move flag to PaintInfo. Created 5 years, 5 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
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/InlinePainter.h" 6 #include "core/paint/InlinePainter.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/LayoutTheme.h" 10 #include "core/layout/LayoutTheme.h"
11 #include "core/layout/line/RootInlineBox.h" 11 #include "core/layout/line/RootInlineBox.h"
12 #include "core/paint/BoxPainter.h" 12 #include "core/paint/BoxPainter.h"
13 #include "core/paint/LayoutObjectDrawingRecorder.h" 13 #include "core/paint/LayoutObjectDrawingRecorder.h"
14 #include "core/paint/LineBoxListPainter.h" 14 #include "core/paint/LineBoxListPainter.h"
15 #include "core/paint/ObjectPainter.h" 15 #include "core/paint/ObjectPainter.h"
16 #include "core/paint/PaintInfo.h" 16 #include "core/paint/PaintInfo.h"
17 #include "platform/geometry/LayoutPoint.h" 17 #include "platform/geometry/LayoutPoint.h"
18 #include <limits> 18 #include <limits>
19 19
20 namespace blink { 20 namespace blink {
21 21
22 void InlinePainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paintOf fset) 22 void InlinePainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paintOf fset)
23 { 23 {
24 // FIXME: When Skia supports annotation rect covering (https://code.google.c om/p/skia/issues/detail?id=3872), 24 // FIXME: When Skia supports annotation rect covering (https://code.google.c om/p/skia/issues/detail?id=3872),
25 // this rect may be covered by foreground and descendant drawings. Then we m ay need a dedicated paint phase. 25 // this rect may be covered by foreground and descendant drawings. Then we m ay need a dedicated paint phase.
26 if (paintInfo.phase == PaintPhaseForeground && paintInfo.context->printing() ) 26 if (paintInfo.phase == PaintPhaseForeground && paintInfo.printing())
27 ObjectPainter(m_layoutInline).addPDFURLRectIfNeeded(paintInfo, paintOffs et); 27 ObjectPainter(m_layoutInline).addPDFURLRectIfNeeded(paintInfo, paintOffs et);
28 28
29 LineBoxListPainter(*m_layoutInline.lineBoxes()).paint(&m_layoutInline, paint Info, paintOffset); 29 LineBoxListPainter(*m_layoutInline.lineBoxes()).paint(&m_layoutInline, paint Info, paintOffset);
30 } 30 }
31 31
32 LayoutRect InlinePainter::outlinePaintRect(const Vector<LayoutRect>& outlineRect s, const LayoutPoint& paintOffset) const 32 LayoutRect InlinePainter::outlinePaintRect(const Vector<LayoutRect>& outlineRect s, const LayoutPoint& paintOffset) const
33 { 33 {
34 int outlineOutset = m_layoutInline.styleRef().outlineOutset(); 34 int outlineOutset = m_layoutInline.styleRef().outlineOutset();
35 LayoutRect outlineRect; 35 LayoutRect outlineRect;
36 for (const LayoutRect& rect : outlineRects) { 36 for (const LayoutRect& rect : outlineRects) {
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 pixelSnappedBox.maxX() + outlineWidth, 216 pixelSnappedBox.maxX() + outlineWidth,
217 pixelSnappedBox.maxY() + outlineWidth, 217 pixelSnappedBox.maxY() + outlineWidth,
218 BSBottom, outlineColor, outlineStyle, 218 BSBottom, outlineColor, outlineStyle,
219 outlineWidth, 219 outlineWidth,
220 outlineWidth, 220 outlineWidth,
221 false); 221 false);
222 } 222 }
223 } 223 }
224 224
225 } // namespace blink 225 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698