OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2003, 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2003, 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. |
3 * Copyright (C) 2013 Google Inc. All rights reserved. | 3 * Copyright (C) 2013 Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 1357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1368 | 1368 |
1369 void GraphicsContext::strokePath(const Path& pathToStroke) | 1369 void GraphicsContext::strokePath(const Path& pathToStroke) |
1370 { | 1370 { |
1371 if (paintingDisabled() || pathToStroke.isEmpty()) | 1371 if (paintingDisabled() || pathToStroke.isEmpty()) |
1372 return; | 1372 return; |
1373 | 1373 |
1374 const SkPath& path = pathToStroke.skPath(); | 1374 const SkPath& path = pathToStroke.skPath(); |
1375 drawPath(path, immutableState()->strokePaint()); | 1375 drawPath(path, immutableState()->strokePaint()); |
1376 } | 1376 } |
1377 | 1377 |
| 1378 void GraphicsContext::strokeRect(const FloatRect& rect) |
| 1379 { |
| 1380 strokeRect(rect, strokeThickness()); |
| 1381 } |
| 1382 |
1378 void GraphicsContext::strokeRect(const FloatRect& rect, float lineWidth) | 1383 void GraphicsContext::strokeRect(const FloatRect& rect, float lineWidth) |
1379 { | 1384 { |
1380 if (paintingDisabled()) | 1385 if (paintingDisabled()) |
1381 return; | 1386 return; |
1382 | 1387 |
1383 SkPaint paint(immutableState()->strokePaint()); | 1388 SkPaint paint(immutableState()->strokePaint()); |
1384 paint.setStrokeWidth(WebCoreFloatToSkScalar(lineWidth)); | 1389 paint.setStrokeWidth(WebCoreFloatToSkScalar(lineWidth)); |
1385 // Reset the dash effect to account for the width | 1390 // Reset the dash effect to account for the width |
1386 immutableState()->strokeData().setupPaintDashPathEffect(&paint, 0); | 1391 immutableState()->strokeData().setupPaintDashPathEffect(&paint, 0); |
1387 // strokerect has special rules for CSS when the rect is degenerate: | 1392 // strokerect has special rules for CSS when the rect is degenerate: |
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1908 | 1913 |
1909 void GraphicsContext::didDrawTextInRect(const SkRect& textRect) | 1914 void GraphicsContext::didDrawTextInRect(const SkRect& textRect) |
1910 { | 1915 { |
1911 if (m_trackTextRegion) { | 1916 if (m_trackTextRegion) { |
1912 TRACE_EVENT0("skia", "PlatformContextSkia::trackTextRegion"); | 1917 TRACE_EVENT0("skia", "PlatformContextSkia::trackTextRegion"); |
1913 m_textRegion.join(textRect); | 1918 m_textRegion.join(textRect); |
1914 } | 1919 } |
1915 } | 1920 } |
1916 | 1921 |
1917 } | 1922 } |
OLD | NEW |