Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Issue 11418117: cc: Increment the ref count when assigning the SkImageFilter (Closed)

Created:
8 years, 1 month ago by danakj
Modified:
8 years ago
Reviewers:
senorblanco
CC:
chromium-reviews, cc-bugs_chromium.org, reed1
Visibility:
Public.

Description

cc: Increment the ref count when assigning the SkImageFilter This is to fix a crash introduced in r168998. We should not assign SkImageFilter* without ref-counting it. R=senorblanco BUG=152337 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=169080

Patch Set 1 #

Patch Set 2 : #

Total comments: 1

Patch Set 3 : #

Total comments: 2

Patch Set 4 : cc::SkiaRefPtr #

Patch Set 5 : Less damage tracker diffs #

Patch Set 6 : Comment 80cols #

Patch Set 7 : back to the future #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1 line, -1 line) Patch
M cc/render_surface_impl.cc View 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 9 (0 generated)
danakj
8 years, 1 month ago (2012-11-21 16:44:33 UTC) #1
enne (OOO)
https://codereview.chromium.org/11418117/diff/2001/cc/render_pass.cc File cc/render_pass.cc (right): https://codereview.chromium.org/11418117/diff/2001/cc/render_pass.cc#newcode56 cc/render_pass.cc:56: SkRefCnt_SafeAssign(this->filter, filter); What about just making filter an SkRefPtr<SkImageFilter> ...
8 years, 1 month ago (2012-11-21 16:52:02 UTC) #2
danakj
Excellent plan! Done.
8 years, 1 month ago (2012-11-21 17:08:06 UTC) #3
Stephen White
We don't use SkRefPtr much in Skia, since it's somewhat incompatible with Skia semantics. All ...
8 years, 1 month ago (2012-11-21 17:23:00 UTC) #4
danakj
PTAL. I've implemented a cc::SkiaRefPtr class that will steal the first reference to avoid leaks.
8 years, 1 month ago (2012-11-21 18:19:07 UTC) #5
danakj
OK. First patch again. We need to not crash in the meantime.
8 years, 1 month ago (2012-11-21 18:43:17 UTC) #6
Stephen White
On 2012/11/21 18:43:17, danakj wrote: > OK. First patch again. We need to not crash ...
8 years, 1 month ago (2012-11-21 18:45:34 UTC) #7
enne (OOO)
On 2012/11/21 17:23:00, Stephen White wrote: > We don't use SkRefPtr much in Skia, since ...
8 years ago (2012-11-26 14:59:15 UTC) #8
Stephen White
8 years ago (2012-11-27 00:21:31 UTC) #9
Message was sent while issue was closed.
On 2012/11/26 14:59:15, enne wrote:
> On 2012/11/21 17:23:00, Stephen White wrote:
> > We don't use SkRefPtr much in Skia, since it's somewhat incompatible with
Skia
> > semantics.
> 
> Argh, can I ask why it's like this? Can it get changed?

Yeah, I think we should add something like adoptRef() to SkRefPtr.  That might
make it less error-prone, and removing the existing bare ptr constructor would
be a logical second step I think (although more refactoring would be required).

> Maybe it's just me, but I feel like there's some correlation between "nobody
> wants to use ref-counting templates" and "crash/leak bugs due to missing
manual
> ref/unrefs".

I agree.  Skia is kind of old-school, and we should bring it into the 1990s at
least.  :)

Powered by Google App Engine
This is Rietveld 408576698