Refactor draw validation functions.
Refactor draw validation functions.

We use a significant amount of code duplication in our draw
validation, that we can consolidate.

BUG=angle:571

Change-Id: I96787cbddf00d9289e368456fb85079d8acec513
Reviewed-on: https://chromium-review.googlesource.com/202975
Reviewed-by: Shannon Woods <0f3694938fd5703bd548127ee497e4d604509bef@chromium.org>
Tested-by: Jamie Madill <7e492b4f1c8458024932de3ba475cbf015424c30@chromium.org>

geekboxzone/lollipop_external_chromium_org_third_party_angle,ecoal95/angle,jgcaaprom/android_external_chromium_org_third_party_angle,vvuk/angle,MSOpenTech/angle,ppy/angle,ppy/angle,MIPS/external-chromium_org-third_party-angle,csa7mdm/angle,bsergean/angle,larsbergstrom/angle,MIPS/external-chromium_org-third_party-angle,mlfarrell/angle,xin3liang/platform_external_chromium_org_third_party_angle,mikolalysenko/angle,domokit/waterfall,geekboxzone/lollipop_external_chromium_org_third_party_angle,crezefire/angle,mybios/angle,mrobinson/rust-angle,larsbergstrom/angle,MIPS/external-chromium_org-third_party-angle,ghostoy/angle,android-ia/platform_external_chromium_org_third_party_angle,nandhanurrevanth/angle,xin3liang/platform_external_chromium_org_third_party_angle,MSOpenTech/angle,ppy/angle,crezefire/angle,android-ia/platform_external_chromium_org_third_party_angle,bsergean/angle,ecoal95/angle,vvuk/angle,MSOpenTech/angle,vvuk/angle,ppy/angle,mybios/angle,ecoal95/angle,mybios/angle,vvuk/angle,mybios/angle,ghostoy/angle,bsergean/angle,ghostoy/angle,larsbergstrom/angle,mrobinson/rust-angle,mlfarrell/angle,mikolalysenko/angle,mrobinson/rust-angle,geekboxzone/lollipop_external_chromium_org_third_party_angle,nandhanurrevanth/angle,ghostoy/angle,bsergean/angle,nandhanurrevanth/angle,MSOpenTech/angle,csa7mdm/angle,domokit/waterfall,ecoal95/angle,csa7mdm/angle,xin3liang/platform_external_chromium_org_third_party_angle,mikolalysenko/angle,nandhanurrevanth/angle,MIPS/external-chromium_org-third_party-angle,android-ia/platform_external_chromium_org_third_party_angle,mrobinson/rust-angle,mlfarrell/angle,jgcaaprom/android_external_chromium_org_third_party_angle,crezefire/angle,android-ia/platform_external_chromium_org_third_party_angle,geekboxzone/lollipop_external_chromium_org_third_party_angle,crezefire/angle,larsbergstrom/angle,ecoal95/angle,jgcaaprom/android_external_chromium_org_third_party_angle,mikolalysenko/angle,mlfarrell/angle,xin3liang/platform_external_chromium_org_third_party_angle,mrobinson/rust-angle,csa7mdm/angle,jgcaaprom/android_external_chromium_org_third_party_angle