Follow style guide

This commit is contained in:
Samuel Attard 2017-10-10 17:20:55 +11:00
parent 9308c96f95
commit 2c7787900f
No known key found for this signature in database
GPG key ID: E89DDE5742D58C4E
2 changed files with 7 additions and 7 deletions

View file

@ -616,7 +616,7 @@ void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
dict.SetMethod("createFromBuffer", &atom::api::NativeImage::CreateFromBuffer);
dict.SetMethod("createFromDataURL",
&atom::api::NativeImage::CreateFromDataURL);
dict.SetMethod("createFromNamedImage"
dict.SetMethod("createFromNamedImage",
&atom::api::NativeImage::CreateFromNamedImage);
}

View file

@ -37,22 +37,22 @@ mate::Handle<NativeImage> NativeImage::CreateFromNamedImage(
return CreateEmpty(args->isolate());
}
NSData* pngData = bufferFromNSImage(image);
NSData* png_data = bufferFromNSImage(image);
if (args->GetNext(&hsl_shift) && hsl_shift.size() == 3) {
gfx::Image gfxImage = gfx::Image::CreateFrom1xPNGBytes(
reinterpret_cast<const unsigned char*>((char *) [pngData bytes]), [pngData length]);
gfx::Image gfx_image = gfx::Image::CreateFrom1xPNGBytes(
reinterpret_cast<const unsigned char*>((char *) [png_data bytes]), [png_data length]);
color_utils::HSL shift = {
safeShift(hsl_shift[0], -1),
safeShift(hsl_shift[1], 0.5),
safeShift(hsl_shift[2], 0.5)
};
pngData = bufferFromNSImage(gfx::Image(
png_data = bufferFromNSImage(gfx::Image(
gfx::ImageSkiaOperations::CreateHSLShiftedImage(
gfxImage.AsImageSkia(), shift)).CopyNSImage());
gfx_image.AsImageSkia(), shift)).CopyNSImage());
}
return CreateFromPNG(args->isolate(), (char *) [pngData bytes], [pngData length]);
return CreateFromPNG(args->isolate(), (char *) [png_data bytes], [png_data length]);
}
}