WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
141578
Make WebCore::IOSurface have single ownership instead of refcounting
https://bugs.webkit.org/show_bug.cgi?id=141578
Summary
Make WebCore::IOSurface have single ownership instead of refcounting
Tim Horton
Reported
2015-02-13 14:44:22 PST
Make WebCore::IOSurface have single ownership instead of refcounting
Attachments
Patch
(21.22 KB, patch)
2015-02-13 14:44 PST
,
Tim Horton
andersca
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Tim Horton
Comment 1
2015-02-13 14:44:45 PST
Created
attachment 246551
[details]
Patch
Anders Carlsson
Comment 2
2015-02-13 15:17:08 PST
Comment on
attachment 246551
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=246551&action=review
Looks like most of the member variables of IOSurface can be const.
> Source/WebCore/platform/graphics/cg/IOSurfacePool.cpp:138 > + return WTF::move(surface);
No need to use WTF::move here.
> Source/WebCore/platform/graphics/cg/IOSurfacePool.cpp:155 > + return WTF::move(surface);
No need to use WTF::move here.
> Source/WebCore/platform/graphics/cg/IOSurfacePool.cpp:174 > + willAddSurface(surface.get(), surfaceIsInUse);
Maybe this should take a reference.
> Source/WebCore/platform/graphics/cg/IOSurfacePool.cpp:210 > + std::unique_ptr<IOSurface> surface = m_inUseSurfaces.takeLast();
This should be auto.
> Source/WebCore/platform/graphics/cg/IOSurfacePool.cpp:224 > + std::unique_ptr<IOSurface> surface = surfaceQueueIter->value.takeLast();
auto.
> Source/WebCore/platform/graphics/cocoa/IOSurface.mm:70 > + std::unique_ptr<IOSurface> surface = IOSurface::create(IntSize(width, height), ColorSpaceDeviceRGB);
auto.
> Source/WebCore/platform/graphics/cocoa/IOSurface.mm:75 > + return WTF::move(surface);
No need to use WTF::move here.
> Source/WebKit2/UIProcess/API/mac/WKView.mm:3229 > + std::unique_ptr<IOSurface> surface = IOSurface::createFromImage(croppedSnapshotImage.get());
auto!
> Source/WebKit2/UIProcess/mac/ViewSnapshotStore.mm:137 > +PassRefPtr<ViewSnapshot> ViewSnapshot::create(std::unique_ptr<IOSurface> surface)
This should return a Ref.
> Source/WebKit2/UIProcess/mac/ViewSnapshotStore.mm:161 > +#if USE_IOSURFACE_VIEW_SNAPSHOTS > + m_imageSizeInBytes = m_surface->totalBytes(); > + m_size = m_surface->size(); > +#endif
These can be member initializers.
Tim Horton
Comment 3
2015-02-13 16:08:41 PST
http://trac.webkit.org/changeset/180088
Tim Horton
Comment 4
2015-02-13 16:16:13 PST
And a build fix:
http://trac.webkit.org/changeset/180089
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