fix toBUFFER naming issue and cursor-changed parameter order
This commit is contained in:
parent
f3b723c9fa
commit
bc7c5c567c
3 changed files with 6 additions and 6 deletions
|
@ -1299,9 +1299,9 @@ void WebContents::OnCursorChange(const content::WebCursor& cursor) {
|
||||||
if (cursor.IsCustom()) {
|
if (cursor.IsCustom()) {
|
||||||
Emit("cursor-changed", CursorTypeToString(info),
|
Emit("cursor-changed", CursorTypeToString(info),
|
||||||
gfx::Image::CreateFrom1xBitmap(info.custom_image),
|
gfx::Image::CreateFrom1xBitmap(info.custom_image),
|
||||||
gfx::Rect(info.custom_image.width(), info.custom_image.height()),
|
info.image_scale_factor,
|
||||||
info.hotspot,
|
gfx::Size(info.custom_image.width(), info.custom_image.height()),
|
||||||
info.image_scale_factor);
|
info.hotspot);
|
||||||
} else {
|
} else {
|
||||||
Emit("cursor-changed", CursorTypeToString(info));
|
Emit("cursor-changed", CursorTypeToString(info));
|
||||||
}
|
}
|
||||||
|
|
|
@ -220,7 +220,7 @@ v8::Local<v8::Value> NativeImage::ToPNG(v8::Isolate* isolate) {
|
||||||
static_cast<size_t>(png->size())).ToLocalChecked();
|
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();
|
const SkBitmap* bitmap = image_.ToSkBitmap();
|
||||||
SkPixelRef* ref = bitmap->pixelRef();
|
SkPixelRef* ref = bitmap->pixelRef();
|
||||||
return node::Buffer::Copy(isolate,
|
return node::Buffer::Copy(isolate,
|
||||||
|
@ -359,7 +359,7 @@ void NativeImage::BuildPrototype(
|
||||||
mate::ObjectTemplateBuilder(isolate, prototype)
|
mate::ObjectTemplateBuilder(isolate, prototype)
|
||||||
.SetMethod("toPNG", &NativeImage::ToPNG)
|
.SetMethod("toPNG", &NativeImage::ToPNG)
|
||||||
.SetMethod("toJPEG", &NativeImage::ToJPEG)
|
.SetMethod("toJPEG", &NativeImage::ToJPEG)
|
||||||
.SetMethod("toBUFFER", &NativeImage::ToRawBuffer)
|
.SetMethod("toBitmap", &NativeImage::ToBitmap)
|
||||||
.SetMethod("getNativeHandle", &NativeImage::GetNativeHandle)
|
.SetMethod("getNativeHandle", &NativeImage::GetNativeHandle)
|
||||||
.SetMethod("toDataURL", &NativeImage::ToDataURL)
|
.SetMethod("toDataURL", &NativeImage::ToDataURL)
|
||||||
.SetMethod("isEmpty", &NativeImage::IsEmpty)
|
.SetMethod("isEmpty", &NativeImage::IsEmpty)
|
||||||
|
|
|
@ -70,7 +70,7 @@ class NativeImage : public mate::Wrappable<NativeImage> {
|
||||||
private:
|
private:
|
||||||
v8::Local<v8::Value> ToPNG(v8::Isolate* isolate);
|
v8::Local<v8::Value> ToPNG(v8::Isolate* isolate);
|
||||||
v8::Local<v8::Value> ToJPEG(v8::Isolate* isolate, int quality);
|
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::Local<v8::Value> GetNativeHandle(
|
||||||
v8::Isolate* isolate,
|
v8::Isolate* isolate,
|
||||||
mate::Arguments* args);
|
mate::Arguments* args);
|
||||||
|
|
Loading…
Reference in a new issue