OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc.
All rights reserved. | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc.
All rights reserved. |
3 * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies) |
4 * Copyright (C) 2007 Alp Toker <alp@atoker.com> | 4 * Copyright (C) 2007 Alp Toker <alp@atoker.com> |
5 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> | 5 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> |
6 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org> | 6 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org> |
7 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. | 7 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. |
8 * Copyright (C) 2012, 2013 Intel Corporation. All rights reserved. | 8 * Copyright (C) 2012, 2013 Intel Corporation. All rights reserved. |
9 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. | 9 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. |
10 * | 10 * |
(...skipping 914 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
925 } | 925 } |
926 | 926 |
927 c->setFillRule(windRule); | 927 c->setFillRule(windRule); |
928 } | 928 } |
929 | 929 |
930 void CanvasRenderingContext2D::fill(const String& windingRuleString) | 930 void CanvasRenderingContext2D::fill(const String& windingRuleString) |
931 { | 931 { |
932 fillInternal(m_path, windingRuleString); | 932 fillInternal(m_path, windingRuleString); |
933 } | 933 } |
934 | 934 |
935 void CanvasRenderingContext2D::fill(DOMPath* domPath, const String& windingRuleS
tring) | 935 void CanvasRenderingContext2D::fill(DOMPath* domPath, ExceptionState& exceptionS
tate) |
936 { | 936 { |
| 937 fill(domPath, "nonzero", exceptionState); |
| 938 } |
| 939 |
| 940 void CanvasRenderingContext2D::fill(DOMPath* domPath, const String& windingRuleS
tring, ExceptionState& exceptionState) |
| 941 { |
| 942 if (!domPath) { |
| 943 exceptionState.throwDOMException(TypeMismatchError, ExceptionMessages::a
rgumentNullOrIncorrectType(1, "Path")); |
| 944 return; |
| 945 } |
| 946 |
937 fillInternal(domPath->path(), windingRuleString); | 947 fillInternal(domPath->path(), windingRuleString); |
938 } | 948 } |
939 | 949 |
940 void CanvasRenderingContext2D::strokeInternal(const Path& path) | 950 void CanvasRenderingContext2D::strokeInternal(const Path& path) |
941 { | 951 { |
942 if (path.isEmpty()) { | 952 if (path.isEmpty()) { |
943 return; | 953 return; |
944 } | 954 } |
945 GraphicsContext* c = drawingContext(); | 955 GraphicsContext* c = drawingContext(); |
946 if (!c) { | 956 if (!c) { |
(...skipping 16 matching lines...) Expand all Loading... |
963 c->strokePath(path); | 973 c->strokePath(path); |
964 didDraw(dirtyRect); | 974 didDraw(dirtyRect); |
965 } | 975 } |
966 } | 976 } |
967 | 977 |
968 void CanvasRenderingContext2D::stroke() | 978 void CanvasRenderingContext2D::stroke() |
969 { | 979 { |
970 strokeInternal(m_path); | 980 strokeInternal(m_path); |
971 } | 981 } |
972 | 982 |
973 void CanvasRenderingContext2D::stroke(DOMPath* domPath) | 983 void CanvasRenderingContext2D::stroke(DOMPath* domPath, ExceptionState& exceptio
nState) |
974 { | 984 { |
| 985 if (!domPath) { |
| 986 exceptionState.throwDOMException(TypeMismatchError, ExceptionMessages::a
rgumentNullOrIncorrectType(1, "Path")); |
| 987 return; |
| 988 } |
| 989 |
975 strokeInternal(domPath->path()); | 990 strokeInternal(domPath->path()); |
976 } | 991 } |
977 | 992 |
978 void CanvasRenderingContext2D::clipInternal(const Path& path, const String& wind
ingRuleString) | 993 void CanvasRenderingContext2D::clipInternal(const Path& path, const String& wind
ingRuleString) |
979 { | 994 { |
980 GraphicsContext* c = drawingContext(); | 995 GraphicsContext* c = drawingContext(); |
981 if (!c) { | 996 if (!c) { |
982 return; | 997 return; |
983 } | 998 } |
984 if (!state().m_invertibleCTM) { | 999 if (!state().m_invertibleCTM) { |
985 return; | 1000 return; |
986 } | 1001 } |
987 | 1002 |
988 WindRule newWindRule = RULE_NONZERO; | 1003 WindRule newWindRule = RULE_NONZERO; |
989 if (!parseWinding(windingRuleString, newWindRule)) { | 1004 if (!parseWinding(windingRuleString, newWindRule)) { |
990 return; | 1005 return; |
991 } | 1006 } |
992 | 1007 |
993 realizeSaves(); | 1008 realizeSaves(); |
994 c->canvasClip(path, newWindRule); | 1009 c->canvasClip(path, newWindRule); |
995 } | 1010 } |
996 | 1011 |
997 void CanvasRenderingContext2D::clip(const String& windingRuleString) | 1012 void CanvasRenderingContext2D::clip(const String& windingRuleString) |
998 { | 1013 { |
999 clipInternal(m_path, windingRuleString); | 1014 clipInternal(m_path, windingRuleString); |
1000 } | 1015 } |
1001 | 1016 |
1002 void CanvasRenderingContext2D::clip(DOMPath* domPath, const String& windingRuleS
tring) | 1017 void CanvasRenderingContext2D::clip(DOMPath* domPath, ExceptionState& exceptionS
tate) |
1003 { | 1018 { |
| 1019 clip(domPath, "nonzero", exceptionState); |
| 1020 } |
| 1021 |
| 1022 void CanvasRenderingContext2D::clip(DOMPath* domPath, const String& windingRuleS
tring, ExceptionState& exceptionState) |
| 1023 { |
| 1024 if (!domPath) { |
| 1025 exceptionState.throwDOMException(TypeMismatchError, ExceptionMessages::a
rgumentNullOrIncorrectType(1, "Path")); |
| 1026 return; |
| 1027 } |
| 1028 |
1004 clipInternal(domPath->path(), windingRuleString); | 1029 clipInternal(domPath->path(), windingRuleString); |
1005 } | 1030 } |
1006 | 1031 |
1007 bool CanvasRenderingContext2D::isPointInPath(const float x, const float y, const
String& windingRuleString) | 1032 bool CanvasRenderingContext2D::isPointInPath(const float x, const float y, const
String& windingRuleString) |
1008 { | 1033 { |
1009 GraphicsContext* c = drawingContext(); | 1034 GraphicsContext* c = drawingContext(); |
1010 if (!c) | 1035 if (!c) |
1011 return false; | 1036 return false; |
1012 if (!state().m_invertibleCTM) | 1037 if (!state().m_invertibleCTM) |
1013 return false; | 1038 return false; |
(...skipping 1430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2444 const int focusRingWidth = 5; | 2469 const int focusRingWidth = 5; |
2445 const int focusRingOutline = 0; | 2470 const int focusRingOutline = 0; |
2446 c->drawFocusRing(path, focusRingWidth, focusRingOutline, focusRingColor); | 2471 c->drawFocusRing(path, focusRingWidth, focusRingOutline, focusRingColor); |
2447 | 2472 |
2448 c->restore(); | 2473 c->restore(); |
2449 | 2474 |
2450 didDraw(dirtyRect); | 2475 didDraw(dirtyRect); |
2451 } | 2476 } |
2452 | 2477 |
2453 } // namespace WebCore | 2478 } // namespace WebCore |
OLD | NEW |