Bug 52701 - Refcount Images used in rendering code
Summary: Refcount Images used in rendering code
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: All OS X 10.5
: P2 Normal
Assignee: Simon Fraser (smfr)
URL:
Keywords:
Depends on:
Blocks: 51845
  Show dependency treegraph
 
Reported: 2011-01-18 22:41 PST by Simon Fraser (smfr)
Modified: 2011-01-24 21:53 PST (History)
6 users (show)

See Also:


Attachments
Patch (24.49 KB, patch)
2011-01-18 23:04 PST, Simon Fraser (smfr)
eric: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2011-01-18 22:41:17 PST
We can't always assume that Images returned by StyleImage::image(RenderObject*, const IntSize&) will be kept alive by StyleImage or the CSSValue code. For example, for CSS gradients, we may need to create a new, uncached Image each time (see bug 51845).

For this reason we need to ref-count these Images which are passed back to rendering code.
Comment 1 Simon Fraser (smfr) 2011-01-18 23:04:26 PST
Created attachment 79392 [details]
Patch
Comment 2 Eric Seidel (no email) 2011-01-24 15:37:17 PST
Comment on attachment 79392 [details]
Patch

Looks sane.  It's always saddened me that on most platforms Image is double-refcounted, because the buffer behind the Image itself is often ref-counted.
Comment 3 Eric Seidel (no email) 2011-01-24 15:38:16 PST
ap was fixing style-ownership issues recently and might be curious to see this go by.
Comment 4 Simon Fraser (smfr) 2011-01-24 21:53:18 PST
http://trac.webkit.org/changeset/76571