Merge "Enforce API preconditions in Java instead of deferring to Skia." into nyc-dev