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 |
| 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.com | 8b95474 | 2012-12-19 14:47:53 +0000 | [diff] [blame] | 58 | RecordRTreeConfig(), |
| 59 | PlaybackCreationRTreeConfig(), |
borenet@google.com | 3b98bfd | 2012-12-17 17:21:04 +0000 | [diff] [blame] | 60 | TileRTreeConfig( DEFAULT_TILE_X, DEFAULT_TILE_Y), |
borenet@google.com | 8b95474 | 2012-12-19 14:47:53 +0000 | [diff] [blame] | 61 | RecordGridConfig( DEFAULT_TILE_X, DEFAULT_TILE_Y), |
| 62 | PlaybackCreationGridConfig( DEFAULT_TILE_X, DEFAULT_TILE_Y), |
borenet@google.com | 3b98bfd | 2012-12-17 17:21:04 +0000 | [diff] [blame] | 63 | TileGridConfig( DEFAULT_TILE_X, DEFAULT_TILE_Y), |
borenet@google.com | 1558d68 | 2012-12-12 20:13:26 +0000 | [diff] [blame] | 64 | ] |
| 65 | |
| 66 | |
borenet@google.com | 9afba74 | 2012-12-18 21:44:53 +0000 | [diff] [blame] | 67 | def 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.com | 8b95474 | 2012-12-19 14:47:53 +0000 | [diff] [blame] | 76 | RecordConfig( scale=str(scale)), |
| 77 | RecordRTreeConfig(scale=str(scale)), |
borenet@google.com | 9afba74 | 2012-12-18 21:44:53 +0000 | [diff] [blame] | 78 | 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.com | 9afba74 | 2012-12-18 21:44:53 +0000 | [diff] [blame] | 88 | ] |
| 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.com | 1558d68 | 2012-12-12 20:13:26 +0000 | [diff] [blame] | 100 | |
| 101 | |
borenet@google.com | 1ce5cef | 2013-05-07 12:09:54 +0000 | [diff] [blame] | 102 | msaa4 = Config(config='msaa4') |
| 103 | |
| 104 | |
borenet@google.com | 1558d68 | 2012-12-12 20:13:26 +0000 | [diff] [blame] | 105 | # 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. |
| 108 | bench_pictures_cfg = { |
scroggo@google.com | 161e1ba | 2013-03-04 16:41:06 +0000 | [diff] [blame] | 109 | 'angle': [TiledConfig(DEFAULT_TILE_X, DEFAULT_TILE_Y, config='angle')], |
borenet@google.com | 8234e54 | 2012-12-14 13:04:24 +0000 | [diff] [blame] | 110 | 'debug': [TiledBitmapConfig(DEFAULT_TILE_X, DEFAULT_TILE_Y)], |
borenet@google.com | 1558d68 | 2012-12-12 20:13:26 +0000 | [diff] [blame] | 111 | 'default': default_configs, |
scroggo@google.com | 161e1ba | 2013-03-04 16:41:06 +0000 | [diff] [blame] | 112 | '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] | 113 | 'nexus_s': AndroidConfigList((256, 256), 0.4897, [], (480, 800), |
borenet@google.com | 9afba74 | 2012-12-18 21:44:53 +0000 | [diff] [blame] | 114 | do_gpu=False), |
borenet@google.com | 8b95474 | 2012-12-19 14:47:53 +0000 | [diff] [blame] | 115 | 'xoom': AndroidConfigList((256, 256), 1.2244, [], (1200, 800)), |
borenet@google.com | 1ce5cef | 2013-05-07 12:09:54 +0000 | [diff] [blame] | 116 | 'galaxy_nexus': AndroidConfigList((256, 256), 0.8163, [], (800, 1280)) + \ |
| 117 | [msaa4], |
borenet@google.com | 8b95474 | 2012-12-19 14:47:53 +0000 | [diff] [blame] | 118 | 'nexus_4': AndroidConfigList((256, 256), 0.7836, [], (768, 1280)), |
| 119 | 'nexus_7': AndroidConfigList((256, 256), 1.3061, [2], (1280, 800)), |
borenet@google.com | fc52e31 | 2013-07-15 13:50:35 +0000 | [diff] [blame^] | 120 | 'nexus_10': AndroidConfigList((512, 512), 2.6122, [], (2560, 1600), |
| 121 | do_gpu=False) + [msaa4], |
borenet@google.com | 1ce5cef | 2013-05-07 12:09:54 +0000 | [diff] [blame] | 122 | 'razr_i': AndroidConfigList((256, 256), 0.5510, [], (540, 960)) + \ |
| 123 | [msaa4], |
scroggo@google.com | 161e1ba | 2013-03-04 16:41:06 +0000 | [diff] [blame] | 124 | } |