diff options
author | achicu@adobe.com <achicu@adobe.com@bbb929c8-8fbe-4397-9dbb-9b2b20218538> | 2013-04-24 19:19:07 +0000 |
---|---|---|
committer | achicu@adobe.com <achicu@adobe.com@bbb929c8-8fbe-4397-9dbb-9b2b20218538> | 2013-04-24 19:19:07 +0000 |
commit | 6c7a6501d57f9ec2abcd3c9c049e5596bd85203c (patch) | |
tree | 87bcfba4e5e197d33278a6e720d94a70996dc955 /third_party/WebKit/PerformanceTests | |
parent | ba5b5026c3b0abfd64e5e2c06c113c18275d4c65 (diff) | |
download | chromium_src-6c7a6501d57f9ec2abcd3c9c049e5596bd85203c.zip chromium_src-6c7a6501d57f9ec2abcd3c9c049e5596bd85203c.tar.gz chromium_src-6c7a6501d57f9ec2abcd3c9c049e5596bd85203c.tar.bz2 |
Do not use the OverlapMap in RenderLayerCompositor::computeCompositingRequirements if the layer already
has a 3D transform. This way we can avoid a potential expensive lookup when we know for sure the layer
is already supposed to be composited.
Also, added a bounding box of the overlap map, so that it can catch cases when the new layer is not overlapping
any of the previous layers. This is pretty common when having composited layers laid out in a vertical/horizontal list.
BUG=234455
Review URL: https://chromiumcodereview.appspot.com/14436008
git-svn-id: svn://svn.chromium.org/blink/trunk@149027 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Diffstat (limited to 'third_party/WebKit/PerformanceTests')
-rw-r--r-- | third_party/WebKit/PerformanceTests/Layout/layers_overlap_2d.html | 54 | ||||
-rw-r--r-- | third_party/WebKit/PerformanceTests/Layout/layers_overlap_3d.html | 47 |
2 files changed, 101 insertions, 0 deletions
diff --git a/third_party/WebKit/PerformanceTests/Layout/layers_overlap_2d.html b/third_party/WebKit/PerformanceTests/Layout/layers_overlap_2d.html new file mode 100644 index 0000000..a7d90e2 --- /dev/null +++ b/third_party/WebKit/PerformanceTests/Layout/layers_overlap_2d.html @@ -0,0 +1,54 @@ +<!DOCTYPE html> +<html> + <head> + <title>Performance tester for non-overlaping 2D layers</title> + <style> + .container { + position: relative; + width: 20px; + height: 20px; + border: 1px solid #AAA; + margin: 0 auto 5px; + } + + .box { + width: 100%; + height: 100%; + position: absolute; + background: red; + } + + .composited { + -webkit-transform: translateZ(1px); + } + </style> + <script src="../resources/runner.js"></script> + </head> + <body> + <pre id="log"></pre> + <script> + function createTestFunction(count) { + return function() { + var container = document.createElement("div"); + for(i = 0; i < count; ++i) { + var outer = document.createElement('div'); + outer.className = 'container'; + var inner = document.createElement('div'); + inner.className = 'box'; + if (i == 0) { + // Use at least one 3D layer to trigger the overlap map checking. + inner.className += " composited"; + } + outer.appendChild(inner); + container.appendChild(outer); + } + document.body.appendChild(container); + // Force a layout update. + document.body.clientHeight; + container.remove(); + } + } + PerfTestRunner.measureTime({run: createTestFunction(5000)}); + </script> + </body> +</html> diff --git a/third_party/WebKit/PerformanceTests/Layout/layers_overlap_3d.html b/third_party/WebKit/PerformanceTests/Layout/layers_overlap_3d.html new file mode 100644 index 0000000..5732c3f --- /dev/null +++ b/third_party/WebKit/PerformanceTests/Layout/layers_overlap_3d.html @@ -0,0 +1,47 @@ +<!DOCTYPE html> +<html> + <head> + <title>Performance tester for non-overlaping 3D layers</title> + <style> + .container { + width: 20px; + height: 20px; + border: 1px solid #AAA; + margin: 0 auto 5px; + -webkit-perspective: 400px; + } + + .box { + width: 100%; + height: 100%; + position: absolute; + background: red; + -webkit-transform: translateZ( -200px ); + } + </style> + <script src="../resources/runner.js"></script> + </head> + <body> + <pre id="log"></pre> + <script> + function createTestFunction(count) { + return function() { + var container = document.createElement("div"); + for(i = 0; i < count; ++i) { + var outer = document.createElement('div'); + outer.className = 'container'; + var inner = document.createElement('div'); + inner.className = 'box'; + outer.appendChild(inner); + container.appendChild(outer); + } + document.body.appendChild(container); + // Force a layout update. + document.body.clientHeight; + container.remove(); + } + } + PerfTestRunner.measureTime({run: createTestFunction(5000)}); + </script> + </body> +</html> |