OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 from telemetry import benchmark | 5 from telemetry import benchmark |
6 | 6 |
7 from benchmarks import silk_flags | 7 from benchmarks import silk_flags |
8 from measurements import repaint as repaint_measurement | 8 from measurements import repaint as repaint_measurement |
9 import page_sets | 9 import page_sets |
10 | 10 |
11 | 11 |
12 class _Repaint(benchmark.Benchmark): | 12 class _Repaint(benchmark.Benchmark): |
13 @classmethod | 13 @classmethod |
14 def AddBenchmarkCommandLineArgs(cls, parser): | 14 def AddBenchmarkCommandLineArgs(cls, parser): |
15 parser.add_option('--mode', type='string', | 15 parser.add_option('--mode', type='string', |
16 default='viewport', | 16 default='viewport', |
17 help='Invalidation mode. ' | 17 help='Invalidation mode. ' |
18 'Supported values: fixed_size, layer, random, viewport.') | 18 'Supported values: fixed_size, layer, random, viewport.') |
19 parser.add_option('--width', type='int', | 19 parser.add_option('--width', type='int', |
20 default=None, | 20 default=None, |
21 help='Width of invalidations for fixed_size mode.') | 21 help='Width of invalidations for fixed_size mode.') |
22 parser.add_option('--height', type='int', | 22 parser.add_option('--height', type='int', |
23 default=None, | 23 default=None, |
24 help='Height of invalidations for fixed_size mode.') | 24 help='Height of invalidations for fixed_size mode.') |
25 | 25 |
26 @classmethod | 26 @classmethod |
27 def Name(cls): | 27 def Name(cls): |
28 return 'repaint' | 28 return 'repaint' |
29 | 29 |
| 30 def CreateUserStorySet(self, options): |
| 31 return page_sets.KeyMobileSitesRepaintPageSet( |
| 32 options.mode, options.width, options.height) |
| 33 |
30 def CreatePageTest(self, options): | 34 def CreatePageTest(self, options): |
31 return repaint_measurement.Repaint(options.mode, options.width, | 35 return repaint_measurement.Repaint() |
32 options.height) | |
33 | 36 |
34 @benchmark.Enabled('android') | 37 @benchmark.Enabled('android') |
35 class RepaintKeyMobileSites(_Repaint): | 38 class RepaintKeyMobileSites(_Repaint): |
36 """Measures repaint performance on the key mobile sites. | 39 """Measures repaint performance on the key mobile sites. |
37 | 40 |
38 http://www.chromium.org/developers/design-documents/rendering-benchmarks""" | 41 http://www.chromium.org/developers/design-documents/rendering-benchmarks""" |
39 page_set = page_sets.KeyMobileSitesRepaintPageSet | |
40 | 42 |
41 @classmethod | 43 @classmethod |
42 def Name(cls): | 44 def Name(cls): |
43 return 'repaint.key_mobile_sites_repaint' | 45 return 'repaint.key_mobile_sites_repaint' |
44 | 46 |
45 | 47 |
46 @benchmark.Enabled('android') | 48 @benchmark.Enabled('android') |
47 class RepaintGpuRasterizationKeyMobileSites(_Repaint): | 49 class RepaintGpuRasterizationKeyMobileSites(_Repaint): |
48 """Measures repaint performance on the key mobile sites with forced GPU | 50 """Measures repaint performance on the key mobile sites with forced GPU |
49 rasterization. | 51 rasterization. |
50 | 52 |
51 http://www.chromium.org/developers/design-documents/rendering-benchmarks""" | 53 http://www.chromium.org/developers/design-documents/rendering-benchmarks""" |
52 tag = 'gpu_rasterization' | 54 tag = 'gpu_rasterization' |
53 page_set = page_sets.KeyMobileSitesRepaintPageSet | |
54 def CustomizeBrowserOptions(self, options): | 55 def CustomizeBrowserOptions(self, options): |
55 silk_flags.CustomizeBrowserOptionsForGpuRasterization(options) | 56 silk_flags.CustomizeBrowserOptionsForGpuRasterization(options) |
| 57 |
56 @classmethod | 58 @classmethod |
57 def Name(cls): | 59 def Name(cls): |
58 return 'repaint.gpu_rasterization.key_mobile_sites_repaint' | 60 return 'repaint.gpu_rasterization.key_mobile_sites_repaint' |
59 | 61 |
OLD | NEW |