Changeset 194326 in webkit
- Timestamp:
- Dec 20, 2015, 8:23:09 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 3 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/images/image-copy-memory-usage-expected.txt (added)
-
LayoutTests/fast/images/image-copy-memory-usage.html (added)
-
LayoutTests/fast/images/resources/dot-moving-in-a-circle-animation.gif (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/platform/mac/PasteboardMac.mm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r194319 r194326 1 2015-12-20 Jeremy Zerfas <WebKit@JeremyZerfas.com> 2 3 Don't allocate a NSImage and skip unneeded call to TIFFRepresentation when copying image to clipboard. 4 https://bugs.webkit.org/show_bug.cgi?id=152374 5 6 Reviewed by Darin Adler. 7 8 Added test to make sure that when copying a 50 frame 500x500 animation 9 (50 MB uncompressed) to the clipboard, the additional memory usage is 10 kept to less than 200 MB. 11 12 * fast/images/image-copy-memory-usage-expected.txt: Added. 13 * fast/images/image-copy-memory-usage.html: Added. 14 * fast/images/resources/dot-moving-in-a-circle-animation.gif: Added. 15 1 16 2015-12-20 Commit Queue <commit-queue@webkit.org> 2 17 -
trunk/Source/WebCore/ChangeLog
r194324 r194326 1 2015-12-20 Jeremy Zerfas <WebKit@JeremyZerfas.com> 2 3 Don't allocate a NSImage and skip unneeded call to TIFFRepresentation when copying image to clipboard. 4 https://bugs.webkit.org/show_bug.cgi?id=152374 5 6 Reviewed by Darin Adler. 7 8 When copying an image to the clipboard, don't bother allocating a 9 NSImage and skip the unneeded call to TIFFRepresentation since the data 10 from the previous getTIFFRepresentation call can be used instead. This 11 considerably reduces the amount of memory and CPU time used for large 12 images/animations. 13 14 Test: fast/images/image-copy-memory-usage.html 15 16 * platform/mac/PasteboardMac.mm: 17 (WebCore::Pasteboard::write): 18 1 19 2015-12-20 Gyuyoung Kim <gyuyoung.kim@webkit.org> 2 20 -
trunk/Source/WebCore/platform/mac/PasteboardMac.mm
r183976 r194326 256 256 void Pasteboard::write(const PasteboardImage& pasteboardImage) 257 257 { 258 NSData *imageData = [pasteboardImage.image->getNSImage() TIFFRepresentation];258 CFDataRef imageData = pasteboardImage.image->getTIFFRepresentation(); 259 259 if (!imageData) 260 260 return; … … 264 264 265 265 m_changeCount = writeURLForTypes(writableTypesForImage(), m_pasteboardName, pasteboardImage.url); 266 m_changeCount = platformStrategies()->pasteboardStrategy()->setBufferForType(SharedBuffer::wrap NSData(imageData), NSTIFFPboardType, m_pasteboardName);266 m_changeCount = platformStrategies()->pasteboardStrategy()->setBufferForType(SharedBuffer::wrapCFData(imageData), NSTIFFPboardType, m_pasteboardName); 267 267 writeFileWrapperAsRTFDAttachment(fileWrapper(pasteboardImage), m_pasteboardName, m_changeCount); 268 268 }
Note:
See TracChangeset
for help on using the changeset viewer.