Commit 7d2215a3 authored by Xianzhu Wang's avatar Xianzhu Wang Committed by Commit Bot

Add a performance test for inline mask painting

This is to evaluate if the mask DstIn optimization[1] is still useful.

[1] https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/paint/InlineFlowBoxPainter.cpp?rcl=399e97834e0f1b08ee104789a87482fd79712da0&l=383

Change-Id: I85b07a05d156020fe8bf20f38c38b722f6efb7a0
Reviewed-on: https://chromium-review.googlesource.com/882496Reviewed-by: default avatarNed Nguyen <nednguyen@google.com>
Reviewed-by: default avatarTien-Ren Chen <trchen@chromium.org>
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#532082}
parent c6221aaa
<!DOCTYPE html>
<body>
<script src="../resources/runner.js"></script>
<script src="resources/paint.js"></script>
<div id="block">
<span id="container" style="-webkit-mask-box-image: url(resources/mask.png) 50 50 50 50"></span>
</div>
<script>
// This test measures the lifecycle update performance when move text
// with mask in a large page.
var initialTextCount = 10000;
var initialText = "";
for (var i = 0; i < initialTextCount; i++) {
if (i % 10 == 0)
initialText += '<br>';
initialText += '<span>abc</span> ';
}
var margin = 10;
measurePaint({
run: function() {
margin += 5;
block.style.marginTop = margin + 'px';
},
setup: function() {
container.innerHTML = initialText;
},
done: function() {
container.innerHTML = '';
},
});
</script>
</body>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment