mtklein
20c1e3abfc
Use std::unique_ptr.
...
TBR=reed@google.com
Review URL: https://codereview.chromium.org/1780933003
2016-03-10 10:10:03 -08:00
reed
647cc84748
Add sk_ref_sp helper function.
...
Review URL: https://codereview.chromium.org/1773943004
2016-03-08 12:54:48 -08:00
bungeman
c901c11549
Add element_type, swap, operators, fix reset on sk_sp.
...
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
2016-03-08 08:35:23 -08:00
reed
941da9d661
Fix behavior of sk_sp::reset(T*) and add unittest.
...
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
2016-03-06 13:54:00 -08:00
halcanary
ffa39e02bc
sk_sp: fix contravariant constructors
...
TBR=reed
This is obviously correct and needs to be fixed.
Review URL: https://codereview.chromium.org/1771583002
2016-03-05 08:30:28 -08:00
bungeman
beab9e7ba0
Add operator* and operator safe-bool to sk_sp.
...
This greatly reduces the need to use '.get()' in conditionals.
Review URL: https://codereview.chromium.org/1760453004
2016-03-03 07:50:49 -08:00
halcanary
89bd99bed8
sk_sp: remove explicit operator bool()
...
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
2016-03-02 08:21:39 -08:00
halcanary
cb6cb3841a
sk_sp: Covariant Move Constructor and Move Assignment
...
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
2016-03-02 08:11:26 -08:00
halcanary
217c0b3f13
sk_make_sp<T>()
...
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
2016-03-02 08:06:20 -08:00
reed
bb7b043b2d
isolate sk_sp from larger cl
...
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
2016-03-01 07:28:51 -08:00
mtklein
1138be45ea
Revert of skstd -> std for unique_ptr (patchset #24 id:460001 of 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
2016-01-24 19:49:24 -08:00
mtklein
ccf1de0d9a
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
Review URL: https://codereview.chromium.org/1436033003
2016-01-24 19:18:54 -08:00
mtklein
97466ab03e
fix funky formatting in SkNVRefCnt
...
BUG=skia:
TBR=reed@google.com
No API change.
Review URL: https://codereview.chromium.org/1505023002
2015-12-07 13:37:00 -08:00
mtklein
5c05d10511
Revert of skstd -> std for unique_ptr (patchset #17 id:320001 of 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
2015-12-02 12:32:02 -08:00
mtklein
dadfc245cc
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
Review URL: https://codereview.chromium.org/1436033003
2015-12-02 10:46:18 -08:00
mtklein
e066df9673
Revert of skstd -> std for unique_ptr (patchset #16 id:300001 of 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
2015-11-30 07:17:39 -08:00
mtklein
70e8dfca4a
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
Review URL: https://codereview.chromium.org/1436033003
2015-11-30 07:07:02 -08:00
mtklein
dfd7d48ced
Revert of skstd -> std for unique_ptr (patchset #16 id:300001 of 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
2015-11-23 09:19:37 -08:00
mtklein
06189155d9
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
Review URL: https://codereview.chromium.org/1436033003
2015-11-23 09:12:31 -08:00
mtklein
566b23c571
Revert of skstd -> std for unique_ptr (patchset #9 id:160001 of 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
2015-11-16 13:05:37 -08:00
mtklein
755c553c17
skstd -> std for unique_ptr
...
TBR=reed@google.com
No public API changes.
BUG=skia:4564
Review URL: https://codereview.chromium.org/1436033003
2015-11-16 12:57:52 -08:00
bungeman
77a53de20d
Base SkAutoTUnref on skstd::unique_ptr.
...
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
2015-10-01 12:28:49 -07:00
herb
e6e41a8a19
Move SkAtomics.h to private.
...
There are no API changes.
TBR=reed@google.com
BUG=skia:
Review URL: https://codereview.chromium.org/1369333004
2015-09-28 11:24:13 -07:00
halcanary
385fe4d4b6
Style Change: SkNEW->new; SkDELETE->delete
...
DOCS_PREVIEW= https://skia.org/?cl=1316123003
Review URL: https://codereview.chromium.org/1316123003
2015-08-26 13:07:49 -07:00
djsollen
ab5d5de420
Enable debug builds in the Android framework
...
Review URL: https://codereview.chromium.org/1297093004
2015-08-24 14:21:23 -07:00
bungeman
f3c15b7cfc
Move SkTemplates.h to private.
...
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
2015-08-19 11:56:48 -07:00
mtklein
2766c00fc0
remove SkInstCnt
...
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
2015-06-26 11:45:03 -07:00
mtklein
76f5cc6e9e
Clean up BlockRef
...
- 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
2015-04-06 08:57:32 -07:00
mtklein
7b274c78fb
Port SkRefCnt.h to new SkAtomics.h
...
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
2015-02-03 13:38:58 -08:00
mtklein
6f07665768
Simplify SkInstCnt
...
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
2015-01-13 08:22:44 -08:00
mtklein
21180e2651
Revert of Blink hasn't rolled yet, better. (patchset #1 id:1 of https://codereview.chromium.org/758693002/ )
...
Reason for revert:
Try again, for real.
Original issue's description:
> Blink hasn't rolled yet, better.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/89ff0846fd9dacf5f081373746624d450a5f8c26
TBR=mtklein@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=skia:
Review URL: https://codereview.chromium.org/754303004
2014-11-25 07:30:19 -08:00
Mike Klein
89ff0846fd
Blink hasn't rolled yet, better.
...
BUG=skia:
Review URL: https://codereview.chromium.org/758693002
2014-11-24 17:31:54 -05:00
mtklein
a2a5cd4405
Revert of Blink hasn't rolled yet. (patchset #1 id:1 of https://codereview.chromium.org/754133002/ )
...
Reason for revert:
Not thorough enough.
Original issue's description:
> Blink hasn't rolled yet.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/fa14113d0563686af9f7e2d8e041dd7bf538cfa2
TBR=mtklein@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=skia:
Review URL: https://codereview.chromium.org/752303002
2014-11-24 14:28:55 -08:00
reed
3c850c561f
restore old convention of asserting refcnt==1 in destructor
...
BUG=skia:
Review URL: https://codereview.chromium.org/757563003
2014-11-24 14:13:55 -08:00
Mike Klein
fa14113d05
Blink hasn't rolled yet.
...
BUG=skia:
Review URL: https://codereview.chromium.org/754133002
2014-11-24 16:26:15 -05:00
mtklein
bbb61d7268
make SkRefCnt::getRefCnt() debug-only, remove it from SkNVRefCnt.
...
Only (unused) API removed.
TBR=reed@google.com
BUG=skia:3160
Review URL: https://codereview.chromium.org/752263002
2014-11-24 13:09:39 -08:00
reed
90d0ff013b
add some debugging to SkNVRefCnt
...
BUG=skia:
Review URL: https://codereview.chromium.org/745383003
2014-11-24 12:02:31 -08:00
Florin Malita
844aa334a4
Add SkNVRefCnt::getRefCnt()
...
Used in Blink unit tests.
TBR=mtklein@google.com ,humper@google.com
Review URL: https://codereview.chromium.org/746693002
2014-11-20 16:56:22 -05:00
mtklein
d6ab2a8e45
Add SkNVRefCnt::deref().
...
TBR=reed@google.com
BUG=skia:
Review URL: https://codereview.chromium.org/744853002
2014-11-20 10:07:54 -08:00
mtklein
08d1fccf6e
Add SkNVRefCnt, prune down SkPicture's size
...
SkNVRefCnt is a variant of SkRefCnt that's Not Virtual, so weighs 4 bytes
instead of 8 or 16. There's only benefit to doing this if the deriving class
does not otherwise need a vtable, e.g. SkPicture.
I've stripped out some cruft from SkPicture, rearranged fields to pack tightly,
and added compile asserts for the sizes of SkPicture, SkRecord, and
SkVarAlloc.
BUG=skia:3144
Review URL: https://codereview.chromium.org/741793002
2014-11-20 09:18:32 -08:00
bungeman
a5cf665997
Issue acquire barrier in SkRefCnt::unique().
...
When unique() returns true, it must also issue an acquire barrier.
Note that this change may adversly impact SkPath performance,
but editing SkPaths is already a performance issue.
BUG=chromium:258499
No API changes.
TBR=reed@google.com
Review URL: https://codereview.chromium.org/687293002
2014-10-29 12:31:33 -07:00
bungeman
d71b757573
Serialize the font index.
...
BUG=skia:1186
R=reed@google.com
Author: bungeman@google.com
Review URL: https://codereview.chromium.org/567013002
2014-09-18 10:55:32 -07:00
bsalomon
49f085dddf
"NULL !=" = NULL
...
R=reed@google.com
Author: bsalomon@google.com
Review URL: https://codereview.chromium.org/544233002
2014-09-05 13:34:00 -07:00
bsalomon
dcabb05113
Make GrCacheable implement its own ref counting.
...
R=robertphillips@google.com
Author: bsalomon@google.com
Review URL: https://codereview.chromium.org/392333008
2014-07-21 14:24:01 -07:00
bungeman
733418f91e
Remove SkRefPtr.
...
R=mtklein@google.com , reed@google.com , bsalomon@google.com
Author: bungeman@google.com
Review URL: https://codereview.chromium.org/393913002
2014-07-17 12:17:55 -07:00
mtklein
a179a1ede9
SkAutoRef seems lonely. Might as well delete it.
...
(On the other hand, SkAutoUnref is well-used.)
NOTREECHECKS=true
BUG=skia:
R=bungeman@google.com , mtklein@google.com , reed@google.com
Author: mtklein@chromium.org
Review URL: https://codereview.chromium.org/393953004
2014-07-15 13:29:34 -07:00
Mike Klein
874a62acef
Revert "Remove ability for Release code to call getRefCnt() or getWeakRefCnt()."
...
This reverts commit 4ae94ffce5
.
BUG=skia:
Review URL: https://codereview.chromium.org/382523002
2014-07-09 09:04:07 -04:00
mtklein
4ae94ffce5
Remove ability for Release code to call getRefCnt() or getWeakRefCnt().
...
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
2014-07-08 06:48:17 -07:00
mtklein
b59161f000
Add SkASSERTF.
...
Example failure:
fRefCnt was 3
../../../usr/local/google/home/mtklein/skia/include/core/SkRefCnt.h:40: failed assertion "(fRefCnt == 1) || (SkDebugf("fRefCnt was %d""\n", fRefCnt), false)"
Command terminated by signal 11
Not pretty, but everything's there. Perhaps we'll think of ways to make it nicer later.
BUG=skia:
R=bsalomon@google.com , reed@google.com , mtklein@google.com
Author: mtklein@chromium.org
Review URL: https://codereview.chromium.org/337243004
2014-06-18 07:54:47 -07:00
commit-bot@chromium.org
86b0de4745
Revert "Remove SkThread.h from public API."
...
Too much depends on SkThread being in include/core in Chrome build.
This reverts commit b1aec17df6
.
NOTREECHECKS=true
NOTRY=true
R=reed@google.com , mtklein@google.com
TBR=reed
BUG=skia:
Author: mtklein@chromium.org
Review URL: https://codereview.chromium.org/303813003
git-svn-id: http://skia.googlecode.com/svn/trunk@14934 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-05-28 20:02:17 +00:00