| OLD | NEW |
| 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/BlockPainter.h" | 6 #include "core/paint/BlockPainter.h" |
| 7 | 7 |
| 8 #include "core/editing/Caret.h" | 8 #include "core/editing/Caret.h" |
| 9 #include "core/editing/FrameSelection.h" | 9 #include "core/editing/FrameSelection.h" |
| 10 #include "core/frame/LocalFrame.h" | 10 #include "core/frame/LocalFrame.h" |
| 11 #include "core/frame/Settings.h" | 11 #include "core/frame/Settings.h" |
| 12 #include "core/page/Page.h" | 12 #include "core/page/Page.h" |
| 13 #include "core/paint/BoxPainter.h" | 13 #include "core/paint/BoxPainter.h" |
| 14 #include "core/paint/InlinePainter.h" | 14 #include "core/paint/InlinePainter.h" |
| 15 #include "core/paint/LineBoxListPainter.h" |
| 15 #include "core/rendering/GraphicsContextAnnotator.h" | 16 #include "core/rendering/GraphicsContextAnnotator.h" |
| 16 #include "core/rendering/PaintInfo.h" | 17 #include "core/rendering/PaintInfo.h" |
| 17 #include "core/rendering/RenderBlock.h" | 18 #include "core/rendering/RenderBlock.h" |
| 18 #include "core/rendering/RenderInline.h" | 19 #include "core/rendering/RenderInline.h" |
| 19 #include "core/rendering/RenderLayer.h" | 20 #include "core/rendering/RenderLayer.h" |
| 20 #include "platform/geometry/LayoutPoint.h" | 21 #include "platform/geometry/LayoutPoint.h" |
| 21 #include "platform/geometry/LayoutRect.h" | 22 #include "platform/geometry/LayoutRect.h" |
| 22 #include "platform/graphics/GraphicsContextCullSaver.h" | 23 #include "platform/graphics/GraphicsContextCullSaver.h" |
| 23 #include "platform/graphics/GraphicsContextStateSaver.h" | 24 #include "platform/graphics/GraphicsContextStateSaver.h" |
| 24 | 25 |
| (...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 | 384 |
| 384 void BlockPainter::paintContents(PaintInfo& paintInfo, const LayoutPoint& paintO
ffset) | 385 void BlockPainter::paintContents(PaintInfo& paintInfo, const LayoutPoint& paintO
ffset) |
| 385 { | 386 { |
| 386 // Avoid painting descendants of the root element when stylesheets haven't l
oaded. This eliminates FOUC. | 387 // Avoid painting descendants of the root element when stylesheets haven't l
oaded. This eliminates FOUC. |
| 387 // It's ok not to draw, because later on, when all the stylesheets do load,
styleResolverChanged() on the Document | 388 // It's ok not to draw, because later on, when all the stylesheets do load,
styleResolverChanged() on the Document |
| 388 // will do a full paint invalidation. | 389 // will do a full paint invalidation. |
| 389 if (m_renderBlock.document().didLayoutWithPendingStylesheets() && !m_renderB
lock.isRenderView()) | 390 if (m_renderBlock.document().didLayoutWithPendingStylesheets() && !m_renderB
lock.isRenderView()) |
| 390 return; | 391 return; |
| 391 | 392 |
| 392 if (m_renderBlock.childrenInline()) { | 393 if (m_renderBlock.childrenInline()) { |
| 393 m_renderBlock.lineBoxes()->paint(&m_renderBlock, paintInfo, paintOffset)
; | 394 LineBoxListPainter(*m_renderBlock.lineBoxes()).paint(&m_renderBlock, pai
ntInfo, paintOffset); |
| 394 } else { | 395 } else { |
| 395 PaintPhase newPhase = (paintInfo.phase == PaintPhaseChildOutlines) ? Pai
ntPhaseOutline : paintInfo.phase; | 396 PaintPhase newPhase = (paintInfo.phase == PaintPhaseChildOutlines) ? Pai
ntPhaseOutline : paintInfo.phase; |
| 396 newPhase = (newPhase == PaintPhaseChildBlockBackgrounds) ? PaintPhaseChi
ldBlockBackground : newPhase; | 397 newPhase = (newPhase == PaintPhaseChildBlockBackgrounds) ? PaintPhaseChi
ldBlockBackground : newPhase; |
| 397 | 398 |
| 398 // We don't paint our own background, but we do let the kids paint their
backgrounds. | 399 // We don't paint our own background, but we do let the kids paint their
backgrounds. |
| 399 PaintInfo paintInfoForChild(paintInfo); | 400 PaintInfo paintInfoForChild(paintInfo); |
| 400 paintInfoForChild.phase = newPhase; | 401 paintInfoForChild.phase = newPhase; |
| 401 paintInfoForChild.updatePaintingRootForChildren(&m_renderBlock); | 402 paintInfoForChild.updatePaintingRootForChildren(&m_renderBlock); |
| 402 m_renderBlock.paintChildren(paintInfoForChild, paintOffset); | 403 m_renderBlock.paintChildren(paintInfoForChild, paintOffset); |
| 403 } | 404 } |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 RenderBlock* block = flow->containingBlock(); | 469 RenderBlock* block = flow->containingBlock(); |
| 469 for ( ; block && block != &m_renderBlock; block = block->containingBlock
()) | 470 for ( ; block && block != &m_renderBlock; block = block->containingBlock
()) |
| 470 accumulatedPaintOffset.moveBy(block->location()); | 471 accumulatedPaintOffset.moveBy(block->location()); |
| 471 ASSERT(block); | 472 ASSERT(block); |
| 472 InlinePainter(*flow).paintOutline(info, accumulatedPaintOffset); | 473 InlinePainter(*flow).paintOutline(info, accumulatedPaintOffset); |
| 473 } | 474 } |
| 474 } | 475 } |
| 475 | 476 |
| 476 | 477 |
| 477 } // namespace blink | 478 } // namespace blink |
| OLD | NEW |