| 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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 | 167 |
| 168 Color outlineColor = color; | 168 Color outlineColor = color; |
| 169 bool useTransparencyLayer = color.hasAlpha(); | 169 bool useTransparencyLayer = color.hasAlpha(); |
| 170 if (useTransparencyLayer) { | 170 if (useTransparencyLayer) { |
| 171 graphicsContext.beginLayer(static_cast<float>(color.alpha()) / 255); | 171 graphicsContext.beginLayer(static_cast<float>(color.alpha()) / 255); |
| 172 outlineColor = | 172 outlineColor = |
| 173 Color(outlineColor.red(), outlineColor.green(), outlineColor.blue()); | 173 Color(outlineColor.red(), outlineColor.green(), outlineColor.blue()); |
| 174 } | 174 } |
| 175 | 175 |
| 176 DCHECK(count >= 4 && edges.size() == count); | 176 DCHECK(count >= 4 && edges.size() == count); |
| 177 int firstAdjacentWidth = adjustJoint(width, edges.back(), edges.first()); | 177 int firstAdjacentWidth = adjustJoint(width, edges.back(), edges.front()); |
| 178 | 178 |
| 179 // The width of the angled part of starting and ending joint of the current | 179 // The width of the angled part of starting and ending joint of the current |
| 180 // edge. | 180 // edge. |
| 181 int adjacentWidthStart = firstAdjacentWidth; | 181 int adjacentWidthStart = firstAdjacentWidth; |
| 182 int adjacentWidthEnd; | 182 int adjacentWidthEnd; |
| 183 for (size_t i = 0; i < count; ++i) { | 183 for (size_t i = 0; i < count; ++i) { |
| 184 OutlineEdgeInfo& edge = edges[i]; | 184 OutlineEdgeInfo& edge = edges[i]; |
| 185 adjacentWidthEnd = i == count - 1 ? firstAdjacentWidth | 185 adjacentWidthEnd = i == count - 1 ? firstAdjacentWidth |
| 186 : adjustJoint(width, edge, edges[i + 1]); | 186 : adjustJoint(width, edge, edges[i + 1]); |
| 187 int adjacentWidth1 = adjacentWidthStart; | 187 int adjacentWidth1 = adjacentWidthStart; |
| (...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 718 adjustedPaintOffset += toLayoutBox(m_layoutObject).location(); | 718 adjustedPaintOffset += toLayoutBox(m_layoutObject).location(); |
| 719 DCHECK(m_layoutObject.previousPaintOffset() == adjustedPaintOffset) | 719 DCHECK(m_layoutObject.previousPaintOffset() == adjustedPaintOffset) |
| 720 << " Paint offset mismatch: " << m_layoutObject.debugName() | 720 << " Paint offset mismatch: " << m_layoutObject.debugName() |
| 721 << " from PaintPropertyTreeBuilder: " | 721 << " from PaintPropertyTreeBuilder: " |
| 722 << m_layoutObject.previousPaintOffset().toString() | 722 << m_layoutObject.previousPaintOffset().toString() |
| 723 << " from painter: " << adjustedPaintOffset.toString(); | 723 << " from painter: " << adjustedPaintOffset.toString(); |
| 724 } | 724 } |
| 725 #endif | 725 #endif |
| 726 | 726 |
| 727 } // namespace blink | 727 } // namespace blink |
| OLD | NEW |