refactor code to apply the croprect

BUG=skia:

Review URL: https://codereview.chromium.org/1218993002
2 files changed