use computeSize64 instead of getSize
This commit is contained in:
		
					parent
					
						
							
								8d1c17e036
							
						
					
				
			
			
				commit
				
					
						6f80379b30
					
				
			
		
					 1 changed files with 3 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -204,7 +204,7 @@ NativeImage::NativeImage(v8::Isolate* isolate, const gfx::Image& image)
 | 
			
		|||
  Init(isolate);
 | 
			
		||||
  if (image_.HasRepresentation(gfx::Image::kImageRepSkia)) {
 | 
			
		||||
    isolate->AdjustAmountOfExternalAllocatedMemory(
 | 
			
		||||
      image_.ToImageSkia()->bitmap()->getSize());
 | 
			
		||||
      image_.ToImageSkia()->bitmap()->computeSize64());
 | 
			
		||||
  }
 | 
			
		||||
  MarkHighMemoryUsage();
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -218,7 +218,7 @@ NativeImage::NativeImage(v8::Isolate* isolate, const base::FilePath& hicon_path)
 | 
			
		|||
  image_ = gfx::Image(image_skia);
 | 
			
		||||
  Init(isolate);
 | 
			
		||||
  isolate->AdjustAmountOfExternalAllocatedMemory(
 | 
			
		||||
    image_.ToImageSkia()->bitmap()->getSize());
 | 
			
		||||
    image_.ToImageSkia()->bitmap()->computeSize64());
 | 
			
		||||
  MarkHighMemoryUsage();
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
| 
						 | 
				
			
			@ -226,7 +226,7 @@ NativeImage::NativeImage(v8::Isolate* isolate, const base::FilePath& hicon_path)
 | 
			
		|||
NativeImage::~NativeImage() {
 | 
			
		||||
  if (image_.HasRepresentation(gfx::Image::kImageRepSkia)) {
 | 
			
		||||
    isolate()->AdjustAmountOfExternalAllocatedMemory(
 | 
			
		||||
      - static_cast<int64_t>(image_.ToImageSkia()->bitmap()->getSize()));
 | 
			
		||||
      - image_.ToImageSkia()->bitmap()->computeSize64());
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue