335
335
Context2d::setFillRule (v8::Local<v8::Value> value) {
336
336
cairo_fill_rule_t rule = CAIRO_FILL_RULE_WINDING;
337
337
if (value->IsString ()) {
338
- String::Utf8Value str (value);
338
+ Nan::Utf8String str (value);
339
339
if (std::strcmp (*str, " evenodd" ) == 0 ) {
340
340
rule = CAIRO_FILL_RULE_EVEN_ODD;
341
341
}
@@ -654,7 +654,7 @@ NAN_METHOD(Context2d::New) {
654
654
655
655
Local<Value> pixelFormat = ctxAttributes->Get (Nan::New (" pixelFormat" ).ToLocalChecked ());
656
656
if (pixelFormat->IsString ()) {
657
- String::Utf8Value utf8PixelFormat (pixelFormat);
657
+ Nan::Utf8String utf8PixelFormat (pixelFormat);
658
658
if (!strcmp (*utf8PixelFormat, " RGBA32" )) format = CAIRO_FORMAT_ARGB32;
659
659
else if (!strcmp (*utf8PixelFormat, " RGB24" )) format = CAIRO_FORMAT_RGB24;
660
660
else if (!strcmp (*utf8PixelFormat, " A8" )) format = CAIRO_FORMAT_A8;
@@ -1335,7 +1335,7 @@ NAN_GETTER(Context2d::GetGlobalCompositeOperation) {
1335
1335
1336
1336
NAN_SETTER (Context2d::SetPatternQuality) {
1337
1337
Context2d *context = Nan::ObjectWrap::Unwrap<Context2d>(info.This ());
1338
- String::Utf8Value quality (value->ToString ());
1338
+ Nan::Utf8String quality (value->ToString ());
1339
1339
if (0 == strcmp (" fast" , *quality)) {
1340
1340
context->state ->patternQuality = CAIRO_FILTER_FAST;
1341
1341
} else if (0 == strcmp (" good" , *quality)) {
@@ -1373,7 +1373,7 @@ NAN_GETTER(Context2d::GetPatternQuality) {
1373
1373
NAN_SETTER (Context2d::SetGlobalCompositeOperation) {
1374
1374
Context2d *context = Nan::ObjectWrap::Unwrap<Context2d>(info.This ());
1375
1375
cairo_t *ctx = context->context ();
1376
- String::Utf8Value type (value->ToString ());
1376
+ Nan::Utf8String type (value->ToString ());
1377
1377
if (0 == strcmp (" xor" , *type)) {
1378
1378
cairo_set_operator (ctx, CAIRO_OPERATOR_XOR);
1379
1379
} else if (0 == strcmp (" source-atop" , *type)) {
@@ -1521,7 +1521,7 @@ NAN_GETTER(Context2d::GetAntiAlias) {
1521
1521
*/
1522
1522
1523
1523
NAN_SETTER (Context2d::SetAntiAlias) {
1524
- String::Utf8Value str (value->ToString ());
1524
+ Nan::Utf8String str (value->ToString ());
1525
1525
Context2d *context = Nan::ObjectWrap::Unwrap<Context2d>(info.This ());
1526
1526
cairo_t *ctx = context->context ();
1527
1527
cairo_antialias_t a;
@@ -1561,7 +1561,7 @@ NAN_GETTER(Context2d::GetTextDrawingMode) {
1561
1561
*/
1562
1562
1563
1563
NAN_SETTER (Context2d::SetTextDrawingMode) {
1564
- String::Utf8Value str (value->ToString ());
1564
+ Nan::Utf8String str (value->ToString ());
1565
1565
Context2d *context = Nan::ObjectWrap::Unwrap<Context2d>(info.This ());
1566
1566
if (0 == strcmp (" path" , *str)) {
1567
1567
context->state ->textDrawingMode = TEXT_DRAW_PATHS;
@@ -1592,7 +1592,7 @@ NAN_GETTER(Context2d::GetFilter) {
1592
1592
*/
1593
1593
1594
1594
NAN_SETTER (Context2d::SetFilter) {
1595
- String::Utf8Value str (value->ToString ());
1595
+ Nan::Utf8String str (value->ToString ());
1596
1596
Context2d *context = Nan::ObjectWrap::Unwrap<Context2d>(info.This ());
1597
1597
cairo_filter_t filter;
1598
1598
if (0 == strcmp (" fast" , *str)) {
@@ -1673,7 +1673,7 @@ NAN_GETTER(Context2d::GetLineJoin) {
1673
1673
NAN_SETTER (Context2d::SetLineJoin) {
1674
1674
Context2d *context = Nan::ObjectWrap::Unwrap<Context2d>(info.This ());
1675
1675
cairo_t *ctx = context->context ();
1676
- String::Utf8Value type (value->ToString ());
1676
+ Nan::Utf8String type (value->ToString ());
1677
1677
if (0 == strcmp (" round" , *type)) {
1678
1678
cairo_set_line_join (ctx, CAIRO_LINE_JOIN_ROUND);
1679
1679
} else if (0 == strcmp (" bevel" , *type)) {
@@ -1705,7 +1705,7 @@ NAN_GETTER(Context2d::GetLineCap) {
1705
1705
NAN_SETTER (Context2d::SetLineCap) {
1706
1706
Context2d *context = Nan::ObjectWrap::Unwrap<Context2d>(info.This ());
1707
1707
cairo_t *ctx = context->context ();
1708
- String::Utf8Value type (value->ToString ());
1708
+ Nan::Utf8String type (value->ToString ());
1709
1709
if (0 == strcmp (" round" , *type)) {
1710
1710
cairo_set_line_cap (ctx, CAIRO_LINE_CAP_ROUND);
1711
1711
} else if (0 == strcmp (" square" , *type)) {
@@ -1780,7 +1780,7 @@ NAN_METHOD(Context2d::SetStrokePattern) {
1780
1780
1781
1781
NAN_SETTER (Context2d::SetShadowColor) {
1782
1782
short ok;
1783
- String::Utf8Value str (value->ToString ());
1783
+ Nan::Utf8String str (value->ToString ());
1784
1784
uint32_t rgba = rgba_from_string (*str, &ok);
1785
1785
if (ok) {
1786
1786
Context2d *context = Nan::ObjectWrap::Unwrap<Context2d>(info.This ());
@@ -1807,7 +1807,7 @@ NAN_METHOD(Context2d::SetFillColor) {
1807
1807
short ok;
1808
1808
1809
1809
if (!info[0 ]->IsString ()) return ;
1810
- String::Utf8Value str (info[0 ]);
1810
+ Nan::Utf8String str (info[0 ]);
1811
1811
1812
1812
uint32_t rgba = rgba_from_string (*str, &ok);
1813
1813
if (!ok) return ;
@@ -1835,7 +1835,7 @@ NAN_METHOD(Context2d::SetStrokeColor) {
1835
1835
short ok;
1836
1836
1837
1837
if (!info[0 ]->IsString ()) return ;
1838
- String::Utf8Value str (info[0 ]);
1838
+ Nan::Utf8String str (info[0 ]);
1839
1839
1840
1840
uint32_t rgba = rgba_from_string (*str, &ok);
1841
1841
if (!ok) return ;
@@ -2085,7 +2085,7 @@ NAN_METHOD(Context2d::FillText) {
2085
2085
if (!checkArgs (info, args, argsNum, 1 ))
2086
2086
return ;
2087
2087
2088
- String::Utf8Value str (info[0 ]->ToString ());
2088
+ Nan::Utf8String str (info[0 ]->ToString ());
2089
2089
double x = args[0 ];
2090
2090
double y = args[1 ];
2091
2091
double scaled_by = 1 ;
@@ -2120,7 +2120,7 @@ NAN_METHOD(Context2d::StrokeText) {
2120
2120
if (!checkArgs (info, args, argsNum, 1 ))
2121
2121
return ;
2122
2122
2123
- String::Utf8Value str (info[0 ]->ToString ());
2123
+ Nan::Utf8String str (info[0 ]->ToString ());
2124
2124
double x = args[0 ];
2125
2125
double y = args[1 ];
2126
2126
double scaled_by = 1 ;
@@ -2245,11 +2245,11 @@ NAN_METHOD(Context2d::SetFont) {
2245
2245
|| !info[3 ]->IsString ()
2246
2246
|| !info[4 ]->IsString ()) return ;
2247
2247
2248
- String::Utf8Value weight (info[0 ]);
2249
- String::Utf8Value style (info[1 ]);
2248
+ Nan::Utf8String weight (info[0 ]);
2249
+ Nan::Utf8String style (info[1 ]);
2250
2250
double size = info[2 ]->NumberValue ();
2251
- String::Utf8Value unit (info[3 ]);
2252
- String::Utf8Value family (info[4 ]);
2251
+ Nan::Utf8String unit (info[3 ]);
2252
+ Nan::Utf8String family (info[4 ]);
2253
2253
2254
2254
Context2d *context = Nan::ObjectWrap::Unwrap<Context2d>(info.This ());
2255
2255
@@ -2282,7 +2282,7 @@ NAN_METHOD(Context2d::MeasureText) {
2282
2282
Context2d *context = Nan::ObjectWrap::Unwrap<Context2d>(info.This ());
2283
2283
cairo_t *ctx = context->context ();
2284
2284
2285
- String::Utf8Value str (info[0 ]->ToString ());
2285
+ Nan::Utf8String str (info[0 ]->ToString ());
2286
2286
Local<Object> obj = Nan::New<Object>();
2287
2287
2288
2288
PangoRectangle _ink_rect, _logical_rect;
0 commit comments