WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
62742
Add ShareableBitmap::createImage and get rid of WebCoreArgumentCodersCG.cpp
https://bugs.webkit.org/show_bug.cgi?id=62742
Summary
Add ShareableBitmap::createImage and get rid of WebCoreArgumentCodersCG.cpp
Anders Carlsson
Reported
2011-06-15 11:55:28 PDT
Add ShareableBitmap::createImage and get rid of WebCoreArgumentCodersCG.cpp
Attachments
Patch
(12.67 KB, patch)
2011-06-15 11:57 PDT
,
Anders Carlsson
darin
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Anders Carlsson
Comment 1
2011-06-15 11:57:29 PDT
Created
attachment 97340
[details]
Patch
WebKit Review Bot
Comment 2
2011-06-15 12:00:06 PDT
Attachment 97340
[details]
did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebKit2/ChangeLog', u'Source/WebKit..." exit_code: 1 Source/WebKit2/Shared/ShareableBitmap.h:49: Code inside a namespace should not be indented. [whitespace/indent] [4] Total errors found: 1 in 5 files If any of these errors are false positives, please file a bug against check-webkit-style.
Darin Adler
Comment 3
2011-06-15 12:34:24 PDT
Comment on
attachment 97340
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=97340&action=review
> Source/WebKit2/Shared/ShareableBitmap.h:110 > + // This create a bitmap image that directly references the shared bitmap data.
Should be "This creates".
> Source/WebKit2/Shared/ShareableBitmap.h:112 > + // This is only safe to use when we know that the contents of the shareable bitmap won't change. > + PassRefPtr<WebCore::Image> createImage();
Would be nice if that “this is only safe” information was reflected in the function name.
> Source/WebKit2/Shared/cg/ShareableBitmapCG.cpp:115 > + // BitmapImage::create adopts the CGImageRef that's passed in, which is why we need to leakRef here.
Could that be fixed by changing BitmapImage::create to take a RetainPtr?
Anders Carlsson
Comment 4
2011-06-15 12:38:25 PDT
(In reply to
comment #3
)
> (From update of
attachment 97340
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=97340&action=review
> > > Source/WebKit2/Shared/ShareableBitmap.h:110 > > + // This create a bitmap image that directly references the shared bitmap data. > > Should be "This creates". >
Fixed.
> > Source/WebKit2/Shared/ShareableBitmap.h:112 > > + // This is only safe to use when we know that the contents of the shareable bitmap won't change. > > + PassRefPtr<WebCore::Image> createImage(); > > Would be nice if that “this is only safe” information was reflected in the function name. >
Agreed. For the two functions we have that return CGImageRefs we indicate when the image is copied. (makeCGImage vs makeCGImageCopy).
> > Source/WebKit2/Shared/cg/ShareableBitmapCG.cpp:115 > > + // BitmapImage::create adopts the CGImageRef that's passed in, which is why we need to leakRef here. > > Could that be fixed by changing BitmapImage::create to take a RetainPtr?
It could. That's a bit more involved though since BitmapImage::create takes a NativeImagePtr typedef which is currently a CGImageRef typedef. Changing it to RetainPtr<CGImageRef> would introduce ref-churn. Ideally we'd have a more cross-platform solution.
Anders Carlsson
Comment 5
2011-06-15 12:50:37 PDT
Committed
r88967
: <
http://trac.webkit.org/changeset/88967
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug