blob: 862d2a6377735dff81dd838c9477304fb2591be1 [file] [log] [blame]
borenet@google.com1558d682012-12-12 20:13:26 +00001# Copyright (c) 2012 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.
4
5
6"""
7This file defines the configurations in which bench_pictures should be run
8on various platforms. The buildbots read these configurations from the
9bench_pictures_cfg dictionary. Everything else in this file exists to help in
10constructing that dictionary.
11
12This code is executed directly on the buildbot so that convenient things like
13variables and loops can be used to avoid unnecessary verbosity. With great power
14comes great responsibility; don't put any nasty code here. To reiterate, code in
15this file will be directly executed on the build slaves.
16"""
17
18
19import os
20import sys
21
22
23if 'import_path' in globals():
24 sys.path.append(import_path)
25
26
27from bench_pictures_cfg_helper import *
28
29
30# Default tile sizes
31DEFAULT_TILE_X = '256'
32DEFAULT_TILE_Y = '256'
33
34
35# Configs to run on most bots
36default_configs = [
37 # Basic CPU and GPU configs
38 TiledBitmapConfig(DEFAULT_TILE_X, DEFAULT_TILE_Y),
39 TiledGPUConfig(DEFAULT_TILE_X, DEFAULT_TILE_Y),
40
41 # CopyTiles
42 CopyTilesConfig(DEFAULT_TILE_X, DEFAULT_TILE_Y),
43
44 # Record
45 RecordConfig(),
46
47 # Multi-threaded
borenet@google.com1558d682012-12-12 20:13:26 +000048 MultiThreadTileConfig(4, DEFAULT_TILE_X, DEFAULT_TILE_Y),
49
50 # Different tile sizes
51 TiledBitmapConfig(512, 512),
borenet@google.com1558d682012-12-12 20:13:26 +000052
53 # Different bounding box heirarchies, for different modes.
borenet@google.com8b954742012-12-19 14:47:53 +000054 RecordRTreeConfig(),
55 PlaybackCreationRTreeConfig(),
borenet@google.com3b98bfd2012-12-17 17:21:04 +000056 TileRTreeConfig( DEFAULT_TILE_X, DEFAULT_TILE_Y),
borenet@google.com8b954742012-12-19 14:47:53 +000057 RecordGridConfig( DEFAULT_TILE_X, DEFAULT_TILE_Y),
58 PlaybackCreationGridConfig( DEFAULT_TILE_X, DEFAULT_TILE_Y),
borenet@google.com3b98bfd2012-12-17 17:21:04 +000059 TileGridConfig( DEFAULT_TILE_X, DEFAULT_TILE_Y),
borenet@google.com1558d682012-12-12 20:13:26 +000060]
61
62
borenet@google.com9afba742012-12-18 21:44:53 +000063def AndroidConfigList(tile_size, scale, cores, viewport, do_gpu=True):
64 tile_x = tile_size[0]
65 tile_y = tile_size[1]
66
67 viewport_x = viewport[0]
68 viewport_y = viewport[1]
69
70 configs = [
71 # Record
borenet@google.com8b954742012-12-19 14:47:53 +000072 RecordConfig( scale=str(scale)),
73 RecordRTreeConfig(scale=str(scale)),
borenet@google.com9afba742012-12-18 21:44:53 +000074 RecordGridConfig( tile_x, tile_y, scale=str(scale)),
75
76 # Tiled playback
77 TiledBitmapConfig(tile_x, tile_y, scale=str(scale)),
78 TileRTreeConfig( tile_x, tile_y, scale=str(scale)),
79 TileGridConfig( tile_x, tile_y, scale=str(scale)),
80
81 # Viewport playback
82 ViewportBitmapConfig(viewport_x, viewport_y, scale=str(scale)),
83 ViewportRTreeConfig( viewport_x, viewport_y, scale=str(scale)),
borenet@google.com9afba742012-12-18 21:44:53 +000084 ]
85
86 if do_gpu:
87 configs.append(TiledGPUConfig(tile_x, tile_y, scale=str(scale)))
88 configs.append(ViewportGPUConfig(viewport_x, viewport_y, scale=str(scale)))
89
90 # Multicore
91 for num_cores in cores:
92 configs.append(MultiThreadTileConfig(num_cores, tile_x, tile_y,
93 scale=str(scale)))
94
95 return configs
borenet@google.com1558d682012-12-12 20:13:26 +000096
97
borenet@google.com1ce5cef2013-05-07 12:09:54 +000098msaa4 = Config(config='msaa4')
99
100
borenet@google.com1558d682012-12-12 20:13:26 +0000101# This dictionary defines the sets of configs for all platforms. Each config is
102# a dictionary of key/value pairs directly corresponding to the command-line
103# flags passed to bench_pictures.
104bench_pictures_cfg = {
scroggo@google.com161e1ba2013-03-04 16:41:06 +0000105 'angle': [TiledConfig(DEFAULT_TILE_X, DEFAULT_TILE_Y, config='angle')],
borenet@google.com8234e542012-12-14 13:04:24 +0000106 'debug': [TiledBitmapConfig(DEFAULT_TILE_X, DEFAULT_TILE_Y)],
borenet@google.com1558d682012-12-12 20:13:26 +0000107 'default': default_configs,
scroggo@google.com161e1ba2013-03-04 16:41:06 +0000108 'no_gpu': [cfg for cfg in default_configs if cfg['config'] != 'gpu'],
borenet@google.com8b954742012-12-19 14:47:53 +0000109 'nexus_s': AndroidConfigList((256, 256), 0.4897, [], (480, 800),
borenet@google.com9afba742012-12-18 21:44:53 +0000110 do_gpu=False),
borenet@google.com8b954742012-12-19 14:47:53 +0000111 'xoom': AndroidConfigList((256, 256), 1.2244, [], (1200, 800)),
borenet@google.com1ce5cef2013-05-07 12:09:54 +0000112 'galaxy_nexus': AndroidConfigList((256, 256), 0.8163, [], (800, 1280)) + \
113 [msaa4],
borenet@google.com8b954742012-12-19 14:47:53 +0000114 'nexus_4': AndroidConfigList((256, 256), 0.7836, [], (768, 1280)),
robertphillips@google.coma99aba72013-08-28 12:31:49 +0000115 'nexus_7': AndroidConfigList((256, 256), 1.3061, [4], (1280, 800)),
borenet@google.comfc52e312013-07-15 13:50:35 +0000116 'nexus_10': AndroidConfigList((512, 512), 2.6122, [], (2560, 1600),
117 do_gpu=False) + [msaa4],
borenet@google.com1ce5cef2013-05-07 12:09:54 +0000118 'razr_i': AndroidConfigList((256, 256), 0.5510, [], (540, 960)) + \
119 [msaa4],
borenet@google.com065224d2013-08-13 20:32:22 +0000120 'intel_rhb': AndroidConfigList((256, 256), 0.5510, [], (540, 960)) + \
121 [msaa4],
scroggo@google.com161e1ba2013-03-04 16:41:06 +0000122}