| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 } | 67 } |
| 68 return bounds; | 68 return bounds; |
| 69 } | 69 } |
| 70 | 70 |
| 71 void BoxPainter::paintBoxDecorationBackgroundWithRect(const PaintInfo& paintInfo
, const LayoutPoint& paintOffset, const LayoutRect& paintRect) | 71 void BoxPainter::paintBoxDecorationBackgroundWithRect(const PaintInfo& paintInfo
, const LayoutPoint& paintOffset, const LayoutRect& paintRect) |
| 72 { | 72 { |
| 73 RenderDrawingRecorder recorder(paintInfo.context, m_renderBox, paintInfo.pha
se, boundsForDrawingRecorder(paintOffset)); | 73 RenderDrawingRecorder recorder(paintInfo.context, m_renderBox, paintInfo.pha
se, boundsForDrawingRecorder(paintOffset)); |
| 74 if (recorder.canUseCachedDrawing()) | 74 if (recorder.canUseCachedDrawing()) |
| 75 return; | 75 return; |
| 76 | 76 |
| 77 RenderStyle* style = m_renderBox.style(); | 77 const RenderStyle* style = m_renderBox.style(); |
| 78 BoxDecorationData boxDecorationData(m_renderBox, paintInfo.context); | 78 BoxDecorationData boxDecorationData(m_renderBox, paintInfo.context); |
| 79 | 79 |
| 80 // FIXME: Should eventually give the theme control over whether the box shad
ow should paint, since controls could have | 80 // FIXME: Should eventually give the theme control over whether the box shad
ow should paint, since controls could have |
| 81 // custom shadows of their own. | 81 // custom shadows of their own. |
| 82 if (!m_renderBox.boxShadowShouldBeAppliedToBackground(boxDecorationData.blee
dAvoidance())) | 82 if (!m_renderBox.boxShadowShouldBeAppliedToBackground(boxDecorationData.blee
dAvoidance())) |
| 83 paintBoxShadow(paintInfo, paintRect, style, Normal); | 83 paintBoxShadow(paintInfo, paintRect, style, Normal); |
| 84 | 84 |
| 85 GraphicsContextStateSaver stateSaver(*paintInfo.context, false); | 85 GraphicsContextStateSaver stateSaver(*paintInfo.context, false); |
| 86 if (boxDecorationData.bleedAvoidance() == BackgroundBleedClipBackground) { | 86 if (boxDecorationData.bleedAvoidance() == BackgroundBleedClipBackground) { |
| 87 stateSaver.save(); | 87 stateSaver.save(); |
| (...skipping 2096 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2184 | 2184 |
| 2185 FloatPoint secondQuad[4]; | 2185 FloatPoint secondQuad[4]; |
| 2186 secondQuad[0] = quad[0]; | 2186 secondQuad[0] = quad[0]; |
| 2187 secondQuad[1] = FloatPoint(quad[0].x() - r1 * cx, quad[0].y() - r1 * cy); | 2187 secondQuad[1] = FloatPoint(quad[0].x() - r1 * cx, quad[0].y() - r1 * cy); |
| 2188 secondQuad[2] = quad[2]; | 2188 secondQuad[2] = quad[2]; |
| 2189 secondQuad[3] = quad[3]; | 2189 secondQuad[3] = quad[3]; |
| 2190 graphicsContext->clipPolygon(4, secondQuad, !secondEdgeMatches); | 2190 graphicsContext->clipPolygon(4, secondQuad, !secondEdgeMatches); |
| 2191 } | 2191 } |
| 2192 | 2192 |
| 2193 } // namespace blink | 2193 } // namespace blink |
| OLD | NEW |