aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkRefCnt.h
Commit message (Collapse)AuthorAge
* Only perform SkSafeRef race detection if on android frameworkGravatar Derek Sollenberger2017-03-23
| | | | | | | Change-Id: If524a02e916d711057d6f2102efb0404b1c0b988 Reviewed-on: https://skia-review.googlesource.com/10036 Commit-Queue: Ravi Mistry <rmistry@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
* Make reference counted assignment check for races.Gravatar Derek Sollenberger2017-03-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If SkRefCnt_SafeAssign is erroneously invoked simultaneously by two threads on the same destination, a likely outcome is that the reference count of an object other than the replaced dst will be decremented. This results in an extra reference count decrement, which usually means that the final reference count decrement will be applied to a random location in an object that has already been reallocated. This is exceedingly hard to debug. We add a hack to detect such data races with sufficiently high probability, so that such a data race bug should sometimes actually generate bug reports that lend themselves to diagnosis. We detect changes within a relatively larger range that normally includes several (typically slow) memory fences. Not all such changes would provoke a crash. Even if we decrement the wrong reference count, there's a chance we would decrement a dead location. Thus, to avoid potentially adding instability, we currently only log. This change tries to minimize additional runtime overhead. The macro is only expanded a few dozen times, so we do not worry too much about code size. Bug: b/31227650 Change-Id: Ia40c9ed2c4d0fa578ea682fbec4b71a2ef22a5d1 Reviewed-on: https://skia-review.googlesource.com/9994 Commit-Queue: Derek Sollenberger <djsollen@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
* Remove sk_ref_sp's misleading preprocessor define and commentGravatar Brian Osman2016-12-21
| | | | | | | | | | | | This function will always be useful. Don't make it look/feel like a temporary hack. BUG=skia: Change-Id: I6506d7d51dc3b25a7dbcea4ac273f51cf05f3a89 Reviewed-on: https://skia-review.googlesource.com/6330 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Remove SkAutoTUnref from public APIGravatar Hal Canary2016-11-08
| | | | | | | | | GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4530 Change-Id: I1ba33edc5ca44332ff4f296e6b9997a133a08a87 Reviewed-on: https://skia-review.googlesource.com/4530 Commit-Queue: Hal Canary <halcanary@google.com> Reviewed-by: Mike Reed <reed@google.com>
* Remove SkAutoUnref.Gravatar Ben Wagner2016-11-03
| | | | | | | | | | It is no longer used. Change-Id: Ie2f9a39a4295005cb39bdf2f8fc15542ee75d207 Reviewed-on: https://skia-review.googlesource.com/4386 Commit-Queue: Ben Wagner <bungeman@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Mike Klein <mtklein@chromium.org>
* Remove hack allowing fRefCnt of 0.Gravatar Ben Wagner2016-10-12
| | | | | | | | | | | | | | In some legacy situations users of SkRefCnt subclasses were keeping the objects alive with a reference count of 0. Now that these users are cleaned up, remove the hack which allowed such code to keep functioning. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3264 Change-Id: I22f63d87b6d995cad6326998284930ad9eaa2983 Reviewed-on: https://skia-review.googlesource.com/3264 Reviewed-by: Derek Sollenberger <djsollen@google.com> Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
* SkLite*Gravatar mtklein2016-08-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | SkLiteRecorder, a new SkCanvas, fills out SkLiteDL, a new SkDrawable. This SkDrawable is a display list similar to SkRecord and SkBigPicture / SkRecordedDrawable, but with a few new design points inspired by Android and slimming paint: 1) SkLiteDL is structured as one big contiguous array rather than the two layer structure of SkRecord. This trades away flexibility and large-op-count performance for better data locality for small to medium size pictures. 2) We keep a global freelist of SkLiteDLs, both reusing the SkLiteDL struct itself and its contiguous byte array. This keeps the expected number of mallocs per display list allocation <1 (really, ~0) for cyclical use cases. These two together mean recording is faster. Measuring against the code we use at head, SkLiteRecorder trends about ~3x faster across various size pictures, matching speed at 0 draws and beating the special-case 1-draw pictures we have today. (I.e. we won't need those special case implementations anymore, because they're slower than this new generic code.) This new strategy records 10 drawRects() in about the same time the old strategy took for 2. This strategy stays the winner until at least 500 drawRect()s on my laptop, where I stopped checking. A simpler alternative to freelisting is also possible (but not implemented here), where we allow the client to manually reset() an SkLiteDL for reuse when its refcnt is 1. That's essentially what we're doing with the freelist, except tracking what's available for reuse globally instead of making the client do it. This code is not fully capable yet, but most of the key design points are there. The internal structure of SkLiteDL is the area I expect to be most volatile (anything involving Op), but its interface and the whole of SkLiteRecorder ought to be just about done. You can run nanobench --match picture_overhead as a demo. Everything it exercises is fully fleshed out, so what it tests is an apples-to-apples comparison as far as recording costs go. I have not yet compared playback performance. It should be simple to wrap this into an SkPicture subclass if we want. I won't start proposing we replace anything old with anything new quite yet until I have more ducks in a row, but this does look pretty promising (similar to the SkRecord over old SkPicture change a couple years ago) and I'd like to land, experiment, iterate, especially with an eye toward Android. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2213333002 Review-Url: https://codereview.chromium.org/2213333002
* sk_sp for Ganesh.Gravatar bungeman2016-06-09
| | | | | | | | | | Convert use of GrFragmentProcessor, GrGeometryProcessor, and GrXPFactory to sk_sp. This clarifies ownership and should reduce reference count churn by moving ownership. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2041113004 Review-Url: https://codereview.chromium.org/2041113004
* 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
* For GOOGLE3, add deref method to SkRefCnt.Gravatar benjaminwagner2016-04-13
| | | | | | | | | This makes it easier to integrate with Blink code using RefPtr/PassRefPtr without pulling in Chrome's SkUserConfig.h. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1890573003 Review URL: https://codereview.chromium.org/1890573003
* 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
* 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
* Add back SkAutoTUnref::detach() for Android temporarily.Gravatar mtklein2016-03-17
| | | | | | | | | TBR=reed@google.com BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1812843002 Review URL: https://codereview.chromium.org/1812843002
* 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
* Revert of Use std::unique_ptr. (patchset #10 id:170001 of ↵Gravatar mtklein2016-03-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1780933003/ ) Reason for revert: aww jeez, I dropped ps 8... Original issue's description: > Use std::unique_ptr. > > 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 TBR=bungeman@google.com,mtklein@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/1809693002
* 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 Review URL: https://codereview.chromium.org/1780933003
* Revert of Use std::unique_ptr. (patchset #8 id:130001 of ↵Gravatar mtklein2016-03-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1780933003/ ) Reason for revert: Another Android ambiguity due to implicit bool... frameworks/base/core/jni/android/graphics/Utils.cpp:110:35: error: call of overloaded 'SkMemoryStream(SkAutoTUnref<SkData>&)' is ambiguous return new SkMemoryStream(data); Original issue's description: > Use std::unique_ptr. > > TBR=reed@google.com > > Committed: https://skia.googlesource.com/skia/+/20c1e3abfc681771f73eb19fde7284196e028940 > > Committed: https://skia.googlesource.com/skia/+/3dd9ed37c24611af86f0fe374bd3698b63f09450 TBR=bungeman@google.com,mtklein@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/1785353002
* Use std::unique_ptr.Gravatar mtklein2016-03-11
| | | | | | | | TBR=reed@google.com Committed: https://skia.googlesource.com/skia/+/20c1e3abfc681771f73eb19fde7284196e028940 Review URL: https://codereview.chromium.org/1780933003
* Revert of Use std::unique_ptr. (patchset #7 id:120001 of ↵Gravatar mtklein2016-03-10
| | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1780933003/ ) Reason for revert: Now we remember! The problem was Clank: https://build.chromium.org/p/tryserver.chromium.android/builders/android_clang_dbg_recipe/builds/34329 Original issue's description: > Use std::unique_ptr. > > TBR=reed@google.com > > Committed: https://skia.googlesource.com/skia/+/20c1e3abfc681771f73eb19fde7284196e028940 TBR=bungeman@google.com,mtklein@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/1782973002
* Use std::unique_ptr.Gravatar mtklein2016-03-10
| | | | | | TBR=reed@google.com Review URL: https://codereview.chromium.org/1780933003
* Add sk_ref_sp helper function.Gravatar reed2016-03-08
| | | | Review URL: https://codereview.chromium.org/1773943004
* 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
* Fix behavior of sk_sp::reset(T*) and add unittest.Gravatar reed2016-03-06
| | | | | | | | Previously, sk_sp::reset(T* t) did not release its own reference if its internal pointer was the same as 't'. This leaks a reference. Now always release the current reference when non-nullptr. Review URL: https://codereview.chromium.org/1767983002
* sk_sp: fix contravariant constructorsGravatar halcanary2016-03-05
| | | | | | | TBR=reed This is obviously correct and needs to be fixed. Review URL: https://codereview.chromium.org/1771583002
* Add operator* and operator safe-bool to sk_sp.Gravatar bungeman2016-03-03
| | | | | | This greatly reduces the need to use '.get()' in conditionals. Review URL: https://codereview.chromium.org/1760453004
* sk_sp: remove explicit operator bool()Gravatar halcanary2016-03-02
| | | | | | GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1757593005 Review URL: https://codereview.chromium.org/1757593005
* sk_sp: Covariant Move Constructor and Move AssignmentGravatar halcanary2016-03-02
| | | | | | | | | Also Covariant Copy Constructor, Copy Assignment, and comparison operators. GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1752093002 Review URL: https://codereview.chromium.org/1752093002
* sk_make_sp<T>()Gravatar halcanary2016-03-02
| | | | | | | | | | | because auto atm = sk_make_sp<SkAdvancedTypefaceMetrics>(); is better than sk_sp<SkAdvancedTypefaceMetrics> atm(new SkAdvancedTypefaceMetrics); GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1753973002 Review URL: https://codereview.chromium.org/1753973002
* isolate sk_sp from larger clGravatar reed2016-03-01
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1752683002 Review URL: https://codereview.chromium.org/1752683002
* Revert of skstd -> std for unique_ptr (patchset #24 id:460001 of ↵Gravatar mtklein2016-01-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1436033003/ ) Reason for revert: Still need an answer for SkAdvancedTypefaceMetrics (at least for Google3 iOS build). Original issue's description: > skstd -> std for unique_ptr > > TBR=reed@google.com > No public API changes. > > BUG=skia:4564 > > Committed: https://skia.googlesource.com/skia/+/755c553c17b82bb5de3d9cc8d3b2a866ff9e9e50 > > CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Mac10.9-Clang-x86_64-Release-CMake-Trybot,Build-Ubuntu-GCC-x86_64-Debug-CrOS_Link-Trybot;client.skia:Perf-Mac10.9-Clang-MacMini6.2-CPU-AVX-x86_64-Release-Trybot,Test-iOS-Clang-iPad4-GPU-SGX554-Arm7-Release-Trybot > > Committed: https://skia.googlesource.com/skia/+/06189155d987db5c7e69015f6ea87c2168d6a065 > > Committed: https://skia.googlesource.com/skia/+/70e8dfca4a7f5bce97b8021a6e378c4828b09c8c > > Committed: https://skia.googlesource.com/skia/+/dadfc245cc9a0279ff7b73da3344f2ca5d139907 > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1436033003 > > Committed: https://skia.googlesource.com/skia/+/ccf1de0d9aa75f29829f1c4c462214b991fd8c9e TBR=bungeman@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:4564 Review URL: https://codereview.chromium.org/1626873004
* skstd -> std for unique_ptrGravatar mtklein2016-01-24
| | | | | | | | | | | | | | | | | | | | TBR=reed@google.com No public API changes. BUG=skia:4564 Committed: https://skia.googlesource.com/skia/+/755c553c17b82bb5de3d9cc8d3b2a866ff9e9e50 CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Mac10.9-Clang-x86_64-Release-CMake-Trybot,Build-Ubuntu-GCC-x86_64-Debug-CrOS_Link-Trybot;client.skia:Perf-Mac10.9-Clang-MacMini6.2-CPU-AVX-x86_64-Release-Trybot,Test-iOS-Clang-iPad4-GPU-SGX554-Arm7-Release-Trybot Committed: https://skia.googlesource.com/skia/+/06189155d987db5c7e69015f6ea87c2168d6a065 Committed: https://skia.googlesource.com/skia/+/70e8dfca4a7f5bce97b8021a6e378c4828b09c8c Committed: https://skia.googlesource.com/skia/+/dadfc245cc9a0279ff7b73da3344f2ca5d139907 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1436033003 Review URL: https://codereview.chromium.org/1436033003
* fix funky formatting in SkNVRefCntGravatar mtklein2015-12-07
| | | | | | | | BUG=skia: TBR=reed@google.com No API change. Review URL: https://codereview.chromium.org/1505023002
* Revert of skstd -> std for unique_ptr (patchset #17 id:320001 of ↵Gravatar mtklein2015-12-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1436033003/ ) Reason for revert: Chromium bots can't handle forward declared types, e.g. struct Foo { int x,y; std::unique_ptr<Foo> next; }; https://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_asan_rel_ng/builds/86497 Original issue's description: > skstd -> std for unique_ptr > > TBR=reed@google.com > No public API changes. > > BUG=skia:4564 > > Committed: https://skia.googlesource.com/skia/+/755c553c17b82bb5de3d9cc8d3b2a866ff9e9e50 > > CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Mac10.9-Clang-x86_64-Release-CMake-Trybot,Build-Ubuntu-GCC-x86_64-Debug-CrOS_Link-Trybot;client.skia:Perf-Mac10.9-Clang-MacMini6.2-CPU-AVX-x86_64-Release-Trybot,Test-iOS-Clang-iPad4-GPU-SGX554-Arm7-Release-Trybot > > Committed: https://skia.googlesource.com/skia/+/06189155d987db5c7e69015f6ea87c2168d6a065 > > Committed: https://skia.googlesource.com/skia/+/70e8dfca4a7f5bce97b8021a6e378c4828b09c8c > > Committed: https://skia.googlesource.com/skia/+/dadfc245cc9a0279ff7b73da3344f2ca5d139907 TBR=bungeman@google.com,mtklein@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia:4564 Review URL: https://codereview.chromium.org/1498583002
* skstd -> std for unique_ptrGravatar mtklein2015-12-02
| | | | | | | | | | | | | | | | | TBR=reed@google.com No public API changes. BUG=skia:4564 Committed: https://skia.googlesource.com/skia/+/755c553c17b82bb5de3d9cc8d3b2a866ff9e9e50 CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Mac10.9-Clang-x86_64-Release-CMake-Trybot,Build-Ubuntu-GCC-x86_64-Debug-CrOS_Link-Trybot;client.skia:Perf-Mac10.9-Clang-MacMini6.2-CPU-AVX-x86_64-Release-Trybot,Test-iOS-Clang-iPad4-GPU-SGX554-Arm7-Release-Trybot Committed: https://skia.googlesource.com/skia/+/06189155d987db5c7e69015f6ea87c2168d6a065 Committed: https://skia.googlesource.com/skia/+/70e8dfca4a7f5bce97b8021a6e378c4828b09c8c Review URL: https://codereview.chromium.org/1436033003
* Revert of skstd -> std for unique_ptr (patchset #16 id:300001 of ↵Gravatar mtklein2015-11-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1436033003/ ) Reason for revert: Test-iOS-Clang-iPad4-GPU-SGX554-Arm7-Release Original issue's description: > skstd -> std for unique_ptr > > TBR=reed@google.com > No public API changes. > > BUG=skia:4564 > > Committed: https://skia.googlesource.com/skia/+/755c553c17b82bb5de3d9cc8d3b2a866ff9e9e50 > > CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Mac10.9-Clang-x86_64-Release-CMake-Trybot,Build-Ubuntu-GCC-x86_64-Debug-CrOS_Link-Trybot;client.skia:Perf-Mac10.9-Clang-MacMini6.2-CPU-AVX-x86_64-Release-Trybot > > Committed: https://skia.googlesource.com/skia/+/06189155d987db5c7e69015f6ea87c2168d6a065 > > Committed: https://skia.googlesource.com/skia/+/70e8dfca4a7f5bce97b8021a6e378c4828b09c8c TBR=bungeman@google.com,mtklein@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia:4564 Review URL: https://codereview.chromium.org/1482343002
* skstd -> std for unique_ptrGravatar mtklein2015-11-30
| | | | | | | | | | | | | | | TBR=reed@google.com No public API changes. BUG=skia:4564 Committed: https://skia.googlesource.com/skia/+/755c553c17b82bb5de3d9cc8d3b2a866ff9e9e50 CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Mac10.9-Clang-x86_64-Release-CMake-Trybot,Build-Ubuntu-GCC-x86_64-Debug-CrOS_Link-Trybot;client.skia:Perf-Mac10.9-Clang-MacMini6.2-CPU-AVX-x86_64-Release-Trybot Committed: https://skia.googlesource.com/skia/+/06189155d987db5c7e69015f6ea87c2168d6a065 Review URL: https://codereview.chromium.org/1436033003
* Revert of skstd -> std for unique_ptr (patchset #16 id:300001 of ↵Gravatar mtklein2015-11-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1436033003/ ) Reason for revert: Perf-Mac10.9-Clang-MacMini6.2-CPU-AVX-x86_64-Release has not updated yet. Original issue's description: > skstd -> std for unique_ptr > > TBR=reed@google.com > No public API changes. > > BUG=skia:4564 > > Committed: https://skia.googlesource.com/skia/+/755c553c17b82bb5de3d9cc8d3b2a866ff9e9e50 > > CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Mac10.9-Clang-x86_64-Release-CMake-Trybot,Build-Ubuntu-GCC-x86_64-Debug-CrOS_Link-Trybot > > Committed: https://skia.googlesource.com/skia/+/06189155d987db5c7e69015f6ea87c2168d6a065 TBR=bungeman@google.com,mtklein@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia:4564 Review URL: https://codereview.chromium.org/1467333002
* skstd -> std for unique_ptrGravatar mtklein2015-11-23
| | | | | | | | | | | | | TBR=reed@google.com No public API changes. BUG=skia:4564 Committed: https://skia.googlesource.com/skia/+/755c553c17b82bb5de3d9cc8d3b2a866ff9e9e50 CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Mac10.9-Clang-x86_64-Release-CMake-Trybot,Build-Ubuntu-GCC-x86_64-Debug-CrOS_Link-Trybot Review URL: https://codereview.chromium.org/1436033003
* Revert of skstd -> std for unique_ptr (patchset #9 id:160001 of ↵Gravatar mtklein2015-11-16
| | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1436033003/ ) Reason for revert: 10.9 bots are too old too. Original issue's description: > skstd -> std for unique_ptr > > TBR=reed@google.com > No public API changes. > > BUG=skia:4564 > > Committed: https://skia.googlesource.com/skia/+/755c553c17b82bb5de3d9cc8d3b2a866ff9e9e50 TBR=bungeman@google.com,mtklein@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia:4564 Review URL: https://codereview.chromium.org/1446413002
* skstd -> std for unique_ptrGravatar mtklein2015-11-16
| | | | | | | | | TBR=reed@google.com No public API changes. BUG=skia:4564 Review URL: https://codereview.chromium.org/1436033003
* Base SkAutoTUnref on skstd::unique_ptr.Gravatar bungeman2015-10-01
| | | | | | | | | To further consolidate the various unique owning classes, this bases SkAutoTUnref on skstd::unique_ptr. Users are updated because of two breaking changes, swap now takes a reference and reset no longer returns its argument. Review URL: https://codereview.chromium.org/1370803002
* Move SkAtomics.h to private.Gravatar herb2015-09-28
| | | | | | | | | | There are no API changes. TBR=reed@google.com BUG=skia: Review URL: https://codereview.chromium.org/1369333004
* Style Change: SkNEW->new; SkDELETE->deleteGravatar halcanary2015-08-26
| | | | | | DOCS_PREVIEW= https://skia.org/?cl=1316123003 Review URL: https://codereview.chromium.org/1316123003
* Enable debug builds in the Android frameworkGravatar djsollen2015-08-24
| | | | Review URL: https://codereview.chromium.org/1297093004
* Move SkTemplates.h to private.Gravatar bungeman2015-08-19
| | | | | | | | SkTemplates.h contains a number of Skia specific utilities which are not designed for external use. In addition to reducing the external support burden, this will allow Skia to freely refactor this file. Review URL: https://codereview.chromium.org/1272293004
* remove SkInstCntGravatar mtklein2015-06-26
| | | | | | | | | | | | | | It's been outclassed by Valgrind and leak sanitizer, and it seems to be causing problems for external folks building Skia. I'm not sure why our own builds seem unaffected. Latest thread: https://groups.google.com/forum/#!topic/skia-discuss/oj9FsQwwSF0 BUG=skia: Review URL: https://codereview.chromium.org/1217573002
* Clean up BlockRefGravatar mtklein2015-04-06
| | | | | | | | | | | | | - It's no longer needed to help the (2011?) transition to SkAutoTUnref. - It prevents us from making classes that go in SkAutoTUnrefs final, i.e. all ref-counted classes. This had better not have been public API... TBR=reed@google.com BUG=skia: Review URL: https://codereview.chromium.org/1068443002
* Port SkRefCnt.h to new SkAtomics.hGravatar mtklein2015-02-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds sk_memory_barrier(), implemented using sk_atomic_fetch_add() on an uninitialized variable. If that becomes a problem we can drop this to the porting layer, using std::atomic_thread_fence() / __atomic_thread_fence() / __sync_synchronize(). The big win is that ref() doesn't generate a memory barrier any more on ARM. This is an instance of SkSafeRef() in SkPaint(const SkPaint&) after this CL: 4d0: 684a ldr r2, [r1, #4] 4d2: 6018 str r0, [r3, #0] 4d4: b13a cbz r2, 4e6 <_ZN7SkPaintC1ERKS_+0x2e> 4d6: 1d10 adds r0, r2, #4 4d8: e850 4f00 ldrex r4, [r0] 4dc: 3401 adds r4, #1 4de: e840 4500 strex r5, r4, [r0] 4e2: 2d00 cmp r5, #0 4e4: d1f8 bne.n 4d8 <_ZN7SkPaintC1ERKS_+0x20> Here's the before, pretty much the same with two memory barriers surrounding the ref(): 4d8: 684a ldr r2, [r1, #4] 4da: 6018 str r0, [r3, #0] 4dc: b15a cbz r2, 4f6 <_ZN7SkPaintC1ERKS_+0x3e> 4de: 1d10 adds r0, r2, #4 4e0: f3bf 8f5f dmb sy 4e4: e850 4f00 ldrex r4, [r0] 4e8: 3401 adds r4, #1 4ea: e840 4500 strex r5, r4, [r0] 4ee: 2d00 cmp r5, #0 4f0: d1f8 bne.n 4e4 <_ZN7SkPaintC1ERKS_+0x2c> 4f2: f3bf 8f5f dmb sy The miscellaneous files in here are just fixups to explicitly include SkMutex.h, instead of leeching it off SkRefCnt.h. No public API changes. TBR=reed@google.com Build trybots seem hosed. NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/896803002
* Simplify SkInstCntGravatar mtklein2015-01-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This code requires fewer macros to use it (just one), has less code in macro definitions, and has simpler synchronization code (just atomic ints, no SkOnce, no SkMutex, etc.) A minor downside, we lose indentation and reverse-ordering in the final report: Leaked SkRefCntBase: 7 Leaked SkFontMgr: 1 Leaked SkWeakRefCnt: 1 Leaked SkTypeface: 1 Leaked SkFlattenable: 3 Leaked SkXfermode: 3 Leaked SkPathRef: 1 Leaked SkPixelRef: 1 Leaked SkMallocPixelRef: 1 becomes Leaked SkXfermode: 3 Leaked SkMallocPixelRef: 1 Leaked SkPixelRef: 1 Leaked SkPathRef: 1 Leaked SkFlattenable: 3 Leaked SkTypeface: 1 Leaked SkWeakRefCnt: 1 Leaked SkFontMgr: 1 Leaked SkRefCntBase: 7 This is motivated by wanting to land https://codereview.chromium.org/806473006/, which makes sure all static use of SkOnce are in global scope. The current implementation of SkInstCnt uses them in function scope, which isn't safe. BUG=skia: No public API changes. TBR=reed@google.com Review URL: https://codereview.chromium.org/841263004