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

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

Issue 1363613002: Save previous paint offset in LayoutObject (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: No union (many compilers don't allow constructors); Fix a typo perhaps caused by switching to combiā€¦ Created 5 years, 2 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/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/LayoutInline.h" 9 #include "core/layout/LayoutInline.h"
10 #include "core/layout/api/LineLayoutBoxModel.h" 10 #include "core/layout/api/LineLayoutBoxModel.h"
11 #include "core/layout/line/InlineFlowBox.h" 11 #include "core/layout/line/InlineFlowBox.h"
12 #include "core/layout/line/LineBoxList.h" 12 #include "core/layout/line/LineBoxList.h"
13 #include "core/layout/line/RootInlineBox.h" 13 #include "core/layout/line/RootInlineBox.h"
14 #include "core/paint/InlinePainter.h" 14 #include "core/paint/InlinePainter.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/graphics/paint/DisplayItemList.h"
17 18
18 namespace blink { 19 namespace blink {
19 20
20 static void addPDFURLRectsForInlineChildrenRecursively(LayoutObject* layoutObjec t, const PaintInfo& paintInfo, const LayoutPoint& paintOffset) 21 static void addPDFURLRectsForInlineChildrenRecursively(LayoutObject* layoutObjec t, const PaintInfo& paintInfo, const LayoutPoint& paintOffset)
21 { 22 {
22 for (LayoutObject* child = layoutObject->slowFirstChild(); child; child = ch ild->nextSibling()) { 23 for (LayoutObject* child = layoutObject->slowFirstChild(); child; child = ch ild->nextSibling()) {
23 if (!child->isLayoutInline() || toLayoutBoxModelObject(child)->hasSelfPa intingLayer()) 24 if (!child->isLayoutInline() || toLayoutBoxModelObject(child)->hasSelfPa intingLayer())
24 continue; 25 continue;
25 ObjectPainter(*child).addPDFURLRectIfNeeded(paintInfo, paintOffset); 26 ObjectPainter(*child).addPDFURLRectIfNeeded(paintInfo, paintOffset);
26 addPDFURLRectsForInlineChildrenRecursively(child, paintInfo, paintOffset ); 27 addPDFURLRectsForInlineChildrenRecursively(child, paintInfo, paintOffset );
(...skipping 28 matching lines...) Expand all
55 // them. Note that boxes can easily overlap, so we can't make any assumption s 56 // them. Note that boxes can easily overlap, so we can't make any assumption s
56 // based off positions of our first line box or our last line box. 57 // based off positions of our first line box or our last line box.
57 for (InlineFlowBox* curr = m_lineBoxList.firstLineBox(); curr; curr = curr-> nextLineBox()) { 58 for (InlineFlowBox* curr = m_lineBoxList.firstLineBox(); curr; curr = curr-> nextLineBox()) {
58 if (m_lineBoxList.lineIntersectsDirtyRect(LineLayoutBoxModel(layoutObjec t), curr, info, paintOffset)) { 59 if (m_lineBoxList.lineIntersectsDirtyRect(LineLayoutBoxModel(layoutObjec t), curr, info, paintOffset)) {
59 RootInlineBox& root = curr->root(); 60 RootInlineBox& root = curr->root();
60 curr->paint(info, paintOffset, root.lineTop(), root.lineBottom()); 61 curr->paint(info, paintOffset, root.lineTop(), root.lineBottom());
61 } 62 }
62 } 63 }
63 } 64 }
64 65
66 static void invalidateLineBoxPaintOffsetsInternal(DisplayItemList* displayItemLi st, InlineFlowBox* inlineBox)
67 {
68 displayItemList->invalidatePaintOffset(*inlineBox);
69 for (InlineBox* child = inlineBox->firstChild(); child; child = child->nextO nLine()) {
70 if (!child->lineLayoutItem().isText() && child->boxModelObject().hasSelf PaintingLayer())
71 continue;
72 if (child->isInlineFlowBox())
73 invalidateLineBoxPaintOffsetsInternal(displayItemList, toInlineFlowB ox(child));
74 else
75 displayItemList->invalidatePaintOffset(*child);
76 }
77 }
78
79 void LineBoxListPainter::invalidateLineBoxPaintOffsets(const PaintInfo& paintInf o) const
80 {
81 DisplayItemList* displayItemList = paintInfo.context->displayItemList();
82 for (InlineFlowBox* curr = m_lineBoxList.firstLineBox(); curr; curr = curr-> nextLineBox())
83 invalidateLineBoxPaintOffsetsInternal(displayItemList, curr);
84 }
85
65 } // namespace blink 86 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698