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 benchmarks
import silk_flags
6 from measurements
import repaint
as repaint_measurement
8 from telemetry
import benchmark
11 class _Repaint(benchmark
.Benchmark
):
13 def AddBenchmarkCommandLineArgs(cls
, parser
):
14 parser
.add_option('--mode', type='string',
16 help='Invalidation mode. '
17 'Supported values: fixed_size, layer, random, viewport.')
18 parser
.add_option('--width', type='int',
20 help='Width of invalidations for fixed_size mode.')
21 parser
.add_option('--height', type='int',
23 help='Height of invalidations for fixed_size mode.')
25 def CreatePageTest(self
, options
):
26 return repaint_measurement
.Repaint(options
.mode
, options
.width
,
29 @benchmark.Enabled('android')
30 class RepaintKeyMobileSites(_Repaint
):
31 """Measures repaint performance on the key mobile sites.
33 http://www.chromium.org/developers/design-documents/rendering-benchmarks"""
34 page_set
= page_sets
.KeyMobileSitesPageSet
37 @benchmark.Enabled('android')
38 class RepaintGpuRasterizationKeyMobileSites(_Repaint
):
39 """Measures repaint performance on the key mobile sites with forced GPU
42 http://www.chromium.org/developers/design-documents/rendering-benchmarks"""
43 tag
= 'gpu_rasterization'
44 page_set
= page_sets
.KeyMobileSitesPageSet
45 def CustomizeBrowserOptions(self
, options
):
46 silk_flags
.CustomizeBrowserOptionsForGpuRasterization(options
)