blob: c6bd01e5e9e585d8e7191c76862cd5bc2d660ebb [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
48 MultiThreadTileConfig(2, DEFAULT_TILE_X, DEFAULT_TILE_Y),
49 MultiThreadTileConfig(3, DEFAULT_TILE_X, DEFAULT_TILE_Y),
50 MultiThreadTileConfig(4, DEFAULT_TILE_X, DEFAULT_TILE_Y),
51
52 # Different tile sizes
53 TiledBitmapConfig(512, 512),
54 TiledBitmapConfig(1024, 256),
55 TiledBitmapConfig(1024, 64),
56
57 # Different bounding box heirarchies, for different modes.
borenet@google.com8b954742012-12-19 14:47:53 +000058 RecordRTreeConfig(),
59 PlaybackCreationRTreeConfig(),
borenet@google.com3b98bfd2012-12-17 17:21:04 +000060 TileRTreeConfig( DEFAULT_TILE_X, DEFAULT_TILE_Y),
borenet@google.com8b954742012-12-19 14:47:53 +000061 RecordGridConfig( DEFAULT_TILE_X, DEFAULT_TILE_Y),
62 PlaybackCreationGridConfig( DEFAULT_TILE_X, DEFAULT_TILE_Y),
borenet@google.com3b98bfd2012-12-17 17:21:04 +000063 TileGridConfig( DEFAULT_TILE_X, DEFAULT_TILE_Y),
borenet@google.com1558d682012-12-12 20:13:26 +000064]
65
66
borenet@google.com9afba742012-12-18 21:44:53 +000067def AndroidConfigList(tile_size, scale, cores, viewport, do_gpu=True):
68 tile_x = tile_size[0]
69 tile_y = tile_size[1]
70
71 viewport_x = viewport[0]
72 viewport_y = viewport[1]
73
74 configs = [
75 # Record
borenet@google.com8b954742012-12-19 14:47:53 +000076 RecordConfig( scale=str(scale)),
77 RecordRTreeConfig(scale=str(scale)),
borenet@google.com9afba742012-12-18 21:44:53 +000078 RecordGridConfig( tile_x, tile_y, scale=str(scale)),
79
80 # Tiled playback
81 TiledBitmapConfig(tile_x, tile_y, scale=str(scale)),
82 TileRTreeConfig( tile_x, tile_y, scale=str(scale)),
83 TileGridConfig( tile_x, tile_y, scale=str(scale)),
84
85 # Viewport playback
86 ViewportBitmapConfig(viewport_x, viewport_y, scale=str(scale)),
87 ViewportRTreeConfig( viewport_x, viewport_y, scale=str(scale)),
borenet@google.com9afba742012-12-18 21:44:53 +000088 ]
89
90 if do_gpu:
91 configs.append(TiledGPUConfig(tile_x, tile_y, scale=str(scale)))
92 configs.append(ViewportGPUConfig(viewport_x, viewport_y, scale=str(scale)))
93
94 # Multicore
95 for num_cores in cores:
96 configs.append(MultiThreadTileConfig(num_cores, tile_x, tile_y,
97 scale=str(scale)))
98
99 return configs
borenet@google.com1558d682012-12-12 20:13:26 +0000100
101
borenet@google.com1ce5cef2013-05-07 12:09:54 +0000102msaa4 = Config(config='msaa4')
103
104
borenet@google.com1558d682012-12-12 20:13:26 +0000105# This dictionary defines the sets of configs for all platforms. Each config is
106# a dictionary of key/value pairs directly corresponding to the command-line
107# flags passed to bench_pictures.
108bench_pictures_cfg = {
scroggo@google.com161e1ba2013-03-04 16:41:06 +0000109 'angle': [TiledConfig(DEFAULT_TILE_X, DEFAULT_TILE_Y, config='angle')],
borenet@google.com8234e542012-12-14 13:04:24 +0000110 'debug': [TiledBitmapConfig(DEFAULT_TILE_X, DEFAULT_TILE_Y)],
borenet@google.com1558d682012-12-12 20:13:26 +0000111 'default': default_configs,
scroggo@google.com161e1ba2013-03-04 16:41:06 +0000112 'no_gpu': [cfg for cfg in default_configs if cfg['config'] != 'gpu'],
borenet@google.com8b954742012-12-19 14:47:53 +0000113 'nexus_s': AndroidConfigList((256, 256), 0.4897, [], (480, 800),
borenet@google.com9afba742012-12-18 21:44:53 +0000114 do_gpu=False),
borenet@google.com8b954742012-12-19 14:47:53 +0000115 'xoom': AndroidConfigList((256, 256), 1.2244, [], (1200, 800)),
borenet@google.com1ce5cef2013-05-07 12:09:54 +0000116 'galaxy_nexus': AndroidConfigList((256, 256), 0.8163, [], (800, 1280)) + \
117 [msaa4],
borenet@google.com8b954742012-12-19 14:47:53 +0000118 'nexus_4': AndroidConfigList((256, 256), 0.7836, [], (768, 1280)),
119 'nexus_7': AndroidConfigList((256, 256), 1.3061, [2], (1280, 800)),
borenet@google.com1ce5cef2013-05-07 12:09:54 +0000120 'nexus_10': AndroidConfigList((512, 512), 2.6122, [], (2560, 1600)) + \
121 [msaa4],
122 'razr_i': AndroidConfigList((256, 256), 0.5510, [], (540, 960)) + \
123 [msaa4],
scroggo@google.com161e1ba2013-03-04 16:41:06 +0000124}