Pre-crop filled rects to avoid scissor
authorcsmartdalton <csmartdalton@google.com>
Mon, 11 Jul 2016 21:34:11 +0000 (14:34 -0700)
committerCommit bot <commit-bot@chromium.org>
Mon, 11 Jul 2016 21:34:12 +0000 (14:34 -0700)
commit7969838702135b9f127bd738728da61bc49b050a
tree9bcf60d9251fd0b4fdca47da0005ff9c07c514b2
parent8a74f132398f107963fe1b27fb54b63a008e67dd
Pre-crop filled rects to avoid scissor

Updates GrDrawContext to crop filled rects to the clip bounds before
creating batches for them. Also adds clipping logic to ignore scissor
when the draw falls completely inside. These two changes combined
reduce API traffic and improve batching.

In the future this can and should be improved by switching to floating
point clip boundaries, thus allowing us to throw out non pixel aligned
rectangle clips as well.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2132073002

Review-Url: https://codereview.chromium.org/2132073002
gm/croppedrects.cpp [new file with mode: 0644]
include/gpu/GrClip.h
src/gpu/GrClip.cpp
src/gpu/GrClipMaskManager.cpp
src/gpu/GrDrawContext.cpp