Changeset 185417 in webkit
- Timestamp:
- Jun 10, 2015 8:58:13 AM (9 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r185416 r185417 1 2015-06-10 KwangHyuk Kim <hyuki.kim@samsung.com> 2 3 [EFL] Jpeg image export implementation for Canvas. 4 https://bugs.webkit.org/show_bug.cgi?id=145457 5 6 Reviewed by Gyuyoung Kim. 7 8 Add implementation of jpeg image export on Webkit EFL by using JPEGImageEncoder. 9 10 No new tests, fast/canvas/toDataURL-supportedTypes.html can be reused. 11 12 * PlatformEfl.cmake: 13 * platform/MIMETypeRegistry.cpp: 14 (WebCore::initializeSupportedImageMIMETypesForEncoding): 15 * platform/graphics/cairo/ImageBufferCairo.cpp: 16 * platform/graphics/efl/ImageBufferEfl.cpp: Added. 17 (WebCore::writeFunction): 18 (WebCore::encodeImage): 19 (WebCore::ImageBuffer::toDataURL): 20 * platform/image-encoders/JPEGImageEncoder.cpp: 21 (WebCore::compressRGBABigEndianToJPEG): 22 1 23 2015-06-10 Carlos Garcia Campos <cgarcia@igalia.com> 2 24 -
trunk/Source/WebCore/PlatformEfl.cmake
r185358 r185417 135 135 platform/graphics/efl/GraphicsContext3DPrivate.cpp 136 136 platform/graphics/efl/IconEfl.cpp 137 platform/graphics/efl/ImageBufferEfl.cpp 137 138 platform/graphics/efl/ImageEfl.cpp 138 139 platform/graphics/efl/IntPointEfl.cpp … … 199 200 platform/graphics/x11/PlatformDisplayX11.cpp 200 201 platform/graphics/x11/XUniqueResource.cpp 202 203 platform/image-encoders/JPEGImageEncoder.cpp 201 204 202 205 platform/image-decoders/ImageDecoder.cpp -
trunk/Source/WebCore/platform/MIMETypeRegistry.cpp
r170091 r185417 268 268 supportedImageMIMETypesForEncoding->add("image/bmp"); 269 269 supportedImageMIMETypesForEncoding->add("image/ico"); 270 #elif PLATFORM(EFL) 271 supportedImageMIMETypesForEncoding->add("image/png"); 272 supportedImageMIMETypesForEncoding->add("image/jpeg"); 270 273 #elif USE(CAIRO) 271 274 supportedImageMIMETypesForEncoding->add("image/png"); -
trunk/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp
r183807 r185417 362 362 } 363 363 364 #if !PLATFORM(GTK) 364 #if !PLATFORM(GTK) && !PLATFORM(EFL) 365 365 static cairo_status_t writeFunction(void* output, const unsigned char* data, unsigned int length) 366 366 { -
trunk/Source/WebCore/platform/image-encoders/JPEGImageEncoder.cpp
r178166 r185417 120 120 rowBuffer.resize(compressData.image_width * 3); 121 121 122 // add offset to prevent clobbered error caused by setjmp and longjmp. 123 unsigned offset = 0; 122 124 const unsigned char* pixel = rgbaBigEndianData; 123 125 const unsigned char* pixelEnd = pixel + compressData.image_width * compressData.image_height * 4; 124 while (pixel < pixelEnd) {126 while (pixel + offset < pixelEnd) { 125 127 JSAMPLE* output = rowBuffer.data(); 126 for (const unsigned char* rowEnd = pixel + compressData.image_width * 4; pixel< rowEnd;) {127 *output++ = static_cast<JSAMPLE>(* pixel++& 0xFF); // red128 *output++ = static_cast<JSAMPLE>(* pixel++& 0xFF); // green129 *output++ = static_cast<JSAMPLE>(* pixel++& 0xFF); // blue130 ++ pixel; // skip alpha128 for (const unsigned char* rowEnd = pixel + offset + compressData.image_width * 4; pixel + offset < rowEnd;) { 129 *output++ = static_cast<JSAMPLE>(*(pixel + offset++) & 0xFF); // red 130 *output++ = static_cast<JSAMPLE>(*(pixel + offset++) & 0xFF); // green 131 *output++ = static_cast<JSAMPLE>(*(pixel + offset++) & 0xFF); // blue 132 ++offset; // skip alpha 131 133 } 132 134 output = rowBuffer.data();
Note: See TracChangeset
for help on using the changeset viewer.