aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/PathOpsSimplifyTest.cpp
diff options
context:
space:
mode:
authorGravatar Bruce Dawson <brucedawson@google.com>2017-01-22 12:43:53 -0800
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-01-23 15:26:28 +0000
commitb07a01e6b9bd552bab12aabd48dc77a7562f4f97 (patch)
treedaf5d768d9282238c9780708ab6288fb517e180e /tests/PathOpsSimplifyTest.cpp
parent977f64cbfad1ecd7fd4b1231c694c7e828fda1f0 (diff)
Get rid of level of indirection, noticed by VC++ 2017 bug
When building Chrome with VC++ 2017 the QuickFDot6Inverse::table pointer is initialized to zero. This is certainly a bug, and it has been reported to the VC++ team. But, the table pointer appears to be unnecessary. Changing the code to reference the array directly should give identical or perhaps even better code. The change to the array indexing code is as follows: - return table[x]; + gFDot6INVERSE[kInverseTableSize + x]; This looks like a step backwards, but it isn't. 'table' is a pointer. So, by default the compiler will load this pointer and then load the value from the array. gFDot6INVERSE is an array, not a pointer. This means that the adding of kInverseTableSize is trivially done at compile time, and there is no loading of a pointer - only one data segment memory access is needed. The compiler may have realized that this optimization was ready before, but now it is more trivial. And, this works around the VC++ 2017 bug so that Chrome with VC++ 2017 will launch. https://connect.microsoft.com/VisualStudio/feedback/details/3119337 BUG=683729 Change-Id: Iad443b59a70af83b39260e244e3242e782fafdbb Reviewed-on: https://skia-review.googlesource.com/7284 Reviewed-by: Yuqian Li <liyuqian@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
Diffstat (limited to 'tests/PathOpsSimplifyTest.cpp')
0 files changed, 0 insertions, 0 deletions