diff --git a/atom/common/api/atom_api_native_image.cc b/atom/common/api/atom_api_native_image.cc index ed736dabd00f..efccaa408ed9 100644 --- a/atom/common/api/atom_api_native_image.cc +++ b/atom/common/api/atom_api_native_image.cc @@ -221,7 +221,7 @@ NativeImage::NativeImage(v8::Isolate* isolate, const gfx::Image& image) Init(isolate); if (image_.HasRepresentation(gfx::Image::kImageRepSkia)) { isolate->AdjustAmountOfExternalAllocatedMemory( - image_.ToImageSkia()->bitmap()->computeSize64()); + image_.ToImageSkia()->bitmap()->computeByteSize()); } MarkHighMemoryUsage(); } @@ -236,7 +236,7 @@ NativeImage::NativeImage(v8::Isolate* isolate, const base::FilePath& hicon_path) Init(isolate); if (image_.HasRepresentation(gfx::Image::kImageRepSkia)) { isolate->AdjustAmountOfExternalAllocatedMemory( - image_.ToImageSkia()->bitmap()->computeSize64()); + image_.ToImageSkia()->bitmap()->computeByteSize()); } MarkHighMemoryUsage(); } @@ -245,7 +245,7 @@ NativeImage::NativeImage(v8::Isolate* isolate, const base::FilePath& hicon_path) NativeImage::~NativeImage() { if (image_.HasRepresentation(gfx::Image::kImageRepSkia)) { isolate()->AdjustAmountOfExternalAllocatedMemory( - - image_.ToImageSkia()->bitmap()->computeSize64()); + -static_cast(image_.ToImageSkia()->bitmap()->computeByteSize())); } } @@ -302,7 +302,7 @@ v8::Local NativeImage::ToBitmap(mate::Arguments* args) { return node::Buffer::New(args->isolate(), 0).ToLocalChecked(); return node::Buffer::Copy(args->isolate(), reinterpret_cast(ref->pixels()), - bitmap.getSafeSize()).ToLocalChecked(); + bitmap.computeByteSize()).ToLocalChecked(); } v8::Local NativeImage::ToJPEG(v8::Isolate* isolate, int quality) { @@ -340,7 +340,7 @@ v8::Local NativeImage::GetBitmap(mate::Arguments* args) { return node::Buffer::New(args->isolate(), 0).ToLocalChecked(); return node::Buffer::New(args->isolate(), reinterpret_cast(ref->pixels()), - bitmap.getSafeSize(), + bitmap.computeByteSize(), &Noop, nullptr).ToLocalChecked(); }