aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/private
Commit message (Collapse)AuthorAge
* Clean up SkFloatBitsGravatar mtklein2016-05-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - remove dead code - rewrite float -> int converters The strategy for the new converters is: - convert input to double - floor/ceil/round in double space - pin that double to [SK_MinS32, SK_MaxS32] - truncate that double to int32_t This simpler strategy does not work: - floor/ceil/round in float space - pin that float to [SK_MinS32, SK_MaxS32] - truncate that float to int32_t SK_MinS32 and SK_MaxS32 are not representable as floats: they round to the nearest float, ±2^31, which makes the pin insufficient for floats near SK_MinS32 (-2^31+1) or SK_MaxS32 (+2^31-1). float only has 24 bits of precision, and we need 31. double can represent all integers up to 50-something bits. An alternative is to pin in float to ±2147483520, the last exactly representable float before SK_MaxS32 (127 too small). Our tests test that we round as floor(x+0.5), which can return different numbers than round(x) for negative x. So this CL explicitly uses floor(x+0.5). I've updated the tests with ±inf and ±NaN, and tried to make them a little clearer, especially using SK_MinS32 instead of -SK_MaxS32. I have not timed anything here. I have never seen any of these methods in a profile. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2012333003 Review-Url: https://codereview.chromium.org/2012333003
* Implement vulkan fence syncs for nanobenchGravatar bsalomon2016-05-16
| | | | | | GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1974913003 Review-Url: https://codereview.chromium.org/1974913003
* Remove Sk(Float|Double)PinToFixed functions, only used in tests.Gravatar brianosman2016-05-06
| | | | | | | | | | These were triggering compile-time floating point overflow for one user, and we don't use them. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1952303005 Review-Url: https://codereview.chromium.org/1952303005
* SkOncePtr -> SkOnceGravatar mtklein2016-05-05
| | | | | | | | | | | | | | | | It's always nice to kill off a synchronization primitive. And while less terse, I think this new code reads more clearly. ... and, SkOncePtr's tests were the only thing now using sk_num_cores() outside of SkTaskGroup, so I've hidden it as static inside SkTaskGroup.cpp. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1953533002 CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot Committed: https://skia.googlesource.com/skia/+/9bd3fc7fa9bb7cad050bd619aa93d4c48ebb5c02 Review-Url: https://codereview.chromium.org/1953533002
* Modernize SkMutex and SkSemaphore.Gravatar mtklein2016-05-05
| | | | | | | | | | | | | | | | | | | | | - use <atomic> - fuse SkMutex and SkBaseMutex - fuse SkSemaphore and SkBaseSemaphore Still TODO: - replace SK_DECLARE_STATIC_MUTEX(name) with static SkMutex name I just didn't want to bother fixing all that up until I know this CL sticks. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1947153002 No public API changes. TBR=reed@google.com Committed: https://skia.googlesource.com/skia/+/427c2819d9237d7d7729c59238036cfc73c072ea Review-Url: https://codereview.chromium.org/1947153002
* Revert of SkOncePtr -> SkOnce (patchset #1 id:1 of ↵Gravatar reed2016-05-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1949313003/ ) Reason for revert: ok, I have no idea what's going on Original issue's description: > Reland of SkOncePtr -> SkOnce (patchset #1 id:1 of https://codereview.chromium.org/1945293004/ ) > > Reason for revert: > previous revert unneeded (I think) > > Original issue's description: > > Revert of SkOncePtr -> SkOnce (patchset #4 id:60001 of https://codereview.chromium.org/1953533002/ ) > > > > Reason for revert: > > broken the Mac and Linux builders, e.g.: > > > > https://build.chromium.org/p/chromium/builders/Mac/builds/15151 > > https://build.chromium.org/p/chromium/builders/Linux%20x64/builds/19052 > > > > Original issue's description: > > > SkOncePtr -> SkOnce > > > > > > It's always nice to kill off a synchronization primitive. > > > And while less terse, I think this new code reads more clearly. > > > > > > ... and, SkOncePtr's tests were the only thing now using sk_num_cores() > > > outside of SkTaskGroup, so I've hidden it as static inside SkTaskGroup.cpp. > > > > > > BUG=skia: > > > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1953533002 > > > CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot > > > > > > Committed: https://skia.googlesource.com/skia/+/9bd3fc7fa9bb7cad050bd619aa93d4c48ebb5c02 > > > > 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: > > > > Committed: https://skia.googlesource.com/skia/+/7eb33da7eede34c050b865dbb1b60c3dcea7191b > > 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: > > Committed: https://skia.googlesource.com/skia/+/82da9a8aa0ce648f36882830765b42e0ada6c0fa 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/1948313002
* Reland of SkOncePtr -> SkOnce (patchset #1 id:1 of ↵Gravatar reed2016-05-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1945293004/ ) Reason for revert: previous revert unneeded (I think) Original issue's description: > Revert of SkOncePtr -> SkOnce (patchset #4 id:60001 of https://codereview.chromium.org/1953533002/ ) > > Reason for revert: > broken the Mac and Linux builders, e.g.: > > https://build.chromium.org/p/chromium/builders/Mac/builds/15151 > https://build.chromium.org/p/chromium/builders/Linux%20x64/builds/19052 > > Original issue's description: > > SkOncePtr -> SkOnce > > > > It's always nice to kill off a synchronization primitive. > > And while less terse, I think this new code reads more clearly. > > > > ... and, SkOncePtr's tests were the only thing now using sk_num_cores() > > outside of SkTaskGroup, so I've hidden it as static inside SkTaskGroup.cpp. > > > > BUG=skia: > > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1953533002 > > CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot > > > > Committed: https://skia.googlesource.com/skia/+/9bd3fc7fa9bb7cad050bd619aa93d4c48ebb5c02 > > 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: > > Committed: https://skia.googlesource.com/skia/+/7eb33da7eede34c050b865dbb1b60c3dcea7191b 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/1949313003
* Revert of Modernize SkMutex and SkSemaphore. (patchset #2 id:20001 of ↵Gravatar sclittle2016-05-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1947153002/ ) Reason for revert: This CL seems to have broken the Linux x64 and Mac bots, e.g. https://build.chromium.org/p/chromium/builders/Linux%20x64/builds/19052 https://build.chromium.org/p/chromium/builders/Mac/builds/15151 The error appears to have something to do with new static initializers being added. Original issue's description: > Modernize SkMutex and SkSemaphore. > > - use <atomic> > - fuse SkMutex and SkBaseMutex > - fuse SkSemaphore and SkBaseSemaphore > > Still TODO: > - replace SK_DECLARE_STATIC_MUTEX(name) with static SkMutex name > > I just didn't want to bother fixing all that up until I know this CL sticks. > > BUG=skia: > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1947153002 > > No public API changes. > TBR=reed@google.com > > Committed: https://skia.googlesource.com/skia/+/427c2819d9237d7d7729c59238036cfc73c072ea TBR=herb@google.com,mtklein@chromium.org,reed@google.com,bsalomon@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=609340 Review-Url: https://codereview.chromium.org/1945343003
* Revert of SkOncePtr -> SkOnce (patchset #4 id:60001 of ↵Gravatar reed2016-05-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1953533002/ ) Reason for revert: broken the Mac and Linux builders, e.g.: https://build.chromium.org/p/chromium/builders/Mac/builds/15151 https://build.chromium.org/p/chromium/builders/Linux%20x64/builds/19052 Original issue's description: > SkOncePtr -> SkOnce > > It's always nice to kill off a synchronization primitive. > And while less terse, I think this new code reads more clearly. > > ... and, SkOncePtr's tests were the only thing now using sk_num_cores() > outside of SkTaskGroup, so I've hidden it as static inside SkTaskGroup.cpp. > > BUG=skia: > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1953533002 > CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot > > Committed: https://skia.googlesource.com/skia/+/9bd3fc7fa9bb7cad050bd619aa93d4c48ebb5c02 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/1945293004
* Revert of SK_DECLARE_STATIC_MUTEX -> static SkMutex (patchset #1 id:1 of ↵Gravatar reed2016-05-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1948193002/ ) Reason for revert: broken the Mac and Linux builders, e.g.: https://build.chromium.org/p/chromium/builders/Mac/builds/15151 https://build.chromium.org/p/chromium/builders/Linux%20x64/builds/19052 Original issue's description: > SK_DECLARE_STATIC_MUTEX -> static SkMutex > > There's no need to use a macro to declare static SkMutexes any more > (and there's likewise no need to restrict them to global scope). > > BUG=skia: > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1948193002 > > Committed: https://skia.googlesource.com/skia/+/5e56cfd3fa1041dbb83899844fb92fa9a2ef1009 TBR=mtklein@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/1945353003
* SK_DECLARE_STATIC_MUTEX -> static SkMutexGravatar mtklein2016-05-04
| | | | | | | | | | There's no need to use a macro to declare static SkMutexes any more (and there's likewise no need to restrict them to global scope). BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1948193002 Review-Url: https://codereview.chromium.org/1948193002
* SkOncePtr -> SkOnceGravatar mtklein2016-05-04
| | | | | | | | | | | | | | It's always nice to kill off a synchronization primitive. And while less terse, I think this new code reads more clearly. ... and, SkOncePtr's tests were the only thing now using sk_num_cores() outside of SkTaskGroup, so I've hidden it as static inside SkTaskGroup.cpp. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1953533002 CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot Review-Url: https://codereview.chromium.org/1953533002
* Simplify implementation of SkOnce to not need so many comments.Gravatar mtklein2016-05-04
| | | | | | | | | | | | I think this version reads more clearly, and the key invariants are expressed in code rather than comments: - race losers always go through an acquire - we never exit the function unless fState is Done BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1951013004 Review-Url: https://codereview.chromium.org/1951013004
* Add Gr*Proxy classesGravatar robertphillips2016-05-04
| | | | | | | | | | | | This isn't wired in anywhere yet. GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1937553002 Committed: https://skia.googlesource.com/skia/+/de5bf0cfeca908b81a28cc50065f7bc2da3d2fd1 Committed: https://skia.googlesource.com/skia/+/92605b35efa0155c44d24bd8415b4cc1db8831db Review-Url: https://codereview.chromium.org/1937553002
* Modernize SkMutex and SkSemaphore.Gravatar mtklein2016-05-04
| | | | | | | | | | | | | | | | | | | - use <atomic> - fuse SkMutex and SkBaseMutex - fuse SkSemaphore and SkBaseSemaphore Still TODO: - replace SK_DECLARE_STATIC_MUTEX(name) with static SkMutex name I just didn't want to bother fixing all that up until I know this CL sticks. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1947153002 No public API changes. TBR=reed@google.com Review-Url: https://codereview.chromium.org/1947153002
* Revert of Add Gr*Proxy classes (patchset #10 id:220001 of ↵Gravatar robertphillips2016-05-03
| | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1937553002/ ) Reason for revert: ASAN Original issue's description: > Add Gr*Proxy classes > > This isn't wired in anywhere yet. > > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1937553002 > > Committed: https://skia.googlesource.com/skia/+/de5bf0cfeca908b81a28cc50065f7bc2da3d2fd1 > > Committed: https://skia.googlesource.com/skia/+/92605b35efa0155c44d24bd8415b4cc1db8831db TBR=bsalomon@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review-Url: https://codereview.chromium.org/1944953002
* Add Gr*Proxy classesGravatar robertphillips2016-05-03
| | | | | | | | | | This isn't wired in anywhere yet. GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1937553002 Committed: https://skia.googlesource.com/skia/+/de5bf0cfeca908b81a28cc50065f7bc2da3d2fd1 Review-Url: https://codereview.chromium.org/1937553002
* Revert of Add Gr*Proxy classes (patchset #9 id:160001 of ↵Gravatar robertphillips2016-05-03
| | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1937553002/ ) Reason for revert: Seems to be breaking N7 & ANGLE bots Original issue's description: > Add Gr*Proxy classes > > This isn't wired in anywhere yet. > > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1937553002 > > Committed: https://skia.googlesource.com/skia/+/de5bf0cfeca908b81a28cc50065f7bc2da3d2fd1 TBR=bsalomon@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review-Url: https://codereview.chromium.org/1949463002
* Add Gr*Proxy classesGravatar robertphillips2016-05-03
| | | | | | | | This isn't wired in anywhere yet. GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1937553002 Review-Url: https://codereview.chromium.org/1937553002
* remove non-static uses of SkOncePtrGravatar mtklein2016-05-02
| | | | | | | | | | | | | | | | | | | | | | | Still slowly working through all the SK_DECLARE_STATIC_FOO macros. SkOncePtr is complicating things by having SkOncePtr delete its pointer and SkBaseOncePtr not. Simplify things by removing SkOncePtr, leaving only the leaky SkBaseOncePtr. We replace SkOncePtr<T> instead with SkOnce and T. In most cases this did not need to be a pointer, and in some cases here we're even saving a few bytes by replacing SkOncePtr<T> with SkOnce and a T. The dependency map of SK_DECLARE_STATIC_FOO is: SkBaseMutex -> SkBaseSemaphore -> SkBaseOncePtr They're intertwined enough that I think I've got to do all three in one next CL. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1939503002 Review-Url: https://codereview.chromium.org/1939503002
* Add reminders that these classes have constexpr default constructors.Gravatar mtklein2016-04-29
| | | | | | | | We can do this now that we can write "constexpr". GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1936653002 Review-Url: https://codereview.chromium.org/1936653002
* 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
* remove SK_SUPPORT_LEGACY_DIVBITS_UB -- chrome no longer defines thisGravatar reed2016-04-27
| | | | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1927823002 TBR=mtklein@google.com Review-Url: https://codereview.chromium.org/1927823002
* SkDefaultColorProfile: Hide gDefaultProfileIsSRGBGravatar halcanary2016-04-25
| | | | | | GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1917443002 Review URL: https://codereview.chromium.org/1917443002
* Fix indentation and casts in SkTArray.Gravatar bungeman2016-04-21
| | | | Review URL: https://codereview.chromium.org/1902423007
* SkTArray: fix invalid reinterpret_casts over non-initialized memory.Gravatar krasin2016-04-21
| | | | | | | | | This should fix 'CFI Linux' buildbot, which is currently horribly broken: https://build.chromium.org/p/chromium.fyi/builders/CFI%20Linux/builds/5115 BUG=605337 Review URL: https://codereview.chromium.org/1908763002
* Make all the codecs default profiles based on gTreatSkColorAsSRGB.Gravatar herb2016-04-20
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1893203006 Review URL: https://codereview.chromium.org/1893203006
* SkOnce: 2 bytes -> 1 byteGravatar mtklein2016-04-20
| | | | | | | | | | | | | | | | | | | | | | | | This uses the same logic we worked out for SkOncePtr to reduce the memory footprint of SkOnce from a done byte and lock byte to a single 3-state byte: - NotStarted: no thread has tried to run fn() yet - Active: a thread is running fn() - Done: fn() is complete Threads which see Done return immediately. Threads which see NotStarted try to move to Active, run fn(), then move to Done. Threads which see Active spin until the active thread moves to Done. This additionally fixes a too-weak memory order bug in SkOncePtr, and adds a big note to explain. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1904483003 Committed: https://skia.googlesource.com/skia/+/df02d338be8e3c1c50b48a3a9faa582703a39c07 Review URL: https://codereview.chromium.org/1904483003
* Revert of SkOnce: 2 bytes -> 1 byte (patchset #4 id:60001 of ↵Gravatar mtklein2016-04-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1904483003/ ) Reason for revert: bust the roll Original issue's description: > SkOnce: 2 bytes -> 1 byte > > This uses the same logic we worked out for SkOncePtr to reduce > the memory footprint of SkOnce from a done byte and lock byte > to a single 3-state byte: > > - NotStarted: no thread has tried to run fn() yet > - Active: a thread is running fn() > - Done: fn() is complete > > Threads which see Done return immediately. > Threads which see NotStarted try to move to Active, run fn(), then move to Done. > Threads which see Active spin until the active thread moves to Done. > > This additionally fixes a too-weak memory order bug in SkOncePtr, > and adds a big note to explain. > > BUG=skia: > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1904483003 > > Committed: https://skia.googlesource.com/skia/+/df02d338be8e3c1c50b48a3a9faa582703a39c07 TBR=herb@google.com # 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/1898413004
* SkOnce: 2 bytes -> 1 byteGravatar mtklein2016-04-20
| | | | | | | | | | | | | | | | | | | | | | This uses the same logic we worked out for SkOncePtr to reduce the memory footprint of SkOnce from a done byte and lock byte to a single 3-state byte: - NotStarted: no thread has tried to run fn() yet - Active: a thread is running fn() - Done: fn() is complete Threads which see Done return immediately. Threads which see NotStarted try to move to Active, run fn(), then move to Done. Threads which see Active spin until the active thread moves to Done. This additionally fixes a too-weak memory order bug in SkOncePtr, and adds a big note to explain. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1904483003 Review URL: https://codereview.chromium.org/1904483003
* SkTArray movable and swap for move only elements.Gravatar bungeman2016-04-20
| | | | | | | | SkTArray cannot currently contain move only elements because its swap currently requires the SkTArray to be copyable. This makes SkTArray movable and makes its swap move instead of copy. Review URL: https://codereview.chromium.org/1904663004
* Modernize and trim down SkOnce.Gravatar mtklein2016-04-18
| | | | | | | | | | | | | | | | | | | | | | | | | | The API and implementation are very much simplified. You may not want to bother reading the diff. As is our trend, SkOnce now uses <atomic> directly. Member initialization means we don't need SK_DECLARE_STATIC_ONCE. SkSpinlock already works this same way. All uses of the old API taking an external bool* and Lock* were pessimal, so I have not carried this sort of API forward. It's simpler, faster, and more space-efficient to always use this single SkOnce class interface. SkOnce weighs 2 bytes: a done bool and an SkSpinlock, also a bool internally. This API refactoring opens up the opportunity to fuse those into a single three-state byte if we'd like. No public API changes. TBR=reed@google.com BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1894893002 Review URL: https://codereview.chromium.org/1894893002
* Convert SkRefCnt to std::atomic.Gravatar bungeman2016-04-08
| | | | | | | | | | | This enables removing the more complicated atomic shims from SkAtomics.h. TBR=reed This doesn't actually change any API. CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-TSAN-Trybot,Test-Ubuntu-GCC-Golo-GPU-GT610-x86_64-Release-TSAN-Trybot Review URL: https://codereview.chromium.org/1867863002
* Revert of For *ToFixed, in debug mode, assert that the value is in range. ↵Gravatar fmalita2016-04-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (patchset #6 id:140001 of https://codereview.chromium.org/1824733002/ ) Reason for revert: Asserts in Blink rolls: https://storage.googleapis.com/chromium-layout-test-archives/linux_blink_rel/84520/layout-test-results/results.html STDERR: [1:1:0407/120919:1455366829:INFO:SkFixed.h(88)] ../../third_party/skia/include/private/SkFixed.h:88: fatal error: ""truncf(x * (1 << 16)) == static_cast<float> Original issue's description: > For *ToFixed, in debug mode, assert that the value is in range. > > Use SkFloatPinToFixed in SkTwoPointConicalGradient.cpp because it is failing in DM. fmalita is working on replacing this code with the 4f version, so I'm not bothering to fix it. (The beginnings of a real fix are in https://codereview.chromium.org/1767163003, which I do not plan to commit.) > > BUG=skia:4632 > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1824733002 > > Committed: https://skia.googlesource.com/skia/+/93dc33972cd6a418e84270298b856d2de08d9c1c TBR=mtklein@google.com,reed@google.com,benjaminwagner@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia:4632 Review URL: https://codereview.chromium.org/1868933004
* For *ToFixed, in debug mode, assert that the value is in range.Gravatar benjaminwagner2016-04-07
| | | | | | | | | Use SkFloatPinToFixed in SkTwoPointConicalGradient.cpp because it is failing in DM. fmalita is working on replacing this code with the 4f version, so I'm not bothering to fix it. (The beginnings of a real fix are in https://codereview.chromium.org/1767163003, which I do not plan to commit.) BUG=skia:4632 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1824733002 Review URL: https://codereview.chromium.org/1824733002
* Add pinned versions of *ToFixed.Gravatar benjaminwagner2016-04-07
| | | | | | | BUG=skia:4632 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1707023002 Review URL: https://codereview.chromium.org/1707023002
* Reverse dependency between SkScalar.h and SkFixed.h.Gravatar benjaminwagner2016-04-07
| | | | | | | | | | | | | | | The following are unused in Chromium, Android, Mozilla, and Google3: - SkFixedToScalar - SkScalarToFixed The following are additionally unused in Skia: - SkStrAppendFixed - SkWriteBuffer::writeFixed BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1841123002 Review URL: https://codereview.chromium.org/1841123002
* Make SkFixed private.Gravatar benjaminwagner2016-03-28
| | | | | | | | | | | | | Removed from Chromium in https://codereview.chromium.org/1698083004 and https://codereview.chromium.org/1752953003. Removed from Android in 895781. Removed from Google3 in internal cl/118359061. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1839653002 Review URL: https://codereview.chromium.org/1839653002
* Remove transitional explicit operator bool.Gravatar mtklein2016-03-21
| | | | | | | | | | These should no longer be necessary. Android's STL should now be sane. TBR=reed This just removes code. Review URL: https://codereview.chromium.org/1817153002
* 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
* return pictures as sk_spGravatar reed2016-03-18
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1811703002 Review URL: https://codereview.chromium.org/1811703002
* free -> resetGravatar mtklein2016-03-17
| | | | | | | | | | | | | | | The C++ standard library uses ".reset()" where we sometimes write ".free()". We also use ".reset()" quite a lot. This standardizes on ".reset()". This is one more step towards dropping SkAutoTDelete in favor of the standard std::unique_ptr. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1811723002 Committed: https://skia.googlesource.com/skia/+/0e3738db89e86035ed5d4f629bf58b817b1e5274 Review URL: https://codereview.chromium.org/1811723002
* Revert of free -> reset (patchset #3 id:40001 of ↵Gravatar bungeman2016-03-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1811723002/ ) Reason for revert: Suspect for Win10 failures. Original issue's description: > free -> reset > > The C++ standard library uses ".reset()" where we sometimes write ".free()". > We also use ".reset()" quite a lot. This standardizes on ".reset()". > > This is one more step towards dropping SkAutoTDelete in favor of the standard > std::unique_ptr. > > BUG=skia: > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1811723002 > > Committed: https://skia.googlesource.com/skia/+/0e3738db89e86035ed5d4f629bf58b817b1e5274 TBR=reed@google.com,mtklein@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/1813843002
* free -> resetGravatar mtklein2016-03-17
| | | | | | | | | | | | | The C++ standard library uses ".reset()" where we sometimes write ".free()". We also use ".reset()" quite a lot. This standardizes on ".reset()". This is one more step towards dropping SkAutoTDelete in favor of the standard std::unique_ptr. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1811723002 Review URL: https://codereview.chromium.org/1811723002
* Add back SkAutoTDelete::detach() for Android temporarily.Gravatar mtklein2016-03-16
| | | | | | | | | TBR= BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1811483004 Review URL: https://codereview.chromium.org/1811483004
* detach -> releaseGravatar mtklein2016-03-16
| | | | | | | | | | | | | The C++ standard library uses the name "release" for the operation we call "detach". Rewriting each "detach(" to "release(" brings us a step closer to using standard library types directly (e.g. std::unique_ptr instead of SkAutoTDelete). This was a fairly blind transformation. There may have been unintentional conversions in here, but it's probably for the best to have everything uniformly say "release". BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1809733002 Review URL: https://codereview.chromium.org/1809733002
* Use std::unique_ptr.Gravatar mtklein2016-03-16
| | | | | | | | | | | | | TBR=reed@google.com Committed: https://skia.googlesource.com/skia/+/20c1e3abfc681771f73eb19fde7284196e028940 Committed: https://skia.googlesource.com/skia/+/3dd9ed37c24611af86f0fe374bd3698b63f09450 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1780933003 Committed: https://skia.googlesource.com/skia/+/2691d76a06e1af6282f8b3a3140cc93361be10c4 Review URL: https://codereview.chromium.org/1780933003