Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(284)

Unified Diff: PerformanceTests/Animation/mix-blend-mode-propagating-isolation.html

Issue 643693006: Add performance tests for accelerated elements with CSS Blending. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: PerformanceTests/Animation/mix-blend-mode-propagating-isolation.html
diff --git a/PerformanceTests/Blending/mix-blend-mode-propagating-isolation.html b/PerformanceTests/Animation/mix-blend-mode-propagating-isolation.html
similarity index 65%
rename from PerformanceTests/Blending/mix-blend-mode-propagating-isolation.html
rename to PerformanceTests/Animation/mix-blend-mode-propagating-isolation.html
index b0f4bdbb3d0aedb9f10286d54e5bbcc03f39ac7e..5c1c4e731d1bd2bd85865c6260094e493c4ec598 100644
--- a/PerformanceTests/Blending/mix-blend-mode-propagating-isolation.html
+++ b/PerformanceTests/Animation/mix-blend-mode-propagating-isolation.html
@@ -1,6 +1,8 @@
<!DOCTYPE html>
<html>
<head>
+ <title>Painting deep tree with CSS Blending</title>
+ <!-- https://codereview.chromium.org/478333002/ -->
<style>
.box {
width: 100px;
@@ -23,8 +25,13 @@
<script src="../resources/runner.js"></script>
<script src="resources/framerate.js"></script>
<script>
+ var intervalId = 0;
window.onload = function () {
- PerfTestRunner.prepareToMeasureValuesAsync({done: onCompletedRun, unit: 'fps'});
+ PerfTestRunner.prepareToMeasureValuesAsync({
+ description: "Measure performance of software-animating a deep DOM subtree having one blending leaf.",
+ done: onCompletedRun,
+ unit: 'fps'
+ });
// The leaf element has blending
var lastElement = document.createElement("div");
@@ -38,16 +45,19 @@
}
var container = document.getElementById("container");
container.appendChild(lastElement);
- startTrackingFrameRate({run: softwareAnimationStep});
+
+ intervalId = window.setInterval(function () {
+ var leftVal = parseInt(container.style.left) || 0;
+ container.style.left = (leftVal + 1) + "px";
+ }, 16);
+
+ startTrackingFrameRate();
}
function onCompletedRun() {
+ clearInterval(intervalId);
stopTrackingFrameRate();
}
- function softwareAnimationStep() {
- var leftVal = parseInt(container.style.left) || 0;
- container.style.left = (leftVal + 1) + "px";
- }
</script>
</head>
<body>

Powered by Google App Engine
This is Rietveld 408576698