| 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/ObjectPainter.h" | 6 #include "core/paint/ObjectPainter.h" |
| 7 | 7 |
| 8 #include "core/layout/LayoutObject.h" | 8 #include "core/layout/LayoutObject.h" |
| 9 #include "core/layout/LayoutTheme.h" | 9 #include "core/layout/LayoutTheme.h" |
| 10 #include "core/style/ComputedStyle.h" | 10 #include "core/style/ComputedStyle.h" |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 graphicsContext->setShouldAntialias(antialias); | 193 graphicsContext->setShouldAntialias(antialias); |
| 194 | 194 |
| 195 switch (side) { | 195 switch (side) { |
| 196 case BSTop: | 196 case BSTop: |
| 197 case BSBottom: | 197 case BSBottom: |
| 198 graphicsContext->drawRect(IntRect(x1, y1, length, thirdOfThickness))
; | 198 graphicsContext->drawRect(IntRect(x1, y1, length, thirdOfThickness))
; |
| 199 graphicsContext->drawRect(IntRect(x1, y2 - thirdOfThickness, length,
thirdOfThickness)); | 199 graphicsContext->drawRect(IntRect(x1, y2 - thirdOfThickness, length,
thirdOfThickness)); |
| 200 break; | 200 break; |
| 201 case BSLeft: | 201 case BSLeft: |
| 202 case BSRight: | 202 case BSRight: |
| 203 // FIXME: Why do we offset the border by 1 in this case but not the
other one? | 203 graphicsContext->drawRect(IntRect(x1, y1, thirdOfThickness, length))
; |
| 204 if (length > 1) { | 204 graphicsContext->drawRect(IntRect(x2 - thirdOfThickness, y1, thirdOf
Thickness, length)); |
| 205 graphicsContext->drawRect(IntRect(x1, y1 + 1, thirdOfThickness,
length - 1)); | |
| 206 graphicsContext->drawRect(IntRect(x2 - thirdOfThickness, y1 + 1,
thirdOfThickness, length - 1)); | |
| 207 } | |
| 208 break; | 205 break; |
| 209 } | 206 } |
| 210 | 207 |
| 211 graphicsContext->setShouldAntialias(wasAntialiased); | 208 graphicsContext->setShouldAntialias(wasAntialiased); |
| 212 graphicsContext->setStrokeStyle(oldStrokeStyle); | 209 graphicsContext->setStrokeStyle(oldStrokeStyle); |
| 213 return; | 210 return; |
| 214 } | 211 } |
| 215 | 212 |
| 216 int adjacent1BigThird = ((adjacentWidth1 > 0) ? adjacentWidth1 + 1 : adjacen
tWidth1 - 1) / 3; | 213 int adjacent1BigThird = ((adjacentWidth1 > 0) ? adjacentWidth1 + 1 : adjacen
tWidth1 - 1) / 3; |
| 217 int adjacent2BigThird = ((adjacentWidth2 > 0) ? adjacentWidth2 + 1 : adjacen
tWidth2 - 1) / 3; | 214 int adjacent2BigThird = ((adjacentWidth2 > 0) ? adjacentWidth2 + 1 : adjacen
tWidth2 - 1) / 3; |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 quad[1] = FloatPoint(x1, y2 - std::max(adjacentWidth2, 0)); | 338 quad[1] = FloatPoint(x1, y2 - std::max(adjacentWidth2, 0)); |
| 342 quad[2] = FloatPoint(x2, y2 - std::max(-adjacentWidth2, 0)); | 339 quad[2] = FloatPoint(x2, y2 - std::max(-adjacentWidth2, 0)); |
| 343 quad[3] = FloatPoint(x2, y1 + std::max(-adjacentWidth1, 0)); | 340 quad[3] = FloatPoint(x2, y1 + std::max(-adjacentWidth1, 0)); |
| 344 break; | 341 break; |
| 345 } | 342 } |
| 346 | 343 |
| 347 graphicsContext->fillPolygon(4, quad, color, antialias); | 344 graphicsContext->fillPolygon(4, quad, color, antialias); |
| 348 } | 345 } |
| 349 | 346 |
| 350 } // namespace blink | 347 } // namespace blink |
| OLD | NEW |