aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/RefCntTest.cpp
Commit message (Collapse)AuthorAge
* remove SkThread, using std::thread insteadGravatar Mike Klein2017-10-30
| | | | | | | Change-Id: I871dd5eea4496e87c206b46d9eae81cb521b11ce Reviewed-on: https://skia-review.googlesource.com/65103 Reviewed-by: Hal Canary <halcanary@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Actually test our ref-counting in release buildsGravatar Brian Osman2017-02-22
| | | | | | | | | BUG=skia: Change-Id: I8df5c84bf961a3be68a642ba338fdc641e09df59 Reviewed-on: https://skia-review.googlesource.com/8889 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Brian Osman <brianosman@google.com>
* Remove stray semicolons.Gravatar Mike Klein2016-09-27
| | | | | | | | | | | | | | | | Turns out function declarations don't end in semicolons... BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2720 No public API changes. TBR=reed@google.com Change-Id: I72b56d52e1ff7fa6e89c295b0de8c46599791ebb Reviewed-on: https://skia-review.googlesource.com/2720 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* 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
* 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
* add virtual ~Effect()Gravatar mtklein2016-03-07
| | | | | | | | | | Today we make an sk_sp<Effect> from an sk_sp<EffectImpl>. But when the sk_sp<Effect> dies, it calls ~Effect(), not ~EffectImpl(). Making ~Effect() virtual fixes this. This should make our Google3 tests sized-delete clean, unblocking those folks. Review URL: https://codereview.chromium.org/1769093002
* 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: 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
* Remove SkThread::setProcessorAffinity()Gravatar mtklein2015-10-20
| | | | | | | | | | It's only used by a couple unit tests. We have other ways of getting the same quality testing of our ref-count code now (e.g. TSAN). BUG=skia: CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Ubuntu-GCC-x86_64-Release-CMake-Trybot,Build-Mac10.9-Clang-x86_64-Release-CMake-Trybot Review URL: https://codereview.chromium.org/1408213005
* Remove unused InstCounterClass.Gravatar bungeman2015-04-08
| | | | | | | | This was added with r4719 (f7943035) to support testing SkTRefArray. With 703d3c70 SkTRefArray and the associated test was removed, but the supporting InstCounterClass was not. Review URL: https://codereview.chromium.org/1063403003
* make SkRefCnt::getRefCnt() debug-only, remove it from SkNVRefCnt.Gravatar mtklein2014-11-24
| | | | | | | | | Only (unused) API removed. TBR=reed@google.com BUG=skia:3160 Review URL: https://codereview.chromium.org/752263002
* Followup: remove unnecessary SkTRefArrayGravatar mtklein2014-11-12
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/719113004
* Revert "Remove ability for Release code to call getRefCnt() or getWeakRefCnt()."Gravatar Mike Klein2014-07-09
| | | | | | | | This reverts commit 4ae94ffce5ecf1b71cb5e295b68bf4ec9e697443. BUG=skia: Review URL: https://codereview.chromium.org/382523002
* Remove ability for Release code to call getRefCnt() or getWeakRefCnt().Gravatar mtklein2014-07-08
| | | | | | | | | | | | | | | | | These getRefCnt() methods are not thread safe, so Skia code should not be calling them. unique() is fine. SkDEBUG code (SkASSERTs) can still call getRefCnt() / getWeakRefCnt(). This adds tools/RefCntIs.{h,cpp}, which lets tests make their assertions in both debug and release modes. BUG=skia:2726 R=senorblanco@chromium.org, mtklein@google.com, reed@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/378643003
* Cleanup: Sanitize the order of includes under tests/Gravatar tfarina@chromium.org2014-01-24
| | | | | | | | | | | | | | | | Initially this was to make sure Test.h appeared after the Sk*.h includes. Patch generated by the following command line: $ ~/chromium/src/tools/sort-headers.py tests/*.cpp BUG=None TEST=tests R=robertphillips@google.com Review URL: https://codereview.chromium.org/145313004 git-svn-id: http://skia.googlecode.com/svn/trunk@13177 2bbb7eff-a529-9590-31e7-b0007b416f81
* Move macros from TestClassDef.h to Test.hGravatar commit-bot@chromium.org2014-01-14
| | | | | | | | | | | | | | Motivation: those macros don't make any sense without the definitions in Test.h. BUG= R=mtklein@google.com Author: halcanary@google.com Review URL: https://codereview.chromium.org/138563004 git-svn-id: http://skia.googlecode.com/svn/trunk@13074 2bbb7eff-a529-9590-31e7-b0007b416f81
* Use DEFINE_TESTCLASS_SHORT macro in tests.Gravatar tfarina@chromium.org2013-12-12
| | | | | | | | | | | | | The three version of DEFINE_TESTCLASS macro is deprecated and thus just use the simple, short one. BUG=None TEST=out/Debug/tests R=mtklein@google.com, bsalomon@google.com, robertphillips@google.com Review URL: https://codereview.chromium.org/100113004 git-svn-id: http://skia.googlecode.com/svn/trunk@12653 2bbb7eff-a529-9590-31e7-b0007b416f81
* Result of running tools/sanitize_source_files.py (which was added in ↵Gravatar rmistry@google.com2012-08-23
| | | | | | | | | https://codereview.appspot.com/6465078/) This CL is part II of IV (I broke down the 1280 files into 4 CLs). Review URL: https://codereview.appspot.com/6474054 git-svn-id: http://skia.googlecode.com/svn/trunk@5263 2bbb7eff-a529-9590-31e7-b0007b416f81
* add protected method for internal_dispose overrides to jam fRefCnt beforeGravatar reed@google.com2012-07-23
| | | | | | | | | calling destructor. move SkTRefArray to actually inherit from SkRefCnt Review URL: https://codereview.appspot.com/6422057 git-svn-id: http://skia.googlecode.com/svn/trunk@4719 2bbb7eff-a529-9590-31e7-b0007b416f81
* add SkTRefArray, in hopes that it will enable more sharing between ↵Gravatar reed@google.com2012-07-21
| | | | | | | | | | pictureplaybacks in different threads. git-svn-id: http://skia.googlecode.com/svn/trunk@4709 2bbb7eff-a529-9590-31e7-b0007b416f81
* WeakRefCntGravatar bungeman@google.com2012-05-16
| | | | | | | http://codereview.appspot.com/5649046/ git-svn-id: http://skia.googlecode.com/svn/trunk@3978 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add bench and test for SkRefCnt.Gravatar bungeman@google.com2012-05-14
http://codereview.appspot.com/6195071/ This also adds a cross platform SkThread for testing purposes. git-svn-id: http://skia.googlecode.com/svn/trunk@3921 2bbb7eff-a529-9590-31e7-b0007b416f81