Avoid undefined behavior and enable asserts in ClampTest.
authorcommit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Wed, 30 Apr 2014 16:51:51 +0000 (16:51 +0000)
committercommit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Wed, 30 Apr 2014 16:51:51 +0000 (16:51 +0000)
commit86398e5d9149eaad2fd2c8dba5557aca645d2385
treee610d5da9c03bcaa78d54e44314e6d741df61d07
parent2a8abc4552e578aa6599ab69c68c688828e02737
Avoid undefined behavior and enable asserts in ClampTest.

The old code here wasn't being careful to avoid int32_t overflow in slow_check.  Fix that.

R_ASSERT hasn't been doing anything for a while.  As a result, there are a couple bugs in SkClampRange, marked as such and commented out.  The asserts also weren't quite passing, so I fixed them up (allowing 0xFFFF to be considered either as part of the ramp or part of V1.)

BUG=skia:2481
R=reed@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/260523004

git-svn-id: http://skia.googlecode.com/svn/trunk@14479 2bbb7eff-a529-9590-31e7-b0007b416f81
tests/ClampRangeTest.cpp