| 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/BoxPainter.h" | 6 #include "core/paint/BoxPainter.h" |
| 7 | 7 |
| 8 #include "core/HTMLNames.h" | 8 #include "core/HTMLNames.h" |
| 9 #include "core/frame/Settings.h" | 9 #include "core/frame/Settings.h" |
| 10 #include "core/html/HTMLFrameOwnerElement.h" | 10 #include "core/html/HTMLFrameOwnerElement.h" |
| (...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 540 } | 540 } |
| 541 | 541 |
| 542 void BoxPainter::paintClippingMask(PaintInfo& paintInfo, const LayoutPoint& pain
tOffset) | 542 void BoxPainter::paintClippingMask(PaintInfo& paintInfo, const LayoutPoint& pain
tOffset) |
| 543 { | 543 { |
| 544 if (!paintInfo.shouldPaintWithinRoot(&m_renderBox) || m_renderBox.style()->v
isibility() != VISIBLE || paintInfo.phase != PaintPhaseClippingMask) | 544 if (!paintInfo.shouldPaintWithinRoot(&m_renderBox) || m_renderBox.style()->v
isibility() != VISIBLE || paintInfo.phase != PaintPhaseClippingMask) |
| 545 return; | 545 return; |
| 546 | 546 |
| 547 if (!m_renderBox.layer() || m_renderBox.layer()->compositingState() != Paint
sIntoOwnBacking) | 547 if (!m_renderBox.layer() || m_renderBox.layer()->compositingState() != Paint
sIntoOwnBacking) |
| 548 return; | 548 return; |
| 549 | 549 |
| 550 // We should never have this state in this function. A layer with a mask | |
| 551 // should have always created its own backing if it became composited. | |
| 552 ASSERT(m_renderBox.layer()->compositingState() != HasOwnBackingButPaintsInto
Ancestor); | |
| 553 | |
| 554 LayoutRect paintRect = LayoutRect(paintOffset, m_renderBox.size()); | 550 LayoutRect paintRect = LayoutRect(paintOffset, m_renderBox.size()); |
| 555 paintInfo.context->fillRect(pixelSnappedIntRect(paintRect), Color::black); | 551 paintInfo.context->fillRect(pixelSnappedIntRect(paintRect), Color::black); |
| 556 } | 552 } |
| 557 | 553 |
| 558 void BoxPainter::paintRootBackgroundColor(RenderObject& obj, const PaintInfo& pa
intInfo, const LayoutRect& rect, const Color& bgColor) | 554 void BoxPainter::paintRootBackgroundColor(RenderObject& obj, const PaintInfo& pa
intInfo, const LayoutRect& rect, const Color& bgColor) |
| 559 { | 555 { |
| 560 GraphicsContext* context = paintInfo.context; | 556 GraphicsContext* context = paintInfo.context; |
| 561 if (rect.isEmpty()) | 557 if (rect.isEmpty()) |
| 562 return; | 558 return; |
| 563 | 559 |
| (...skipping 1584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2148 | 2144 |
| 2149 FloatPoint secondQuad[4]; | 2145 FloatPoint secondQuad[4]; |
| 2150 secondQuad[0] = quad[0]; | 2146 secondQuad[0] = quad[0]; |
| 2151 secondQuad[1] = FloatPoint(quad[0].x() - r1 * cx, quad[0].y() - r1 * cy); | 2147 secondQuad[1] = FloatPoint(quad[0].x() - r1 * cx, quad[0].y() - r1 * cy); |
| 2152 secondQuad[2] = quad[2]; | 2148 secondQuad[2] = quad[2]; |
| 2153 secondQuad[3] = quad[3]; | 2149 secondQuad[3] = quad[3]; |
| 2154 graphicsContext->clipPolygon(4, secondQuad, !secondEdgeMatches); | 2150 graphicsContext->clipPolygon(4, secondQuad, !secondEdgeMatches); |
| 2155 } | 2151 } |
| 2156 | 2152 |
| 2157 } // namespace blink | 2153 } // namespace blink |
| OLD | NEW |