fix toBUFFER naming issue and cursor-changed parameter order

This commit is contained in:
Heilig Benedek 2016-08-01 02:13:31 +02:00
parent f3b723c9fa
commit bc7c5c567c
3 changed files with 6 additions and 6 deletions

View file

@ -1299,9 +1299,9 @@ void WebContents::OnCursorChange(const content::WebCursor& cursor) {
if (cursor.IsCustom()) {
Emit("cursor-changed", CursorTypeToString(info),
gfx::Image::CreateFrom1xBitmap(info.custom_image),
gfx::Rect(info.custom_image.width(), info.custom_image.height()),
info.hotspot,
info.image_scale_factor);
info.image_scale_factor,
gfx::Size(info.custom_image.width(), info.custom_image.height()),
info.hotspot);
} else {
Emit("cursor-changed", CursorTypeToString(info));
}

View file

@ -220,7 +220,7 @@ v8::Local<v8::Value> NativeImage::ToPNG(v8::Isolate* isolate) {
static_cast<size_t>(png->size())).ToLocalChecked();
}
v8::Local<v8::Value> NativeImage::ToRawBuffer(v8::Isolate* isolate) {
v8::Local<v8::Value> NativeImage::ToBitmap(v8::Isolate* isolate) {
const SkBitmap* bitmap = image_.ToSkBitmap();
SkPixelRef* ref = bitmap->pixelRef();
return node::Buffer::Copy(isolate,
@ -359,7 +359,7 @@ void NativeImage::BuildPrototype(
mate::ObjectTemplateBuilder(isolate, prototype)
.SetMethod("toPNG", &NativeImage::ToPNG)
.SetMethod("toJPEG", &NativeImage::ToJPEG)
.SetMethod("toBUFFER", &NativeImage::ToRawBuffer)
.SetMethod("toBitmap", &NativeImage::ToBitmap)
.SetMethod("getNativeHandle", &NativeImage::GetNativeHandle)
.SetMethod("toDataURL", &NativeImage::ToDataURL)
.SetMethod("isEmpty", &NativeImage::IsEmpty)

View file

@ -70,7 +70,7 @@ class NativeImage : public mate::Wrappable<NativeImage> {
private:
v8::Local<v8::Value> ToPNG(v8::Isolate* isolate);
v8::Local<v8::Value> ToJPEG(v8::Isolate* isolate, int quality);
v8::Local<v8::Value> ToRawBuffer(v8::Isolate* isolate);
v8::Local<v8::Value> ToBitmap(v8::Isolate* isolate);
v8::Local<v8::Value> GetNativeHandle(
v8::Isolate* isolate,
mate::Arguments* args);