Roll src/third_party/WebKit f36d5e0:68b67cd (svn 193299:193303)
[chromium-blink-merge.git] / tools / perf / benchmarks / repaint.py
blobcce589d84a4fce37a587f3f339b9051f97af1760
1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
5 from telemetry import benchmark
7 from benchmarks import silk_flags
8 from measurements import repaint as repaint_measurement
9 import page_sets
12 class _Repaint(benchmark.Benchmark):
13 @classmethod
14 def AddBenchmarkCommandLineArgs(cls, parser):
15 parser.add_option('--mode', type='string',
16 default='viewport',
17 help='Invalidation mode. '
18 'Supported values: fixed_size, layer, random, viewport.')
19 parser.add_option('--width', type='int',
20 default=None,
21 help='Width of invalidations for fixed_size mode.')
22 parser.add_option('--height', type='int',
23 default=None,
24 help='Height of invalidations for fixed_size mode.')
26 @classmethod
27 def Name(cls):
28 return 'repaint'
30 def CreatePageTest(self, options):
31 return repaint_measurement.Repaint(options.mode, options.width,
32 options.height)
34 @benchmark.Enabled('android')
35 class RepaintKeyMobileSites(_Repaint):
36 """Measures repaint performance on the key mobile sites.
38 http://www.chromium.org/developers/design-documents/rendering-benchmarks"""
39 page_set = page_sets.KeyMobileSitesRepaintPageSet
41 @classmethod
42 def Name(cls):
43 return 'repaint.key_mobile_sites_repaint'
46 @benchmark.Enabled('android')
47 class RepaintGpuRasterizationKeyMobileSites(_Repaint):
48 """Measures repaint performance on the key mobile sites with forced GPU
49 rasterization.
51 http://www.chromium.org/developers/design-documents/rendering-benchmarks"""
52 tag = 'gpu_rasterization'
53 page_set = page_sets.KeyMobileSitesRepaintPageSet
54 def CustomizeBrowserOptions(self, options):
55 silk_flags.CustomizeBrowserOptionsForGpuRasterization(options)
56 @classmethod
57 def Name(cls):
58 return 'repaint.gpu_rasterization.key_mobile_sites_repaint'