Avoid SkFixed overflow in decal bitmap procs
authorFlorin Malita <fmalita@chromium.org>
Wed, 4 Jan 2017 18:01:55 +0000 (13:01 -0500)
committerSkia Commit-Bot <skia-commit-bot@chromium.org>
Fri, 6 Jan 2017 18:41:34 +0000 (18:41 +0000)
commit9953737bcf885a52c08ade6c503f2202e4dd9aa5
treed53ac822a3eec694d78b6a3c36daa99a4f1e7021
parent1c4717b54b21bc6c640864caf600ef16496803ec
Avoid SkFixed overflow in decal bitmap procs

The check for decal mode can overflow in SkFixed.  Promote to
64bit (48.16) instead.

Also update can_truncate_to_fixed_for_decal() to take SkFixed params and
used it in ClampX_ClampY_filter_scale_SSE2().

BUG=chromium:675444
R=reed@google.com

CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD

Change-Id: I759464cdaa5c005159e38e32167fb1937e2a1d28
Reviewed-on: https://skia-review.googlesource.com/6538
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
src/core/SkBitmapProcState_matrix.h
src/core/SkBitmapProcState_matrix_template.h
src/core/SkBitmapProcState_utils.h
src/opts/SkBitmapProcState_matrix_neon.h
src/opts/SkBitmapProcState_opts_SSE2.cpp