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

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

Issue 1236183003: Add 'printing' flag to PaintInfo (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: PrintAdaption -> Printing; printing -> isPrinting; Comment fixups. 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
« no previous file with comments | « Source/core/paint/InlineTextBoxPainter.cpp ('k') | Source/core/paint/ObjectPainter.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/LineBoxListPainter.h" 6 #include "core/paint/LineBoxListPainter.h"
7 7
8 #include "core/layout/LayoutBoxModelObject.h" 8 #include "core/layout/LayoutBoxModelObject.h"
9 #include "core/layout/line/InlineFlowBox.h" 9 #include "core/layout/line/InlineFlowBox.h"
10 #include "core/layout/line/LineBoxList.h" 10 #include "core/layout/line/LineBoxList.h"
(...skipping 19 matching lines...) Expand all
30 // Only paint during the foreground/selection phases. 30 // Only paint during the foreground/selection phases.
31 if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhase Selection && paintInfo.phase != PaintPhaseOutline 31 if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhase Selection && paintInfo.phase != PaintPhaseOutline
32 && paintInfo.phase != PaintPhaseSelfOutline && paintInfo.phase != PaintP haseChildOutlines && paintInfo.phase != PaintPhaseTextClip 32 && paintInfo.phase != PaintPhaseSelfOutline && paintInfo.phase != PaintP haseChildOutlines && paintInfo.phase != PaintPhaseTextClip
33 && paintInfo.phase != PaintPhaseMask) 33 && paintInfo.phase != PaintPhaseMask)
34 return; 34 return;
35 35
36 ASSERT(layoutObject->isLayoutBlock() || (layoutObject->isLayoutInline() && l ayoutObject->hasLayer())); // The only way an inline could paint like this is if it has a layer. 36 ASSERT(layoutObject->isLayoutBlock() || (layoutObject->isLayoutInline() && l ayoutObject->hasLayer())); // The only way an inline could paint like this is if it has a layer.
37 37
38 // FIXME: When Skia supports annotation rect covering (https://code.google.c om/p/skia/issues/detail?id=3872), 38 // FIXME: When Skia supports annotation rect covering (https://code.google.c om/p/skia/issues/detail?id=3872),
39 // these rects may be covered line box drawings. Then we may need a dedicate d paint phase. 39 // these rects may be covered line box drawings. Then we may need a dedicate d paint phase.
40 if (paintInfo.phase == PaintPhaseForeground && paintInfo.context->printing() ) 40 if (paintInfo.phase == PaintPhaseForeground && paintInfo.isPrinting())
41 addPDFURLRectsForInlineChildrenRecursively(layoutObject, paintInfo, pain tOffset); 41 addPDFURLRectsForInlineChildrenRecursively(layoutObject, paintInfo, pain tOffset);
42 42
43 // If we have no lines then we have no work to do. 43 // If we have no lines then we have no work to do.
44 if (!m_lineBoxList.firstLineBox()) 44 if (!m_lineBoxList.firstLineBox())
45 return; 45 return;
46 46
47 if (!m_lineBoxList.anyLineIntersectsRect(layoutObject, LayoutRect(paintInfo. rect), paintOffset)) 47 if (!m_lineBoxList.anyLineIntersectsRect(layoutObject, LayoutRect(paintInfo. rect), paintOffset))
48 return; 48 return;
49 49
50 PaintInfo info(paintInfo); 50 PaintInfo info(paintInfo);
(...skipping 11 matching lines...) Expand all
62 } 62 }
63 63
64 if (info.phase == PaintPhaseOutline || info.phase == PaintPhaseSelfOutline | | info.phase == PaintPhaseChildOutlines) { 64 if (info.phase == PaintPhaseOutline || info.phase == PaintPhaseSelfOutline | | info.phase == PaintPhaseChildOutlines) {
65 for (LayoutInline* flow : *info.outlineObjects()) 65 for (LayoutInline* flow : *info.outlineObjects())
66 InlinePainter(*flow).paintOutline(info, paintOffset); 66 InlinePainter(*flow).paintOutline(info, paintOffset);
67 info.outlineObjects()->clear(); 67 info.outlineObjects()->clear();
68 } 68 }
69 } 69 }
70 70
71 } // namespace blink 71 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/paint/InlineTextBoxPainter.cpp ('k') | Source/core/paint/ObjectPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698