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 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 paint->setStrokeCap(m_state->m_lineCap); | 493 paint->setStrokeCap(m_state->m_lineCap); |
494 paint->setStrokeJoin(m_state->m_lineJoin); | 494 paint->setStrokeJoin(m_state->m_lineJoin); |
495 paint->setStrokeMiter(SkFloatToScalar(m_state->m_miterLimit)); | 495 paint->setStrokeMiter(SkFloatToScalar(m_state->m_miterLimit)); |
496 | 496 |
497 if (m_state->m_dash) | 497 if (m_state->m_dash) |
498 paint->setPathEffect(m_state->m_dash); | 498 paint->setPathEffect(m_state->m_dash); |
499 else { | 499 else { |
500 switch (m_state->m_strokeStyle) { | 500 switch (m_state->m_strokeStyle) { |
501 case NoStroke: | 501 case NoStroke: |
502 case SolidStroke: | 502 case SolidStroke: |
503 #if ENABLE(CSS3_TEXT) | |
504 case DoubleStroke: | 503 case DoubleStroke: |
505 case WavyStroke: // FIXME: https://bugs.webkit.org/show_bug.cgi?id=93509
- Needs platform support. | 504 case WavyStroke: // FIXME: https://code.google.com/p/chromium/issues/det
ail?id=229574 |
506 #endif // CSS3_TEXT | |
507 break; | 505 break; |
508 case DashedStroke: | 506 case DashedStroke: |
509 width = dashRatio * width; | 507 width = dashRatio * width; |
510 // Fall through. | 508 // Fall through. |
511 case DottedStroke: | 509 case DottedStroke: |
512 // Truncate the width, since we don't want fuzzy dots or dashes. | 510 // Truncate the width, since we don't want fuzzy dots or dashes. |
513 int dashLength = static_cast<int>(width); | 511 int dashLength = static_cast<int>(width); |
514 // Subtract off the endcaps, since they're rendered separately. | 512 // Subtract off the endcaps, since they're rendered separately. |
515 int distance = length - 2 * static_cast<int>(m_state->m_strokeThickn
ess); | 513 int distance = length - 2 * static_cast<int>(m_state->m_strokeThickn
ess); |
516 int phase = 1; | 514 int phase = 1; |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
810 // Avoid anti-aliasing lines. Currently, these are always horizontal. | 808 // Avoid anti-aliasing lines. Currently, these are always horizontal. |
811 // Round to nearest pixel to match text and other content. | 809 // Round to nearest pixel to match text and other content. |
812 r.fTop = WebCoreFloatToSkScalar(floorf(pt.y() + 0.5f)); | 810 r.fTop = WebCoreFloatToSkScalar(floorf(pt.y() + 0.5f)); |
813 r.fRight = r.fLeft + WebCoreFloatToSkScalar(width); | 811 r.fRight = r.fLeft + WebCoreFloatToSkScalar(width); |
814 r.fBottom = r.fTop + SkIntToScalar(thickness); | 812 r.fBottom = r.fTop + SkIntToScalar(thickness); |
815 | 813 |
816 SkPaint paint; | 814 SkPaint paint; |
817 switch (strokeStyle()) { | 815 switch (strokeStyle()) { |
818 case NoStroke: | 816 case NoStroke: |
819 case SolidStroke: | 817 case SolidStroke: |
820 #if ENABLE(CSS3_TEXT) | |
821 case DoubleStroke: | 818 case DoubleStroke: |
822 case WavyStroke: | 819 case WavyStroke: |
823 #endif // CSS3_TEXT | |
824 setupPaintForFilling(&paint); | 820 setupPaintForFilling(&paint); |
825 break; | 821 break; |
826 case DottedStroke: | 822 case DottedStroke: |
827 case DashedStroke: | 823 case DashedStroke: |
828 setupPaintForStroking(&paint, &r, 0); | 824 setupPaintForStroking(&paint, &r, 0); |
829 break; | 825 break; |
830 } | 826 } |
831 | 827 |
832 // Text lines are drawn using the stroke color. | 828 // Text lines are drawn using the stroke color. |
833 paint.setColor(effectiveStrokeColor()); | 829 paint.setColor(effectiveStrokeColor()); |
(...skipping 1029 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1863 | 1859 |
1864 void GraphicsContext::didDrawTextInRect(const SkRect& textRect) | 1860 void GraphicsContext::didDrawTextInRect(const SkRect& textRect) |
1865 { | 1861 { |
1866 if (m_trackTextRegion) { | 1862 if (m_trackTextRegion) { |
1867 TRACE_EVENT0("skia", "PlatformContextSkia::trackTextRegion"); | 1863 TRACE_EVENT0("skia", "PlatformContextSkia::trackTextRegion"); |
1868 m_textRegion.join(textRect); | 1864 m_textRegion.join(textRect); |
1869 } | 1865 } |
1870 } | 1866 } |
1871 | 1867 |
1872 } | 1868 } |
OLD | NEW |