aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/private/SkFloatingPoint.h
Commit message (Collapse)AuthorAge
* Guard against buggy ucrt\math.h.Gravatar Mike Klein2016-11-28
| | | | | | | | | | | | | | BUG=666707 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5089 CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot Change-Id: I3bebfdf635d541d92fb84236f0f6fae2da39d691 Reviewed-on: https://skia-review.googlesource.com/5089 Reviewed-by: Bruce Dawson <brucedawson@google.com> Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* *SkTCast<int*>(float*) -> memcpyGravatar Mike Klein2016-09-29
| | | | | | | | | | | | | | | In some build configurations (I think, GN, GCC 6, Debug) I get a warning that i is used unintialized. This likely has something to do with GCC correctly seeing that the SkTCast construction there is illegal aliasing, and perhaps thus "doesn't happen". Might be that if the SkTCast gets inlined, it decides its implementation is secretly kosher, and so Release builds don't see this. None of this happens with the GCCs we have on the bots... too old? Instead use memcpy() here, which is well defined to do what we intended. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2758 Change-Id: Iaf5c75fbd852193b0b861bf5e71450502511d102 Reviewed-on: https://skia-review.googlesource.com/2758 Commit-Queue: Ben Wagner <bungeman@google.com> Reviewed-by: Ben Wagner <bungeman@google.com>
* constexpr NaN,+Inf,-InfGravatar mtklein2016-08-10
| | | | | | | | | | | | | | | | | | | | | | Reading extern values meant these couldn't be compile-time constants. math.h has INFINITY, which is macro that is supposed to expand to float +inf. On MSVC it seems it's natively a double, so we cast just to make sure. There's nan(const char*) in math.h for NaN too, but I don't trust that to be compile-time evaluated. So instead, we keep reinterpreting a bit pattern. I did try to write static constexpr float float_nan() { ... } and completely failed. constexpr seems a bit too restrictive in C++11 to make it work, but Clang kept telling me, you'll be able to do this with C++14. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2233853002 Review-Url: https://codereview.chromium.org/2233853002
* Move immintrin/arm_neon includes to where they are used.Gravatar mtklein2016-06-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | On my Mac (so, immintrin), this improves compile time, both wall and cpu, by about 16%. To test I ran this on an SSD with files hot in their caches: $ env CC=/usr/bin/clang CXX=/usr/bin/clang++ ./gyp_skia && \ ninja -C out/Release -t clean && \ time ninja -C out/Release Before: 159 wall / 3367 cpu 159 wall / 3368 cpu After: 137 wall / 2860 cpu 136 wall / 2863 cpu I also tried further refining immintrin down to emmintrin / tmmintrin / smmintrin etc. That made no signficant difference, so I've kept immintrin for its simplicity. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2045633002 CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot TBR=reed@google.com No public API changes. Committed: https://skia.googlesource.com/skia/+/12dfaaa53c23f3d03050bde8f64136ac1f44164a Review-Url: https://codereview.chromium.org/2045633002
* Revert of Move immintrin/arm_neon includes to where they are used. (patchset ↵Gravatar mtklein2016-06-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | #2 id:20001 of https://codereview.chromium.org/2045633002/ ) Reason for revert: Appears to have broken the ARMv7 aspect of the Google3 roll in bizarre seemingly-unrelated ways. Original issue's description: > Move immintrin/arm_neon includes to where they are used. > > On my Mac (so, immintrin), this improves compile time, both wall and cpu, > by about 16%. To test I ran this on an SSD with files hot in their caches: > > $ env CC=/usr/bin/clang CXX=/usr/bin/clang++ ./gyp_skia && \ > ninja -C out/Release -t clean && \ > time ninja -C out/Release > > Before: 159 wall / 3367 cpu > 159 wall / 3368 cpu > > After: 137 wall / 2860 cpu > 136 wall / 2863 cpu > > I also tried further refining immintrin down to emmintrin / tmmintrin / smmintrin etc. > That made no signficant difference, so I've kept immintrin for its simplicity. > > BUG=skia: > GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2045633002 > CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot > > TBR=reed@google.com > No public API changes. > > Committed: https://skia.googlesource.com/skia/+/12dfaaa53c23f3d03050bde8f64136ac1f44164a TBR=herb@google.com,mtklein@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review-Url: https://codereview.chromium.org/2046213002
* Move immintrin/arm_neon includes to where they are used.Gravatar mtklein2016-06-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | On my Mac (so, immintrin), this improves compile time, both wall and cpu, by about 16%. To test I ran this on an SSD with files hot in their caches: $ env CC=/usr/bin/clang CXX=/usr/bin/clang++ ./gyp_skia && \ ninja -C out/Release -t clean && \ time ninja -C out/Release Before: 159 wall / 3367 cpu 159 wall / 3368 cpu After: 137 wall / 2860 cpu 136 wall / 2863 cpu I also tried further refining immintrin down to emmintrin / tmmintrin / smmintrin etc. That made no signficant difference, so I've kept immintrin for its simplicity. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2045633002 CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot TBR=reed@google.com No public API changes. Review-Url: https://codereview.chromium.org/2045633002
* Add SkScalarTruncToScalar and speed up SkScalarFraction.Gravatar bungeman2016-03-10
| | | | | | GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1783583003 Review URL: https://codereview.chromium.org/1783583003
* Remove version checks for _MSC_VER < 1800 (msvs2013).Gravatar bungeman2016-03-10
| | | | | | | | | | | | We already actively do not support older versions of the vc++ compiler and runtime, so don't check for them anymore. TBR=reed No API changes. GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1777213003 Review URL: https://codereview.chromium.org/1777213003
* de-proc sk_float_rsqrtGravatar mtklein2016-01-26
| | | | | | | | | | | | This is the first of many little baby steps to have us stop runtime-detecting NEON. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1616013003 CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot Committed: https://skia.googlesource.com/skia/+/efcc125acd2d71eb077caf6db65fdd6b9eb1dc0d Review URL: https://codereview.chromium.org/1616013003
* Revert of de-proc sk_float_rsqrt (patchset #3 id:40001 of ↵Gravatar mtklein2016-01-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1616013003/ ) Reason for revert: This is somehow blocking the Google3 roll in ways neither Ben nor I understand. Precautionary revert... will try again Monday. Original issue's description: > de-proc sk_float_rsqrt > > This is the first of many little baby steps to have us stop runtime-detecting NEON. > > BUG=skia: > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1616013003 > CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot > > Committed: https://skia.googlesource.com/skia/+/efcc125acd2d71eb077caf6db65fdd6b9eb1dc0d TBR=reed@google.com,mtklein@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1629503002
* de-proc sk_float_rsqrtGravatar mtklein2016-01-22
| | | | | | | | | | This is the first of many little baby steps to have us stop runtime-detecting NEON. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1616013003 CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot Review URL: https://codereview.chromium.org/1616013003
* Revert[8] "move some public headers into private"Gravatar reed2015-08-17
| | | | | | | | | This reverts commit fb28cd2b13d76c324570341e1155aaadc1b532b6. BUG=skia: TBR= Review URL: https://codereview.chromium.org/1298833002
* Revert[7] "move some public headers into private"Gravatar reed2015-08-15
| | | | | | | | | This reverts commit e02716908fe82c7c4ae9b415793277620a22bcd6. BUG=skia: TBR= Review URL: https://codereview.chromium.org/1300523002
* Revert[6] "move some public headers into private"Gravatar reed2015-08-15
| | | | | | | | | This reverts commit cc1229c9d5e57b45305ba8f99ae33e92db0032bc. BUG=skia: TBR= Review URL: https://codereview.chromium.org/1295003002
* Revert "Revert[4] "move some public headers into private""Gravatar reed2015-08-12
| | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 33e00db73d5f1836481cf4053c64e4ed20537662. BUG=skia: TBR= NOTREECHECKS=True FAILED: /b/build/goma/gomacc ../../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF obj/components/user_manager/user_manager_test_support.fake_user_manager.o.d -DV8_DEPRECATION_WARNINGS -DCLD_VERSION=2 -D_FILE_OFFSET_BITS=64 -DCHROMIUM_BUILD -DCR_CLANG_REVISION=242792-1 -DCOMPONENT_BUILD -DUI_COMPOSITOR_IMAGE_TRANSPORT -DUSE_AURA=1 -DUSE_ASH=1 -DUSE_PANGO=1 -DUSE_CAIRO=1 -DUSE_DEFAULT_RENDER_THEME=1 -DUSE_LIBJPEG_TURBO=1 -DUSE_X11=1 -DIMAGE_LOADER_EXTENSION=1 -DENABLE_WEBRTC=1 -DENABLE_MEDIA_ROUTER=1 -DUSE_PROPRIETARY_CODECS -DENABLE_PEPPER_CDMS -DENABLE_CONFIGURATION_POLICY -DENABLE_NOTIFICATIONS -DENABLE_HIDPI=1 -DENABLE_TOPCHROME_MD=1 -DUSE_UDEV -DDONT_EMBED_BUILD_METADATA -DDCHECK_ALWAYS_ON=1 -DFIELDTRIAL_TESTING_ENABLED -DENABLE_TASK_MANAGER=1 -DENABLE_EXTENSIONS=1 -DENABLE_PLUGINS=1 -DENABLE_SESSION_SERVICE=1 -DENABLE_THEMES=1 -DENABLE_AUTOFILL_DIALOG=1 -DENABLE_BACKGROUND=1 -DENABLE_GOOGLE_NOW=1 -DENABLE_PRINTING=1 -DENABLE_PRINT_PREVIEW=1 -DENABLE_SPELLCHECK=1 -DENABLE_CAPTIVE_PORTAL_DETECTION=1 -DENABLE_APP_LIST=1 -DENABLE_SUPERVISED_USERS=1 -DENABLE_MDNS=1 -DENABLE_SERVICE_DISCOVERY=1 -DV8_USE_EXTERNAL_STARTUP_DATA -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DSAFE_BROWSING_SERVICE -DGTEST_HAS_POSIX_RE=0 -DGTEST_LANG_CXX11=0 -DUNIT_TEST -DGTEST_HAS_RTTI=0 -DUSE_LIBPCI=1 -DUSE_OPENSSL=1 -DUSE_GLIB=1 -DUSE_NSS_CERTS=1 -DOS_CHROMEOS=1 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DWTF_USE_DYNAMIC_ANNOTATIONS=1 -D_DEBUG -D_GLIBCXX_DEBUG=1 -Igen -I../.. -I../../skia/config -I../../testing/gmock/include -I../../testing/gtest/include -Werror -pthread -fno-strict-aliasing -Wall -Wno-unused-parameter -Wno-missing-field-initializers -fvisibility=hidden -pipe -fPIC -Wno-reserved-user-defined-literal -Xclang -load -Xclang /b/build/slave/linux_chromeos/build/src/third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.so -Xclang -add-plugin -Xclang find-bad-constructs -Xclang -plugin-arg-find-bad-constructs -Xclang check-templates -fcolor-diagnostics -B/b/build/slave/linux_chromeos/build/src/third_party/binutils/Linux_x64/Release/bin -Wheader-hygiene -Wno-char-subscripts -Wno-unneeded-internal-declaration -Wno-covered-switch-default -Wstring-conversion -Wno-c++11-narrowing -Wno-deprecated-register -Wno-inconsistent-missing-override -Wno-shift-negative-value -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -m64 -march=x86-64 -O0 -g -funwind-tables -gsplit-dwarf -Wno-undefined-bool-conversion -Wno-tautological-undefined-compare -g0 -fno-exceptions -fno-rtti -fno-threadsafe-statics -fvisibility-inlines-hidden -Wsign-compare -std=gnu++11 -c ../../components/user_manager/fake_user_manager.cc -o obj/components/user_manager/user_manager_test_support.fake_user_manager.o In file included from ../../components/user_manager/fake_user_manager.cc:5: In file included from ../../components/user_manager/fake_user_manager.h:12: In file included from ../../components/user_manager/user.h:14: In file included from ../../components/user_manager/user_image/user_image.h:12: In file included from ../../ui/gfx/image/image_skia.h:15: In file included from ../../ui/gfx/image/image_skia_rep.h:8: In file included from ../../third_party/skia/include/core/SkBitmap.h:11: In file included from ../../third_party/skia/include/core/SkColor.h:11: In file included from ../../third_party/skia/include/core/SkScalar.h:12: ../../third_party/skia/include/core/../private/SkFloatingPoint.h:13:10: fatal error: 'SkTypes.h' file not found #include "SkTypes.h" ninja -w dupbuild=err -C /b/build/slave/linux_chromeos/build/src/out/Debug accessibility_unittests accessibility_unittests_run app_list_unittests app_list_unittests_run app_shell_unittests app_shell_unittests_run ash_unittests ash_unittests_run aura_builder aura_unittests aura_unittests_run base_unittests base_unittests_run browser_tests browser_tests_run cacheinvalidation_unittests cacheinvalidation_unittests_run chromeos_unittests chromeos_unittests_run components_unittests components_unittests_run compositor_unittests compositor_unittests_run content_browsertests content_browsertests_run content_unittests content_unittests_run crypto_unittests crypto_unittests_run dbus_unittests device_unittests device_unittests_run display_unittests display_unittests_run events_unittests events_unittests_run extensions_browsertests extensions_browsertests_run extensions_unittests extensions_unittests_run gcm_unit_tests gcm_unit_tests_run gfx_unittests gfx_unittests_run google_apis_unittests google_apis_unittests_run gpu_unittests gpu_unittests_run interactive_ui_tests interactive_ui_tests_run ipc_tests ipc_tests_run jingle_unittests jingle_unittests_run media_unittests media_unittests_run message_center_unittests message_center_unittests_run midi_unittests midi_unittests_run nacl_helper_nonsfi_unittests nacl_loader_unittests nacl_loader_unittests_run net_unittests net_unittests_run ppapi_unittests printing_unittests printing_unittests_run remoting_unittests remoting_unittests_run sandbox_linux_unittests sandbox_linux_unittests_run skia_unittests skia_unittests_run sql_unittests sql_unittests_run sync_unit_tests sync_unit_tests_run ui_base_unittests ui_base_unittests_run ui_chromeos_unittests ui_touch_selection_unittests ui_touch_selection_unittests_run unit_tests unit_tests_run url_unittests url_unittests_run views_unittests wm_unittests wm_unittests_run -j50 ninja: Entering directory `/b/build/slave/linux_chromeos/build/src/out/Debug' Review URL: https://codereview.chromium.org/1288863002
* Revert[4] "move some public headers into private"Gravatar reed2015-08-12
| | | | | | | | | This reverts commit 9cdcabefa33d49febfdb45e388e762b4dee8dd6f. BUG=skia: TBR= Review URL: https://codereview.chromium.org/1291613007
* Revert[3] "move some public headers into private"Gravatar reed2015-08-12
| | | | | | | | | | | This reverts commit 9d20ee57d72a3850a6b51f2f2b00e00978be3864. BUG=skia: TBR= failures here: https://codereview.chromium.org/1286103004 Review URL: https://codereview.chromium.org/1290733002
* Revert[2] "move some public headers into private"Gravatar reed2015-08-12
| | | | | | | | | | This reverts commit 4cf9e7e14797f87f08b2078fa1afaf731cbf8f52. BUG=skia: TBR= NOTRY=True Review URL: https://codereview.chromium.org/1284173002
* Revert "move some public headers into private"Gravatar reed2015-08-11
| | | | | | | | | | This reverts commit eedf0fb20489bc6c3706539dd6ab499f41cbe048. BUG=skia: TBR= NOTRY=True Review URL: https://codereview.chromium.org/1270313005
* move some public headers into privateGravatar reed2015-08-11
BUG=skia: Review URL: https://codereview.chromium.org/1289483002