IMAGE_DECODER_DOWN_SAMPLING scales down the size of the big image. CAIRO needs to adjust the source size to the scaled value.
Created attachment 167506 [details] Patch
Created attachment 167507 [details] Testcase before patch
Created attachment 167508 [details] Testcase after patch
Comment on attachment 167506 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=167506&action=review > Source/WebCore/platform/graphics/cairo/BitmapImageCairo.cpp:109 > +#if ENABLE(IMAGE_DECODER_DOWN_SAMPLING) > + cairo_surface_t* surface = nativeImage->surface(); > + IntSize scaledSize(cairo_image_surface_get_width(surface), cairo_image_surface_get_height(surface)); > + FloatRect adjustedSrcRect = adjustSourceRectForDownSampling(srcRect, scaledSize); > +#else > + FloatRect adjustedSrcRect(srcRect); > +#endif > + > + context->platformContext()->drawSurfaceToContext(nativeImage->surface(), dstRect, adjustedSrcRect, context); Okay.
Comment on attachment 167506 [details] Patch Rejecting attachment 167506 [details] from commit-queue. Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '-..." exit_code: 2 Last 500 characters of output: ommit-queue/Source/WebKit/chromium/third_party/snappy/src --revision 63 --non-interactive --force --accept theirs-conflict --ignore-externals' in '/mnt/git/webkit-commit-queue/Source/WebKit/chromium' 49>At revision 63. ________ running '/usr/bin/python tools/clang/scripts/update.py --mac-only' in '/mnt/git/webkit-commit-queue/Source/WebKit/chromium' ________ running '/usr/bin/python gyp_webkit' in '/mnt/git/webkit-commit-queue/Source/WebKit/chromium' Updating webkit projects from gyp files... Full output: http://queues.webkit.org/results/14223318
Created attachment 167638 [details] Fixed patch
No tests. How come?
(In reply to comment #7) > No tests. How come? Good question. As far as I know this isn't turned on yet.
Yes, we need test cases. But I think there are 2 problems. 1. IMAGE_DECODER_DOWN_SAMPLING is a compile-time option. And there are no ports to turn it on. So we need to re-compile to test it. 2. It scales down a big image file. So it's possible to make some troubles in existing test cases using image files. I think it's better to change IMAGE_DECODER_DOWN_SAMPLING as run-time option to turn it on/off dynamically, and then add some test cases.
Comment on attachment 167638 [details] Fixed patch Clearing flags on attachment: 167638 Committed r130706: <http://trac.webkit.org/changeset/130706>
All reviewed patches have been landed. Closing bug.