TextureRect.rect_scale * TextureRect.texture.get_size()
Edit: yeah, I just realized, this solution was for the custom stretch mode I wrote which uses the scaling property.
Since, if you scale a TextureRect, using TextureRect.rect_size() will only return the set width and height but not the actual displayed size. To get around this, I had to get the scale property and the image texture's size manually to get the actual displayed size. But I digress.