haikuwebkit/PerformanceTests/Canvas/drawimage.html

24 lines
562 B
HTML
Raw Permalink Normal View History

inconsistency in drawImage with target rect negative dimensions. https://bugs.webkit.org/show_bug.cgi?id=100026 Patch by Arnaud Renevier <a.renevier@sisa.samsung.com> on 2013-01-16 Reviewed by Dean Jackson. PerformanceTests: Create a drawImage performance test. There is no significative change in performance: 27144.6851528 runs/s without the patch; 27153.517612 runs/s with the patch. Test is currently skipped. * Canvas/drawimage.html: Added. * Skipped: Source/WebCore: Remove -1, -1 special case in drawImage and drawImageBuffer. Replace all -1 -1 arguments calls to with the correct rectangle dimensions. Remove FloatRect(0, 0, -1, -1) default argument for srcRect, and instead, add new overloaded functions to create a FloatRect from image size. Replace -1 -1 arguments calls in FEComposite::platformApplySoftware with correct rectangle dimensions. Replace ImageGStreamer rect method (which may return -1 -1 rectangle) with cropRect method, and make caller check for rectangle emptiness. * fast/canvas/drawImage-with-negative-source-destination-expected.txt: * fast/canvas/drawImage-with-negative-source-destination.js: * platform/graphics/GraphicsContext.cpp: (WebCore::GraphicsContext::drawImage): (WebCore): (WebCore::GraphicsContext::drawImageBuffer): * platform/graphics/GraphicsContext.h: (GraphicsContext): * platform/graphics/filters/FEComposite.cpp: (WebCore::FEComposite::platformApplySoftware): * platform/graphics/gstreamer/ImageGStreamer.h: (WebCore::ImageGStreamer::rect): LayoutTests: Add a drawImage check for a destination rectangle with -1px width/height. When drawing to (1, 1, -1, -1) rectangle, first (top-left) pixel should have been and been the only one drawn into. * fast/canvas/drawImage-with-negative-source-destination-expected.txt: * fast/canvas/drawImage-with-negative-source-destination.js: Canonical link: https://commits.webkit.org/125286@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@139911 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-01-16 20:25:06 +00:00
<!DOCTYPE html>
<html>
<body>
<script src="../resources/runner.js"></script>
<script>
var source = document.createElement("canvas");
source.width = 300;
source.height = 150;
source.getContext("2d").fillStyle = 'green';
source.getContext("2d").fillRect(0, 0, source.width, source.height);
var target = document.createElement("canvas");
target.width = source.width;
target.height = source.height;
var context = target.getContext("2d")
PerfTestRunner.measureRunsPerSecond({run: function() {
context.drawImage(source, 0, 0);
}});
</script>
</body>
</html>