|
|
|
The first attached patch adds a smart pointer template to Skia. The second attached patch refactors SkPaint to use this new SkRefPtr template.
Patch Set 1 #
Total comments: 1
Patch Set 2 : Refactor SkPaint to use new SkRefPtr template #
Total messages: 4
|
andrei
I propose adding a smart pointer template to Skia and would appreciate your feedback. Thank ...
|
16 years ago (2010年01月07日 23:42:56 UTC) #1 | ||||||||||||||||||||||
I propose adding a smart pointer template to Skia and would appreciate your feedback. Thank you, Andrei
Even if the SkRefPtr template is not used internally within Skia, I believe it would still be useful to clients of Skia.
deferring to reed on this one.
I would give a score to smart pointer like this SkRefPtr. But the SkRefPtr should need some improvement, I think. http://codereview.appspot.com/183150/diff/1/2 File include/core/SkRefCnt.h (right): http://codereview.appspot.com/183150/diff/1/2#newcode174 include/core/SkRefCnt.h:174: T* operator->() const { return fObj; } operator*() and operator->() would expose 'ref()' and 'unref()' from SkRefCnt to users, this is bad I think, just take look at this segment: SkRefPtr<SkTypeface> typeface; ... ... typeface->unref(); // possible, and really bad ...