use computeSize64 instead of getSize

This commit is contained in:
Heilig Benedek 2017-05-02 06:08:33 +02:00
parent 8d1c17e036
commit 6f80379b30

View file

@ -204,7 +204,7 @@ NativeImage::NativeImage(v8::Isolate* isolate, const gfx::Image& image)
Init(isolate); Init(isolate);
if (image_.HasRepresentation(gfx::Image::kImageRepSkia)) { if (image_.HasRepresentation(gfx::Image::kImageRepSkia)) {
isolate->AdjustAmountOfExternalAllocatedMemory( isolate->AdjustAmountOfExternalAllocatedMemory(
image_.ToImageSkia()->bitmap()->getSize()); image_.ToImageSkia()->bitmap()->computeSize64());
} }
MarkHighMemoryUsage(); MarkHighMemoryUsage();
} }
@ -218,7 +218,7 @@ NativeImage::NativeImage(v8::Isolate* isolate, const base::FilePath& hicon_path)
image_ = gfx::Image(image_skia); image_ = gfx::Image(image_skia);
Init(isolate); Init(isolate);
isolate->AdjustAmountOfExternalAllocatedMemory( isolate->AdjustAmountOfExternalAllocatedMemory(
image_.ToImageSkia()->bitmap()->getSize()); image_.ToImageSkia()->bitmap()->computeSize64());
MarkHighMemoryUsage(); MarkHighMemoryUsage();
} }
#endif #endif
@ -226,7 +226,7 @@ NativeImage::NativeImage(v8::Isolate* isolate, const base::FilePath& hicon_path)
NativeImage::~NativeImage() { NativeImage::~NativeImage() {
if (image_.HasRepresentation(gfx::Image::kImageRepSkia)) { if (image_.HasRepresentation(gfx::Image::kImageRepSkia)) {
isolate()->AdjustAmountOfExternalAllocatedMemory( isolate()->AdjustAmountOfExternalAllocatedMemory(
- static_cast<int64_t>(image_.ToImageSkia()->bitmap()->getSize())); - image_.ToImageSkia()->bitmap()->computeSize64());
} }
} }