Changeset 225091 in webkit
- Timestamp:
- Nov 21, 2017 10:54:50 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ChangeLog
r225066 r225091 1 2017-11-21 Zan Dobersek <zdobersek@igalia.com> 2 3 Drop ENABLE_IMAGE_DECODER_DOWN_SAMPLING code 4 https://bugs.webkit.org/show_bug.cgi?id=179921 5 6 Reviewed by Carlos Garcia Campos. 7 8 * Source/cmake/WebKitFeatures.cmake: Remove the CMake option that 9 enabled IMAGE_DECODER_DOWN_SAMPLING code. 10 1 11 2017-11-20 Carlos Garcia Campos <cgarcia@igalia.com> 2 12 -
trunk/Source/WTF/ChangeLog
r225042 r225091 1 2017-11-21 Zan Dobersek <zdobersek@igalia.com> 2 3 Drop ENABLE_IMAGE_DECODER_DOWN_SAMPLING code 4 https://bugs.webkit.org/show_bug.cgi?id=179921 5 6 Reviewed by Carlos Garcia Campos. 7 8 * wtf/FeatureDefines.h: Remove the ENABLE_IMAGE_DECODER_DOWN_SAMPLING 9 definition. 10 1 11 2017-11-19 Tim Horton <timothy_horton@apple.com> 2 12 -
trunk/Source/WTF/wtf/FeatureDefines.h
r225042 r225091 421 421 #endif 422 422 423 #if !defined(ENABLE_IMAGE_DECODER_DOWN_SAMPLING)424 #define ENABLE_IMAGE_DECODER_DOWN_SAMPLING 0425 #endif426 427 423 #if !defined(ENABLE_INDEXED_DATABASE) 428 424 #define ENABLE_INDEXED_DATABASE 0 -
trunk/Source/WebCore/ChangeLog
r225090 r225091 1 2017-11-21 Zan Dobersek <zdobersek@igalia.com> 2 3 Drop ENABLE_IMAGE_DECODER_DOWN_SAMPLING code 4 https://bugs.webkit.org/show_bug.cgi?id=179921 5 6 Reviewed by Carlos Garcia Campos. 7 8 Drop the ENABLE_IMAGE_DECODER_DOWN_SAMPLING code, along with the build 9 guard definitions in WTF and CMake. 10 11 This was apparently in use in the Qt port, but since then no port 12 enables this. It's not exposed in the Xcode build, and the CMake option 13 is disabled by default, with no way to enable it through build-webkit. 14 15 While the code guarded with this build guard is removed, there's still 16 code in the ScalableImageDecoder class that only operated when this 17 feature was enabled. This should be addressed in the future, after 18 evaluating the need for this scaling capability. 19 20 No new tests -- no change in behavior. 21 22 * platform/graphics/Image.cpp: 23 (WebCore::Image::adjustSourceRectForDownSampling const): Deleted. 24 * platform/graphics/Image.h: 25 * platform/graphics/cairo/CairoOperations.cpp: 26 (WebCore::Cairo::drawNativeImage): 27 * platform/image-decoders/ScalableImageDecoder.h: 28 * platform/image-decoders/jpeg/JPEGImageDecoder.cpp: 29 (WebCore::JPEGImageReader::decode): 30 * platform/image-decoders/png/PNGImageDecoder.cpp: 31 (WebCore::PNGImageDecoder::rowAvailable): 32 (WebCore::PNGImageDecoder::frameComplete): 33 1 34 2017-11-21 Commit Queue <commit-queue@webkit.org> 2 35 -
trunk/Source/WebCore/platform/graphics/Image.cpp
r224731 r225091 302 302 } 303 303 304 #if ENABLE(IMAGE_DECODER_DOWN_SAMPLING)305 FloatRect Image::adjustSourceRectForDownSampling(const FloatRect& srcRect, const IntSize& scaledSize) const306 {307 const FloatSize unscaledSize = size();308 if (unscaledSize == scaledSize)309 return srcRect;310 311 // Image has been down-sampled.312 float xscale = static_cast<float>(scaledSize.width()) / unscaledSize.width();313 float yscale = static_cast<float>(scaledSize.height()) / unscaledSize.height();314 FloatRect scaledSrcRect = srcRect;315 scaledSrcRect.scale(xscale, yscale);316 317 return scaledSrcRect;318 }319 #endif320 321 304 void Image::computeIntrinsicDimensions(Length& intrinsicWidth, Length& intrinsicHeight, FloatSize& intrinsicRatio) 322 305 { -
trunk/Source/WebCore/platform/graphics/Image.h
r222246 r225091 177 177 const FloatPoint& phase, const FloatSize& spacing, CompositeOperator, BlendMode = BlendModeNormal); 178 178 179 #if ENABLE(IMAGE_DECODER_DOWN_SAMPLING)180 FloatRect adjustSourceRectForDownSampling(const FloatRect& srcRect, const IntSize& scaledSize) const;181 #endif182 183 179 #if !ASSERT_DISABLED 184 180 virtual bool notSolidColor() { return true; } -
trunk/Source/WebCore/platform/graphics/cairo/CairoOperations.cpp
r225077 r225091 657 657 Cairo::State::setCompositeOperation(platformContext, compositeOperator, blendMode); 658 658 659 #if ENABLE(IMAGE_DECODER_DOWN_SAMPLING)660 IntSize scaledSize = nativeImageSize(surface);661 FloatRect src = adjustSourceRectForDownSampling(srcRect, scaledSize);662 #else663 FloatRect src(srcRect);664 #endif665 666 659 FloatRect dst = destRect; 667 668 660 if (orientation != DefaultImageOrientation) { 669 661 // ImageOrientation expects the origin to be at (0, 0). … … 678 670 } 679 671 680 platformContext.drawSurfaceToContext(surface, dst, src , targetContext);672 platformContext.drawSurfaceToContext(surface, dst, srcRect, targetContext); 681 673 platformContext.restore(); 682 674 } -
trunk/Source/WebCore/platform/image-decoders/ScalableImageDecoder.h
r223968 r225091 43 43 // ScalableImageDecoder is a base for all format-specific decoders 44 44 // (e.g. JPEGImageDecoder). This base manages the ImageFrame cache. 45 // 46 // ENABLE(IMAGE_DECODER_DOWN_SAMPLING) allows image decoders to downsample 47 // at decode time. Image decoders will downsample any images larger than 48 // |m_maxNumPixels|. FIXME: Not yet supported by all decoders. 45 49 46 class ScalableImageDecoder : public ImageDecoder { 50 47 WTF_MAKE_NONCOPYABLE(ScalableImageDecoder); WTF_MAKE_FAST_ALLOCATED; … … 222 219 EncodedDataStatus m_encodedDataStatus { EncodedDataStatus::TypeAvailable }; 223 220 bool m_decodingSizeFromSetData { false }; 224 #if ENABLE(IMAGE_DECODER_DOWN_SAMPLING) 225 static const int m_maxNumPixels { 1024 * 1024 }; 226 #else 221 222 // FIXME: Evaluate the need for decoded data scaling. m_scaled, 223 // m_scaledColumns and m_scaledRows are member variables that are 224 // affected by this value, and are not used at all since the value 225 // is negavite (see prepareScaleDataIfNecessary()). 227 226 static const int m_maxNumPixels { -1 }; 228 #endif229 227 }; 230 228 -
trunk/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
r223728 r225091 328 328 m_decoder->setOrientation(readImageOrientation(info())); 329 329 330 #if ENABLE(IMAGE_DECODER_DOWN_SAMPLING) && defined(TURBO_JPEG_RGB_SWIZZLE)331 // There's no point swizzle decoding if image down sampling will332 // be applied. Revert to using JSC_RGB in that case.333 if (m_decoder->willDownSample() && turboSwizzled(m_info.out_color_space))334 m_info.out_color_space = JCS_RGB;335 #endif336 330 // Don't allocate a giant and superfluous memory buffer when the 337 331 // image is a sequential JPEG. -
trunk/Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp
r223728 r225091 518 518 unsigned char nonTrivialAlphaMask = 0; 519 519 520 #if ENABLE(IMAGE_DECODER_DOWN_SAMPLING) 521 if (m_scaled) { 522 for (int x = 0; x < width; ++x, ++address) { 523 png_bytep pixel = row + m_scaledColumns[x] * colorChannels; 524 unsigned alpha = hasAlpha ? pixel[3] : 255; 520 png_bytep pixel = row; 521 if (hasAlpha) { 522 for (int x = 0; x < width; ++x, pixel += 4, ++address) { 523 unsigned alpha = pixel[3]; 525 524 buffer.backingStore()->setPixel(address, pixel[0], pixel[1], pixel[2], alpha); 526 525 nonTrivialAlphaMask |= (255 - alpha); 527 526 } 528 } else 529 #endif 530 { 531 png_bytep pixel = row; 532 if (hasAlpha) { 533 for (int x = 0; x < width; ++x, pixel += 4, ++address) { 534 unsigned alpha = pixel[3]; 535 buffer.backingStore()->setPixel(address, pixel[0], pixel[1], pixel[2], alpha); 536 nonTrivialAlphaMask |= (255 - alpha); 537 } 538 } else { 539 for (int x = 0; x < width; ++x, pixel += 3, ++address) 540 *address = makeRGB(pixel[0], pixel[1], pixel[2]); 541 } 527 } else { 528 for (int x = 0; x < width; ++x, pixel += 3, ++address) 529 *address = makeRGB(pixel[0], pixel[1], pixel[2]); 542 530 } 543 531 … … 836 824 m_blend = 0; 837 825 838 #if ENABLE(IMAGE_DECODER_DOWN_SAMPLING)839 for (int y = 0; y < rect.maxY() - rect.y(); ++y) {840 png_bytep row = interlaceBuffer + (m_scaled ? m_scaledRows[y] : y) * colorChannels * size().width();841 RGBA32* address = buffer.backingStore()->pixelAt(rect.x(), y + rect.y());842 for (int x = 0; x < rect.maxX() - rect.x(); ++x) {843 png_bytep pixel = row + (m_scaled ? m_scaledColumns[x] : x) * colorChannels;844 unsigned alpha = hasAlpha ? pixel[3] : 255;845 nonTrivialAlpha |= alpha < 255;846 if (!m_blend)847 buffer.backingStore()->setPixel(address++, pixel[0], pixel[1], pixel[2], alpha);848 else849 buffer.backingStore()->blendPixel(address++, pixel[0], pixel[1], pixel[2], alpha);850 }851 }852 #else853 826 ASSERT(!m_scaled); 854 827 png_bytep row = interlaceBuffer; … … 865 838 } 866 839 } 867 #endif868 840 869 841 if (!nonTrivialAlpha) { -
trunk/Source/cmake/WebKitFeatures.cmake
r225050 r225091 113 113 WEBKIT_OPTION_DEFINE(ENABLE_GEOLOCATION "Toggle Geolocation support" PRIVATE OFF) 114 114 WEBKIT_OPTION_DEFINE(ENABLE_ICONDATABASE "Toggle Icon database support" PRIVATE ON) 115 WEBKIT_OPTION_DEFINE(ENABLE_IMAGE_DECODER_DOWN_SAMPLING "Toggle image decoder down sampling support" PRIVATE OFF)116 115 WEBKIT_OPTION_DEFINE(ENABLE_INDEXED_DATABASE "Toggle Indexed Database API support" PRIVATE OFF) 117 116 WEBKIT_OPTION_DEFINE(ENABLE_INDEXED_DATABASE_IN_WORKERS "Toggle support for indexed database in workers" PRIVATE OFF)
Note: See TracChangeset
for help on using the changeset viewer.