| 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 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 527 quad[0] = FloatPoint(x1, y1 + std::max(adjacentWidth1, 0)); | 527 quad[0] = FloatPoint(x1, y1 + std::max(adjacentWidth1, 0)); |
| 528 quad[1] = FloatPoint(x1, y2 - std::max(adjacentWidth2, 0)); | 528 quad[1] = FloatPoint(x1, y2 - std::max(adjacentWidth2, 0)); |
| 529 quad[2] = FloatPoint(x2, y2 - std::max(-adjacentWidth2, 0)); | 529 quad[2] = FloatPoint(x2, y2 - std::max(-adjacentWidth2, 0)); |
| 530 quad[3] = FloatPoint(x2, y1 + std::max(-adjacentWidth1, 0)); | 530 quad[3] = FloatPoint(x2, y1 + std::max(-adjacentWidth1, 0)); |
| 531 break; | 531 break; |
| 532 } | 532 } |
| 533 | 533 |
| 534 graphicsContext.fillPolygon(4, quad, color, antialias); | 534 graphicsContext.fillPolygon(4, quad, color, antialias); |
| 535 } | 535 } |
| 536 | 536 |
| 537 void ObjectPainter::paintAsPseudoStackingContext(const PaintInfo& paintInfo, con
st LayoutPoint& paintOffset) |
| 538 { |
| 539 bool preservePhase = paintInfo.phase == PaintPhaseSelection || paintInfo.pha
se == PaintPhaseTextClip; |
| 540 if (!preservePhase && paintInfo.phase != PaintPhaseForeground) |
| 541 return; |
| 542 |
| 543 PaintInfo info(paintInfo); |
| 544 info.phase = preservePhase ? paintInfo.phase : PaintPhaseBlockBackground; |
| 545 m_layoutObject.paint(info, paintOffset); |
| 546 if (!preservePhase) { |
| 547 info.phase = PaintPhaseChildBlockBackgrounds; |
| 548 m_layoutObject.paint(info, paintOffset); |
| 549 info.phase = PaintPhaseFloat; |
| 550 m_layoutObject.paint(info, paintOffset); |
| 551 info.phase = PaintPhaseForeground; |
| 552 m_layoutObject.paint(info, paintOffset); |
| 553 info.phase = PaintPhaseOutline; |
| 554 m_layoutObject.paint(info, paintOffset); |
| 555 } |
| 556 } |
| 557 |
| 537 } // namespace blink | 558 } // namespace blink |
| OLD | NEW |