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
12 class _Repaint(benchmark
.Benchmark
):
14 def AddBenchmarkCommandLineArgs(cls
, parser
):
15 parser
.add_option('--mode', type='string',
17 help='Invalidation mode. '
18 'Supported values: fixed_size, layer, random, viewport.')
19 parser
.add_option('--width', type='int',
21 help='Width of invalidations for fixed_size mode.')
22 parser
.add_option('--height', type='int',
24 help='Height of invalidations for fixed_size mode.')
30 def CreatePageTest(self
, options
):
31 return repaint_measurement
.Repaint(options
.mode
, options
.width
,
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
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
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
)
58 return 'repaint.gpu_rasterization.key_mobile_sites_repaint'