aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/private/SkTLogic.h
Commit message (Collapse)AuthorAge
* require std::is_trivially_destructibleGravatar Mike Klein2018-06-07
| | | | | | | | Change-Id: I78cbaf420ad1e16f07eacb8b4c6c825fe849b08a Reviewed-on: https://skia-review.googlesource.com/132825 Auto-Submit: Mike Klein <mtklein@chromium.org> Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Herb Derby <herb@google.com>
* Compute inverse gamma table at compile time.Gravatar Ben Wagner2017-10-18
| | | | | | | | | | | | | | | | | | | This introduces skstd::index_sequence and skstd::make_index_sequence so that these can be used in C++11. These are mostly equivalent to their std:: counterparts. This also introduces SkMakeArray<N, C> which is constexpr and creates a std::array with N elements with each element being initialized with the value of C(i) where i is the index of the element. These are then used to create inverse gamma table at compile time. This avoids threading issues. BUG=skia:7187 Change-Id: I61fb10a778898652e546d54c104a08d6e6bf88d3 Reviewed-on: https://skia-review.googlesource.com/61380 Commit-Queue: Ben Wagner <bungeman@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
* Fix syntax error for adjusting old stdc++ headers.Gravatar Herb Derby2017-01-13
| | | | | | | | Change-Id: Ibc99ae943b275b770e8767b80400b8e1520e70a5 Reviewed-on: https://skia-review.googlesource.com/7035 Commit-Queue: Herb Derby <herb@google.com> Commit-Queue: Ben Wagner <bungeman@google.com> Reviewed-by: Ben Wagner <bungeman@google.com>
* Introduce SkArenaAlloc - should be fast for POD types and RAII for types ↵Gravatar Herb Derby2017-01-13
| | | | | | | | | | | | | | with dtors. - Implementation. - Use in SkLinearPipeline. TBR=mtklein@google.com Change-Id: Ie014184469b217132b0307b5a9ae40c0c60e5fc9 Reviewed-on: https://skia-review.googlesource.com/6921 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Herb Derby <herb@google.com>
* Remove skstd::is_function.Gravatar bungeman2016-04-29
| | | | | | | The VC++ STL with 2015u2 now provides a complete std::is_function. Also, Skia is no longer using skstd::is_function. Review-Url: https://codereview.chromium.org/1929343002
* Remove skstd::is_convertible.Gravatar bungeman2016-04-28
| | | | | | | | | We should now be able to use std::is_convertible. TBR=reed@google.com This doesn't change any API, just where we get a type trait from. Review-Url: https://codereview.chromium.org/1931003002
* Templatize SkToXXX.Gravatar bungeman2016-03-19
| | | | | | | | | | | Makes the checked cast in debug more correct, avoiding new warnings in vs2015. BUG=skia:4553 Committed: https://skia.googlesource.com/skia/+/0be9e806af72b3e029e691eef5c891c90d3fd320 Review URL: https://codereview.chromium.org/1814153003
* Revert of Templatize SkToXXX. (patchset #2 id:20001 of ↵Gravatar bungeman2016-03-18
| | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1814153003/ ) Reason for revert: Chrome does not yet have std::underlying_type. Original issue's description: > Templatize SkToXXX. > > Makes the checked cast in debug more correct, avoiding new > warnings in vs2015. > > BUG=skia:4553 > > Committed: https://skia.googlesource.com/skia/+/0be9e806af72b3e029e691eef5c891c90d3fd320 TBR=reed@google.com,mtklein@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia:4553 Review URL: https://codereview.chromium.org/1820433002
* Templatize SkToXXX.Gravatar bungeman2016-03-18
| | | | | | | | | Makes the checked cast in debug more correct, avoiding new warnings in vs2015. BUG=skia:4553 Review URL: https://codereview.chromium.org/1814153003
* Add element_type, swap, operators, fix reset on sk_sp.Gravatar bungeman2016-03-08
| | | | | | | | | | | | | | | The 'element_type' typedef is to play nice with std::pointer_traits. The full complement of operators and swap to match unique_ptr so that sk_sp can be properly compared to nullptr and used with standard containers. Update to 'reset' so that calling 'unref' is the last operation. This also adds tests for these changes, and sets the fPtr to nullptr in debug for easier bug finding. Review URL: https://codereview.chromium.org/1773453002
* Fixed compilation on mingw.Gravatar cjacek2016-01-25
| | | | | | | | | Found and tested in mingw Firefox build. There are two problems: - GCC doesn't support __vectorcall calling convention, so its usage needs to be #ifdefed - GetProcAddress returns FARPROC type (a function pointer) and GCC requires an explicit cast to void* Review URL: https://codereview.chromium.org/1589933002
* Use ::std for is_empty, is_class, add_xxx_reference, remove decay.Gravatar bungeman2016-01-08
| | | | | | | | | | | | | | | | | SkTLogic.h contains implemenetations of is_empty, is_class, decay, decay_t, add_lvalue_reference, add_rvalue_reference, and add_rvalue_reference_t. The declaration of is_class is only used by is_empty. The current implementation of is_empty will not work correctly with 'final'. The current implementation of add_lvalue_reference does not support clarifications in c++17. No Skia code is currently using decay, decay_t, add_rvalue_reference, and add_rvalue_reference_t. In addition, there are no known issues with any of these in ::std with any supported compiler. The implementations of is_function and is_convertible are commented to note why they are still present. Review URL: https://codereview.chromium.org/1567123006
* More <type_traits> for SkTLogic.h.Gravatar bungeman2016-01-07
| | | | | | | | | | SkTLogic.h specifies a number of declarations now found in <type_traits>. This removes some of these declarations from SkTLogic.h in favor of the ::std versions. These declarations are fairly safe to change as the implementations are striaght forward and no known stl implementations are known to have issues with them. Review URL: https://codereview.chromium.org/1565283003
* Add skstd::remove_pointer_t and use it.Gravatar bungeman2016-01-06
| | | | | | | | This replaces an existing incomplete implementation. This also makes it easier to update the current use in the future when switching to <type_traits>. Review URL: https://codereview.chromium.org/1555153002
* Start using <type_traits> and <utility> (C++11).Gravatar bungeman2016-01-05
| | | | | | | | | | | | | | SkUtility.h and SkTLogic.h implement a number of type traits now available through <type_traits> and <utility>. This removes SkUtility.h, replacing it with <utility>, and moves a number of traits in SkTLogic.h to use the std:: equivelents. This change only uses C++11 parts of the standard library; SkTLogic.h will continue to provide C++14 and beyond for now in the skstd namespace. The changes to SkTLogic.h are being done gradually so that safe changes may be landed confidently, with more risky changes in the future. Review URL: https://codereview.chromium.org/1561683002
* check that SSE2 is available before using __vectorcallGravatar lsalzman2015-12-01
| | | | | | BUG=skia:4563 Review URL: https://codereview.chromium.org/1489873002
* simplify code in SkRecords.hGravatar mtklein2015-09-28
| | | | | | | | | | | | | | | | - use C++11 features ({} init, move constructors) to eliminate the need for explicit constructors - collapse RECORD0...RECORD8 into just one RECORD macro - explicitly tag record types instead of using member detectors. Removing member detectors makes this code significantly less fragile. This exposes a few places where we didn't really think through what to do with SkDrawable. I've marked them TODO for now. BUG=skia: Review URL: https://codereview.chromium.org/1360943003
* Add skstd::unique_ptr and use it.Gravatar bungeman2015-09-07
| | | | | | | TBR=bsalomon@google.com The one gpu include change is just to fix swap in implementation. Review URL: https://codereview.chromium.org/1330503006
* Clean up SkTLogic.Gravatar bungeman2015-08-28
| | | | | | | | | This change regularizes Skia's type traits so that when <type_traits> can finally be used the transition is easier. Various traits are renamed to match <type_traits> and placed in the skstd namespace. Current users of these traits are updated. Review URL: https://codereview.chromium.org/1317593004
* Remove SK_OFFSETOF from SkTypes, clean up offsetof usage.Gravatar bungeman2015-08-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The motivation for this was to remove SK_OFFSETOF from SkTypes, but this CL is mostly about cleaning up our use of offsetof generally. SK_OFFSETOF is removed to SkTypes and added to the two places it is actually used (for the non standard behavior of finding the offset of fields in types which are not standard layout). Older versions of gcc required POD for offsetof to be used without warning. Newer versions require the more relaxed standard layout. Now that we no longer build on older versions of gcc, remove the old warning suppressions. PODMatrix is renamed to AggregateMatrix. SkMatrix is already POD (trivial and standard layout). The PODMatrix name implies that the POD-ness is needed for the offsetof, but it is actually the aggregate attribute which is needed for compile time constant initialization. This makes it more obvious that this can be revisited after we can rely on constexpr constructors. This also adds skstd::declval since this allows removal of existing awkward code which casts a constant to a pointer to find the size of a field. TBR=reed@google.com No API change, only removes unused macro. Review URL: https://codereview.chromium.org/1309523003
* Add skstd::move and skstd::forward.Gravatar bungeman2015-08-05
| | | | | | | | | | Since we can't use the c++11 standard library, re-implement the bits we want to use now. TBR=reed@google.com The next CL is try to move SkTemplates into private. Review URL: https://codereview.chromium.org/1273813002
* Move SkTHash.h to include/private.Gravatar mtklein2015-07-28
| | | | | | | | | | | | | | | include/views/SkOSWindow_Win.h includes it. To move SkTHash.h to include/private, SkChecksum.h needs to go there too. To move SkChecksum.h to include/private, SkTLogic needs to go there too. This adds a bunch of -Iinclude/private to tools.gyp I missed in the last CL. No public API changes. TBR=reed@google.com BUG=skia:4126 Review URL: https://codereview.chromium.org/1260613006
* Revert "Move headers used by headers in include/ to include/private."Gravatar Mike Klein2015-07-01
| | | | | | | | This reverts commit 928e16565f3e69cd6661e9ad300ac17e3f33c0c8. BUG=skia: Review URL: https://codereview.chromium.org/1213093004.
* Move headers used by headers in include/ to include/private.Gravatar mtklein2015-07-01
| | | | | | | | | | | Some of this is transitive, like SkRecords.h used by SkMiniRecorder.h used by (public) SkPictureRecorder.h. BUG=skia: Committed: https://skia.googlesource.com/skia/+/a89f55198bdc58f0b6f6196907ab25a6afc1a661 Review URL: https://codereview.chromium.org/1217293004
* Revert "Move headers used by headers in include/ to include/private."Gravatar jvanverth2015-07-01
| | | | | | | | | | | | | This reverts commit a89f55198bdc58f0b6f6196907ab25a6afc1a661. Reason: breaking the roll. TBR=mtklein@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/1216033008
* Move headers used by headers in include/ to include/private.Gravatar mtklein2015-07-01
Some of this is transitive, like SkRecords.h used by SkMiniRecorder.h used by (public) SkPictureRecorder.h. BUG=skia: Review URL: https://codereview.chromium.org/1217293004