| 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 "core/paint/ObjectPainter.h" | 5 #include "core/paint/ObjectPainter.h" |
| 6 | 6 |
| 7 #include "core/layout/LayoutBlock.h" | 7 #include "core/layout/LayoutBlock.h" |
| 8 #include "core/layout/LayoutInline.h" | 8 #include "core/layout/LayoutInline.h" |
| 9 #include "core/layout/LayoutObject.h" | 9 #include "core/layout/LayoutObject.h" |
| 10 #include "core/layout/LayoutTheme.h" | 10 #include "core/layout/LayoutTheme.h" |
| (...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 525 quad[0] = FloatPoint(x1, y1 + std::max(adjacentWidth1, 0)); | 525 quad[0] = FloatPoint(x1, y1 + std::max(adjacentWidth1, 0)); |
| 526 quad[1] = FloatPoint(x1, y2 - std::max(adjacentWidth2, 0)); | 526 quad[1] = FloatPoint(x1, y2 - std::max(adjacentWidth2, 0)); |
| 527 quad[2] = FloatPoint(x2, y2 - std::max(-adjacentWidth2, 0)); | 527 quad[2] = FloatPoint(x2, y2 - std::max(-adjacentWidth2, 0)); |
| 528 quad[3] = FloatPoint(x2, y1 + std::max(-adjacentWidth1, 0)); | 528 quad[3] = FloatPoint(x2, y1 + std::max(-adjacentWidth1, 0)); |
| 529 break; | 529 break; |
| 530 } | 530 } |
| 531 | 531 |
| 532 graphicsContext.fillPolygon(4, quad, color, antialias); | 532 graphicsContext.fillPolygon(4, quad, color, antialias); |
| 533 } | 533 } |
| 534 | 534 |
| 535 void ObjectPainter::paintAsPseudoStackingContext(const PaintInfo& paintInfo, con
st LayoutPoint& paintOffset) | 535 void ObjectPainter::paintAllPhasesAtomically(const PaintInfo& paintInfo, const L
ayoutPoint& paintOffset) |
| 536 { | 536 { |
| 537 // Pass PaintPhaseSelection and PaintPhaseTextClip to the descendants so tha
t they will paint | 537 // Pass PaintPhaseSelection and PaintPhaseTextClip to the descendants so tha
t they will paint |
| 538 // for selection and text clip respectively. We don't need complete painting
for these phases. | 538 // for selection and text clip respectively. We don't need complete painting
for these phases. |
| 539 if (paintInfo.phase == PaintPhaseSelection || paintInfo.phase == PaintPhaseT
extClip) { | 539 if (paintInfo.phase == PaintPhaseSelection || paintInfo.phase == PaintPhaseT
extClip) { |
| 540 m_layoutObject.paint(paintInfo, paintOffset); | 540 m_layoutObject.paint(paintInfo, paintOffset); |
| 541 return; | 541 return; |
| 542 } | 542 } |
| 543 | 543 |
| 544 if (paintInfo.phase != PaintPhaseForeground) | 544 if (paintInfo.phase != PaintPhaseForeground) |
| 545 return; | 545 return; |
| 546 | 546 |
| 547 PaintInfo info(paintInfo); | 547 PaintInfo info(paintInfo); |
| 548 info.phase = PaintPhaseBlockBackground; | 548 info.phase = PaintPhaseBlockBackground; |
| 549 m_layoutObject.paint(info, paintOffset); | 549 m_layoutObject.paint(info, paintOffset); |
| 550 info.phase = PaintPhaseFloat; | 550 info.phase = PaintPhaseFloat; |
| 551 m_layoutObject.paint(info, paintOffset); | 551 m_layoutObject.paint(info, paintOffset); |
| 552 info.phase = PaintPhaseForeground; | 552 info.phase = PaintPhaseForeground; |
| 553 m_layoutObject.paint(info, paintOffset); | 553 m_layoutObject.paint(info, paintOffset); |
| 554 info.phase = PaintPhaseOutline; | 554 info.phase = PaintPhaseOutline; |
| 555 m_layoutObject.paint(info, paintOffset); | 555 m_layoutObject.paint(info, paintOffset); |
| 556 } | 556 } |
| 557 | 557 |
| 558 } // namespace blink | 558 } // namespace blink |
| OLD | NEW |