diff options
author | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-10-21 16:41:00 +0000 |
---|---|---|
committer | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-10-21 16:41:00 +0000 |
commit | 4b7d6730898abc9e02d1e12c2fd732945f4c1ab4 (patch) | |
tree | b8f627aef9c4e8f41431e04bd866738c0748567b /tests/ColorTest.cpp | |
parent | f642f8cf90c8fd4111094026a1a9e9fdc92be9c3 (diff) |
More clang warning fixes.
Mostly unused functions and variables removed.
BUG=None
TEST=ninja -C out/Debug most
ninja -C out/Release most
R=bsalomon@google.com, caryclark@google.com, robertphillips@google.com
Author: tfarina@chromium.org
Review URL: https://codereview.chromium.org/27933002
git-svn-id: http://skia.googlecode.com/svn/trunk@11884 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tests/ColorTest.cpp')
-rw-r--r-- | tests/ColorTest.cpp | 102 |
1 files changed, 0 insertions, 102 deletions
diff --git a/tests/ColorTest.cpp b/tests/ColorTest.cpp index a720ff4eac..30dad88e24 100644 --- a/tests/ColorTest.cpp +++ b/tests/ColorTest.cpp @@ -16,108 +16,6 @@ #define GetPackedG16As32(packed) (SkGetPackedG16(dc) << (8 - SK_G16_BITS)) #define GetPackedB16As32(packed) (SkGetPackedB16(dc) << (8 - SK_B16_BITS)) -static inline bool S32A_D565_Blend_0(SkPMColor sc, uint16_t dc, U8CPU alpha) { - unsigned dst_scale = 255 - SkMulDiv255Round(SkGetPackedA32(sc), alpha); - unsigned dr = SkMulS16(SkPacked32ToR16(sc), alpha) + SkMulS16(SkGetPackedR16(dc), dst_scale); - unsigned dg = SkMulS16(SkPacked32ToG16(sc), alpha) + SkMulS16(SkGetPackedG16(dc), dst_scale); - - unsigned rr = SkDiv255Round(dr); - unsigned rg = SkDiv255Round(dg); - - if (rr <= 31 && rg <= 63) { - return true; - } - return false; -} - -static inline bool S32A_D565_Blend_01(SkPMColor sc, uint16_t dc, U8CPU alpha) { - unsigned dst_scale = 255 - SkMulDiv255Round(SkGetPackedA32(sc), alpha); - unsigned dr = SkMulS16(SkGetPackedR32(sc), alpha) + SkMulS16(SkGetPackedR16(dc) << 3, dst_scale); - unsigned dg = SkMulS16(SkGetPackedG32(sc), alpha) + SkMulS16(SkGetPackedG16(dc) << 2, dst_scale); - - unsigned rr = SkDiv255Round(dr) >> 3; - unsigned rg = SkDiv255Round(dg) >> 2; - - if (rr <= 31 && rg <= 63) { - return true; - } - return false; -} - -static inline bool S32A_D565_Blend_02(SkPMColor sc, uint16_t dc, U8CPU alpha) { - unsigned dst_scale = 255 - SkMulDiv255Round(SkGetPackedA32(sc), alpha); - unsigned dr = SkMulS16(SkGetPackedR32(sc), alpha) + SkMulS16(GetPackedR16As32(dc), dst_scale); - unsigned dg = SkMulS16(SkGetPackedG32(sc), alpha) + SkMulS16(GetPackedG16As32(dc), dst_scale); - unsigned db = SkMulS16(SkGetPackedB32(sc), alpha) + SkMulS16(GetPackedB16As32(dc), dst_scale); - int rc = SkPack888ToRGB16(SkDiv255Round(dr), - SkDiv255Round(dg), - SkDiv255Round(db)); - - unsigned rr = SkGetPackedR16(rc); - unsigned rg = SkGetPackedG16(rc); - - if (rr <= 31 && rg <= 63) { - return true; - } - return false; -} - -static inline bool S32A_D565_Blend_1(SkPMColor sc, uint16_t dc, U8CPU alpha) { - unsigned dst_scale = 255 - SkMulDiv255Round(SkGetPackedA32(sc), alpha); - unsigned dr = (SkMulS16(SkGetPackedR32(sc), alpha) >> 3) + SkMulS16(SkGetPackedR16(dc), dst_scale); - unsigned dg = (SkMulS16(SkGetPackedG32(sc), alpha) >> 2) + SkMulS16(SkGetPackedG16(dc), dst_scale); - - unsigned rr = SkDiv255Round(dr); - unsigned rg = SkDiv255Round(dg); - - if (rr <= 31 && rg <= 63) { - return true; - } - return false; -} - -static inline int SkDiv65025Round(int x) { - return (x + 65025/2) / 65025; -// return x / 65025; -} -static inline bool S32A_D565_Blend_2(SkPMColor sc, uint16_t dc, U8CPU alpha) { - unsigned dst_scale = 255*255 - SkGetPackedA32(sc) * alpha; - alpha *= 255; - unsigned dr = (SkGetPackedR32(sc) >> 3) * alpha + SkGetPackedR16(dc) * dst_scale; - unsigned dg = (SkGetPackedG32(sc) >> 2) * alpha + SkGetPackedG16(dc) * dst_scale; - - unsigned rr = SkDiv65025Round(dr); - unsigned rg = SkDiv65025Round(dg); - - if (rr <= 31 && rg <= 63) { - return true; - } - return false; -} - -static inline void test_565blend() { - int total_failures = 0; - for (int global_alpha = 0; global_alpha <= 255; ++global_alpha) { - int failures = 0; - int total = 0; - for (int src_a = 0; src_a <= 255; ++src_a) { - for (int src_c = 0; src_c <= src_a; ++src_c) { - SkPMColor sc = SkPackARGB32(src_a, src_c, src_c, src_c); - for (int dst_r = 0; dst_r <= 31; ++dst_r) { - for (int dst_g = 0; dst_g <= 63; ++dst_g) { - uint16_t dc = SkPackRGB16(dst_r, dst_g, dst_r); - failures += !S32A_D565_Blend_0(sc, dc, global_alpha); - total += 1; - } - } - } - } - SkDebugf("global_alpha=%d failures=%d total=%d %g\n", global_alpha, failures, total, failures * 100.0 / total); - total_failures += failures; - } - SkDebugf("total failures %d\n", total_failures); -} - static inline void test_premul(skiatest::Reporter* reporter) { for (int a = 0; a <= 255; a++) { for (int x = 0; x <= 255; x++) { |