| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 | 184 |
| 185 return rangeIntersectsRect(renderer, logicalTop, logicalBottom, rect, offset
); | 185 return rangeIntersectsRect(renderer, logicalTop, logicalBottom, rect, offset
); |
| 186 } | 186 } |
| 187 | 187 |
| 188 bool RenderLineBoxList::lineIntersectsDirtyRect(RenderBoxModelObject* renderer,
InlineFlowBox* box, const PaintInfo& paintInfo, const LayoutPoint& offset) const | 188 bool RenderLineBoxList::lineIntersectsDirtyRect(RenderBoxModelObject* renderer,
InlineFlowBox* box, const PaintInfo& paintInfo, const LayoutPoint& offset) const |
| 189 { | 189 { |
| 190 RootInlineBox* root = box->root(); | 190 RootInlineBox* root = box->root(); |
| 191 LayoutUnit logicalTop = min<LayoutUnit>(box->logicalTopVisualOverflow(root->
lineTop()), root->selectionTop()) - renderer->maximalOutlineSize(paintInfo.phase
); | 191 LayoutUnit logicalTop = min<LayoutUnit>(box->logicalTopVisualOverflow(root->
lineTop()), root->selectionTop()) - renderer->maximalOutlineSize(paintInfo.phase
); |
| 192 LayoutUnit logicalBottom = box->logicalBottomVisualOverflow(root->lineBottom
()) + renderer->maximalOutlineSize(paintInfo.phase); | 192 LayoutUnit logicalBottom = box->logicalBottomVisualOverflow(root->lineBottom
()) + renderer->maximalOutlineSize(paintInfo.phase); |
| 193 | 193 |
| 194 return rangeIntersectsRect(renderer, logicalTop, logicalBottom, paintInfo.re
ct, offset); | 194 return rangeIntersectsRect(renderer, logicalTop, logicalBottom, paintInfo.re
ct(), offset); |
| 195 } | 195 } |
| 196 | 196 |
| 197 void RenderLineBoxList::paint(RenderBoxModelObject* renderer, PaintInfo& paintIn
fo, const LayoutPoint& paintOffset) const | 197 void RenderLineBoxList::paint(RenderBoxModelObject* renderer, PaintInfo& paintIn
fo, const LayoutPoint& paintOffset) const |
| 198 { | 198 { |
| 199 // Only paint during the foreground/selection phases. | 199 // Only paint during the foreground/selection phases. |
| 200 if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhase
Selection && paintInfo.phase != PaintPhaseOutline | 200 if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhase
Selection && paintInfo.phase != PaintPhaseOutline |
| 201 && paintInfo.phase != PaintPhaseSelfOutline && paintInfo.phase != PaintP
haseChildOutlines && paintInfo.phase != PaintPhaseTextClip | 201 && paintInfo.phase != PaintPhaseSelfOutline && paintInfo.phase != PaintP
haseChildOutlines && paintInfo.phase != PaintPhaseTextClip |
| 202 && paintInfo.phase != PaintPhaseMask) | 202 && paintInfo.phase != PaintPhaseMask) |
| 203 return; | 203 return; |
| 204 | 204 |
| 205 ASSERT(renderer->isRenderBlock() || (renderer->isRenderInline() && renderer-
>hasLayer())); // The only way an inline could paint like this is if it has a la
yer. | 205 ASSERT(renderer->isRenderBlock() || (renderer->isRenderInline() && renderer-
>hasLayer())); // The only way an inline could paint like this is if it has a la
yer. |
| 206 | 206 |
| 207 // If we have no lines then we have no work to do. | 207 // If we have no lines then we have no work to do. |
| 208 if (!firstLineBox()) | 208 if (!firstLineBox()) |
| 209 return; | 209 return; |
| 210 | 210 |
| 211 LayoutUnit outlineSize = renderer->maximalOutlineSize(paintInfo.phase); | 211 LayoutUnit outlineSize = renderer->maximalOutlineSize(paintInfo.phase); |
| 212 if (!anyLineIntersectsRect(renderer, paintInfo.rect, paintOffset, outlineSiz
e)) | 212 if (!anyLineIntersectsRect(renderer, paintInfo.rect(), paintOffset, outlineS
ize)) |
| 213 return; | 213 return; |
| 214 | 214 |
| 215 PaintInfo info(paintInfo); | 215 PaintInfo info(paintInfo); |
| 216 ListHashSet<RenderInline*> outlineObjects; | 216 ListHashSet<RenderInline*> outlineObjects; |
| 217 info.setOutlineObjects(&outlineObjects); | 217 info.setOutlineObjects(&outlineObjects); |
| 218 | 218 |
| 219 // See if our root lines intersect with the dirty rect. If so, then we pain
t | 219 // See if our root lines intersect with the dirty rect. If so, then we pain
t |
| 220 // them. Note that boxes can easily overlap, so we can't make any assumptio
ns | 220 // them. Note that boxes can easily overlap, so we can't make any assumptio
ns |
| 221 // based off positions of our first line box or our last line box. | 221 // based off positions of our first line box or our last line box. |
| 222 for (InlineFlowBox* curr = firstLineBox(); curr; curr = curr->nextLineBox())
{ | 222 for (InlineFlowBox* curr = firstLineBox(); curr; curr = curr->nextLineBox())
{ |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 ASSERT(child->prevLineBox() == prev); | 370 ASSERT(child->prevLineBox() == prev); |
| 371 prev = child; | 371 prev = child; |
| 372 } | 372 } |
| 373 ASSERT(prev == m_lastLineBox); | 373 ASSERT(prev == m_lastLineBox); |
| 374 #endif | 374 #endif |
| 375 } | 375 } |
| 376 | 376 |
| 377 #endif | 377 #endif |
| 378 | 378 |
| 379 } | 379 } |
| OLD | NEW |