borenet@google.com | 1558d68 | 2012-12-12 20:13:26 +0000 | [diff] [blame] | 1 | # 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 | """ |
| 7 | This file defines the configurations in which bench_pictures should be run |
| 8 | on various platforms. The buildbots read these configurations from the |
| 9 | bench_pictures_cfg dictionary. Everything else in this file exists to help in |
| 10 | constructing that dictionary. |
| 11 | |
| 12 | This code is executed directly on the buildbot so that convenient things like |
| 13 | variables and loops can be used to avoid unnecessary verbosity. With great power |
| 14 | comes great responsibility; don't put any nasty code here. To reiterate, code in |
| 15 | this file will be directly executed on the build slaves. |
| 16 | """ |
| 17 | |
| 18 | |
| 19 | import os |
| 20 | import sys |
| 21 | |
| 22 | |
| 23 | if 'import_path' in globals(): |
| 24 | sys.path.append(import_path) |
| 25 | |
| 26 | |
| 27 | from bench_pictures_cfg_helper import * |
| 28 | |
| 29 | |
| 30 | # Default tile sizes |
| 31 | DEFAULT_TILE_X = '256' |
| 32 | DEFAULT_TILE_Y = '256' |
| 33 | |
| 34 | |
| 35 | # Configs to run on most bots |
| 36 | default_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.com | 1558d68 | 2012-12-12 20:13:26 +0000 | [diff] [blame] | 48 | MultiThreadTileConfig(4, DEFAULT_TILE_X, DEFAULT_TILE_Y), |
| 49 | |
| 50 | # Different tile sizes |
| 51 | TiledBitmapConfig(512, 512), |
borenet@google.com | 1558d68 | 2012-12-12 20:13:26 +0000 | [diff] [blame] | 52 | |
| 53 | # Different bounding box heirarchies, for different modes. |
borenet@google.com | 8b95474 | 2012-12-19 14:47:53 +0000 | [diff] [blame] | 54 | RecordRTreeConfig(), |
| 55 | PlaybackCreationRTreeConfig(), |
borenet@google.com | 3b98bfd | 2012-12-17 17:21:04 +0000 | [diff] [blame] | 56 | TileRTreeConfig( DEFAULT_TILE_X, DEFAULT_TILE_Y), |
borenet@google.com | 8b95474 | 2012-12-19 14:47:53 +0000 | [diff] [blame] | 57 | RecordGridConfig( DEFAULT_TILE_X, DEFAULT_TILE_Y), |
| 58 | PlaybackCreationGridConfig( DEFAULT_TILE_X, DEFAULT_TILE_Y), |
borenet@google.com | 3b98bfd | 2012-12-17 17:21:04 +0000 | [diff] [blame] | 59 | TileGridConfig( DEFAULT_TILE_X, DEFAULT_TILE_Y), |
borenet@google.com | 1558d68 | 2012-12-12 20:13:26 +0000 | [diff] [blame] | 60 | ] |
| 61 | |
| 62 | |
borenet@google.com | 9afba74 | 2012-12-18 21:44:53 +0000 | [diff] [blame] | 63 | def 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.com | 8b95474 | 2012-12-19 14:47:53 +0000 | [diff] [blame] | 72 | RecordConfig( scale=str(scale)), |
| 73 | RecordRTreeConfig(scale=str(scale)), |
borenet@google.com | 9afba74 | 2012-12-18 21:44:53 +0000 | [diff] [blame] | 74 | 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.com | 9afba74 | 2012-12-18 21:44:53 +0000 | [diff] [blame] | 84 | ] |
| 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.com | 1558d68 | 2012-12-12 20:13:26 +0000 | [diff] [blame] | 96 | |
| 97 | |
borenet@google.com | 1ce5cef | 2013-05-07 12:09:54 +0000 | [diff] [blame] | 98 | msaa4 = Config(config='msaa4') |
| 99 | |
| 100 | |
borenet@google.com | 1558d68 | 2012-12-12 20:13:26 +0000 | [diff] [blame] | 101 | # 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. |
| 104 | bench_pictures_cfg = { |
scroggo@google.com | 161e1ba | 2013-03-04 16:41:06 +0000 | [diff] [blame] | 105 | 'angle': [TiledConfig(DEFAULT_TILE_X, DEFAULT_TILE_Y, config='angle')], |
borenet@google.com | 8234e54 | 2012-12-14 13:04:24 +0000 | [diff] [blame] | 106 | 'debug': [TiledBitmapConfig(DEFAULT_TILE_X, DEFAULT_TILE_Y)], |
borenet@google.com | 1558d68 | 2012-12-12 20:13:26 +0000 | [diff] [blame] | 107 | 'default': default_configs, |
scroggo@google.com | 161e1ba | 2013-03-04 16:41:06 +0000 | [diff] [blame] | 108 | 'no_gpu': [cfg for cfg in default_configs if cfg['config'] != 'gpu'], |
borenet@google.com | 8b95474 | 2012-12-19 14:47:53 +0000 | [diff] [blame] | 109 | 'nexus_s': AndroidConfigList((256, 256), 0.4897, [], (480, 800), |
borenet@google.com | 9afba74 | 2012-12-18 21:44:53 +0000 | [diff] [blame] | 110 | do_gpu=False), |
borenet@google.com | 8b95474 | 2012-12-19 14:47:53 +0000 | [diff] [blame] | 111 | 'xoom': AndroidConfigList((256, 256), 1.2244, [], (1200, 800)), |
borenet@google.com | 1ce5cef | 2013-05-07 12:09:54 +0000 | [diff] [blame] | 112 | 'galaxy_nexus': AndroidConfigList((256, 256), 0.8163, [], (800, 1280)) + \ |
| 113 | [msaa4], |
borenet@google.com | 8b95474 | 2012-12-19 14:47:53 +0000 | [diff] [blame] | 114 | 'nexus_4': AndroidConfigList((256, 256), 0.7836, [], (768, 1280)), |
robertphillips@google.com | a99aba7 | 2013-08-28 12:31:49 +0000 | [diff] [blame] | 115 | 'nexus_7': AndroidConfigList((256, 256), 1.3061, [4], (1280, 800)), |
borenet@google.com | fc52e31 | 2013-07-15 13:50:35 +0000 | [diff] [blame] | 116 | 'nexus_10': AndroidConfigList((512, 512), 2.6122, [], (2560, 1600), |
| 117 | do_gpu=False) + [msaa4], |
borenet@google.com | 1ce5cef | 2013-05-07 12:09:54 +0000 | [diff] [blame] | 118 | 'razr_i': AndroidConfigList((256, 256), 0.5510, [], (540, 960)) + \ |
| 119 | [msaa4], |
borenet@google.com | 065224d | 2013-08-13 20:32:22 +0000 | [diff] [blame] | 120 | 'intel_rhb': AndroidConfigList((256, 256), 0.5510, [], (540, 960)) + \ |
| 121 | [msaa4], |
scroggo@google.com | 161e1ba | 2013-03-04 16:41:06 +0000 | [diff] [blame] | 122 | } |