OLD | NEW |
1 // Copyright 2011, Google Inc. | 1 // Copyright 2011, Google Inc. |
2 // All rights reserved. | 2 // All rights reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
6 // met: | 6 // met: |
7 // | 7 // |
8 // * Redistributions of source code must retain the above copyright | 8 // * 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 // * Redistributions in binary form must reproduce the above | 10 // * Redistributions in binary form must reproduce the above |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 return; | 52 return; |
53 } | 53 } |
54 | 54 |
55 DartUtilities::setDartStringReturnValue(args, style->color()); | 55 DartUtilities::setDartStringReturnValue(args, style->color()); |
56 } | 56 } |
57 | 57 |
58 static PassRefPtr<CanvasStyle> toCanvasStyle(Dart_Handle value) | 58 static PassRefPtr<CanvasStyle> toCanvasStyle(Dart_Handle value) |
59 { | 59 { |
60 Dart_Handle exception = 0; | 60 Dart_Handle exception = 0; |
61 if (DartDOMWrapper::subtypeOf(value, DartCanvasGradient::dartClassId)) | 61 if (DartDOMWrapper::subtypeOf(value, DartCanvasGradient::dartClassId)) |
62 return CanvasStyle::createFromGradient(DartCanvasGradient::toNative(valu
e, exception)); | 62 return CanvasStyle::createFromGradient(DartCanvasGradient::toNativeWithN
ullCheck(value, exception)); |
63 | 63 |
64 if (DartDOMWrapper::subtypeOf(value, DartCanvasPattern::dartClassId)) | 64 if (DartDOMWrapper::subtypeOf(value, DartCanvasPattern::dartClassId)) |
65 return CanvasStyle::createFromPattern(DartCanvasPattern::toNative(value,
exception)); | 65 return CanvasStyle::createFromPattern(DartCanvasPattern::toNativeWithNul
lCheck(value, exception)); |
66 | 66 |
67 return nullptr; | 67 return nullptr; |
68 } | 68 } |
69 | 69 |
70 void strokeStyleGetter(Dart_NativeArguments args ) | 70 void strokeStyleGetter(Dart_NativeArguments args ) |
71 { | 71 { |
72 { | 72 { |
73 CanvasRenderingContext2D* receiver = DartDOMWrapper::receiver<CanvasRend
eringContext2D>(args); | 73 CanvasRenderingContext2D* receiver = DartDOMWrapper::receiver<CanvasRend
eringContext2D>(args); |
74 | 74 |
75 canvasStyleReturnToDartValue(args, receiver->strokeStyle()); | 75 canvasStyleReturnToDartValue(args, receiver->strokeStyle()); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 } | 133 } |
134 | 134 |
135 fail: | 135 fail: |
136 Dart_ThrowException(exception); | 136 Dart_ThrowException(exception); |
137 ASSERT_NOT_REACHED(); | 137 ASSERT_NOT_REACHED(); |
138 } | 138 } |
139 | 139 |
140 } // namespace DartCanvasRenderingContext2DInternal | 140 } // namespace DartCanvasRenderingContext2DInternal |
141 | 141 |
142 } // namespace WebCore | 142 } // namespace WebCore |
OLD | NEW |