Merge "Revert "Call isEmpty() instead of constructing a new object to compare""

This commit is contained in:
Leon Scroggins
2022-08-29 18:41:16 +00:00
committed by Android (Google) Code Review

View File

@@ -381,7 +381,7 @@ int AImageDecoder_setCrop(AImageDecoder* decoder, ARect crop) {
SkIRect cropIRect;
cropIRect.setLTRB(crop.left, crop.top, crop.right, crop.bottom);
SkIRect* cropPtr = cropIRect.isEmpty() ? nullptr : &cropIRect;
SkIRect* cropPtr = cropIRect == SkIRect::MakeEmpty() ? nullptr : &cropIRect;
return imageDecoder->setCropRect(cropPtr)
? ANDROID_IMAGE_DECODER_SUCCESS : ANDROID_IMAGE_DECODER_BAD_PARAMETER;
}