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 | |
borenet@google.com | aa84ac3 | 2013-09-09 15:13:25 +0000 | [diff] [blame] | 34 | # Default viewport size |
| 35 | DEFAULT_VIEWPORT_X = 1500 |
| 36 | DEFAULT_VIEWPORT_Y = 1000 |
| 37 | |
borenet@google.com | 1558d68 | 2012-12-12 20:13:26 +0000 | [diff] [blame] | 38 | |
| 39 | # Configs to run on most bots |
| 40 | default_configs = [ |
| 41 | # Basic CPU and GPU configs |
| 42 | TiledBitmapConfig(DEFAULT_TILE_X, DEFAULT_TILE_Y), |
borenet@google.com | aa84ac3 | 2013-09-09 15:13:25 +0000 | [diff] [blame] | 43 | |
| 44 | # Viewport CPU and GPU |
borenet@google.com | a5ed2ae | 2013-09-09 15:24:40 +0000 | [diff] [blame] | 45 | ViewportBitmapConfig(DEFAULT_VIEWPORT_X, DEFAULT_VIEWPORT_Y), |
| 46 | ViewportGPUConfig(DEFAULT_VIEWPORT_X, DEFAULT_VIEWPORT_Y), |
borenet@google.com | 1558d68 | 2012-12-12 20:13:26 +0000 | [diff] [blame] | 47 | |
| 48 | # CopyTiles |
| 49 | CopyTilesConfig(DEFAULT_TILE_X, DEFAULT_TILE_Y), |
| 50 | |
| 51 | # Record |
| 52 | RecordConfig(), |
| 53 | |
| 54 | # Multi-threaded |
borenet@google.com | 1558d68 | 2012-12-12 20:13:26 +0000 | [diff] [blame] | 55 | MultiThreadTileConfig(4, DEFAULT_TILE_X, DEFAULT_TILE_Y), |
| 56 | |
| 57 | # Different tile sizes |
| 58 | TiledBitmapConfig(512, 512), |
borenet@google.com | 1558d68 | 2012-12-12 20:13:26 +0000 | [diff] [blame] | 59 | |
| 60 | # Different bounding box heirarchies, for different modes. |
borenet@google.com | 8b95474 | 2012-12-19 14:47:53 +0000 | [diff] [blame] | 61 | RecordRTreeConfig(), |
| 62 | PlaybackCreationRTreeConfig(), |
borenet@google.com | 3b98bfd | 2012-12-17 17:21:04 +0000 | [diff] [blame] | 63 | TileRTreeConfig( DEFAULT_TILE_X, DEFAULT_TILE_Y), |
borenet@google.com | 8b95474 | 2012-12-19 14:47:53 +0000 | [diff] [blame] | 64 | RecordGridConfig( DEFAULT_TILE_X, DEFAULT_TILE_Y), |
| 65 | PlaybackCreationGridConfig( DEFAULT_TILE_X, DEFAULT_TILE_Y), |
borenet@google.com | 3b98bfd | 2012-12-17 17:21:04 +0000 | [diff] [blame] | 66 | TileGridConfig( DEFAULT_TILE_X, DEFAULT_TILE_Y), |
borenet@google.com | 1558d68 | 2012-12-12 20:13:26 +0000 | [diff] [blame] | 67 | ] |
| 68 | |
| 69 | |
borenet@google.com | 9afba74 | 2012-12-18 21:44:53 +0000 | [diff] [blame] | 70 | def AndroidConfigList(tile_size, scale, cores, viewport, do_gpu=True): |
| 71 | tile_x = tile_size[0] |
| 72 | tile_y = tile_size[1] |
| 73 | |
| 74 | viewport_x = viewport[0] |
| 75 | viewport_y = viewport[1] |
| 76 | |
| 77 | configs = [ |
| 78 | # Record |
borenet@google.com | 8b95474 | 2012-12-19 14:47:53 +0000 | [diff] [blame] | 79 | RecordConfig( scale=str(scale)), |
| 80 | RecordRTreeConfig(scale=str(scale)), |
borenet@google.com | 9afba74 | 2012-12-18 21:44:53 +0000 | [diff] [blame] | 81 | RecordGridConfig( tile_x, tile_y, scale=str(scale)), |
| 82 | |
| 83 | # Tiled playback |
| 84 | TiledBitmapConfig(tile_x, tile_y, scale=str(scale)), |
| 85 | TileRTreeConfig( tile_x, tile_y, scale=str(scale)), |
| 86 | TileGridConfig( tile_x, tile_y, scale=str(scale)), |
| 87 | |
| 88 | # Viewport playback |
| 89 | ViewportBitmapConfig(viewport_x, viewport_y, scale=str(scale)), |
| 90 | ViewportRTreeConfig( viewport_x, viewport_y, scale=str(scale)), |
borenet@google.com | 9afba74 | 2012-12-18 21:44:53 +0000 | [diff] [blame] | 91 | ] |
| 92 | |
| 93 | if do_gpu: |
borenet@google.com | 9afba74 | 2012-12-18 21:44:53 +0000 | [diff] [blame] | 94 | configs.append(ViewportGPUConfig(viewport_x, viewport_y, scale=str(scale))) |
| 95 | |
| 96 | # Multicore |
| 97 | for num_cores in cores: |
| 98 | configs.append(MultiThreadTileConfig(num_cores, tile_x, tile_y, |
| 99 | scale=str(scale))) |
| 100 | |
| 101 | return configs |
borenet@google.com | 1558d68 | 2012-12-12 20:13:26 +0000 | [diff] [blame] | 102 | |
| 103 | |
borenet@google.com | 1ce5cef | 2013-05-07 12:09:54 +0000 | [diff] [blame] | 104 | msaa4 = Config(config='msaa4') |
| 105 | |
| 106 | |
borenet@google.com | 1558d68 | 2012-12-12 20:13:26 +0000 | [diff] [blame] | 107 | # This dictionary defines the sets of configs for all platforms. Each config is |
| 108 | # a dictionary of key/value pairs directly corresponding to the command-line |
| 109 | # flags passed to bench_pictures. |
| 110 | bench_pictures_cfg = { |
scroggo@google.com | 161e1ba | 2013-03-04 16:41:06 +0000 | [diff] [blame] | 111 | 'angle': [TiledConfig(DEFAULT_TILE_X, DEFAULT_TILE_Y, config='angle')], |
borenet@google.com | 8234e54 | 2012-12-14 13:04:24 +0000 | [diff] [blame] | 112 | 'debug': [TiledBitmapConfig(DEFAULT_TILE_X, DEFAULT_TILE_Y)], |
borenet@google.com | 1558d68 | 2012-12-12 20:13:26 +0000 | [diff] [blame] | 113 | 'default': default_configs, |
scroggo@google.com | 161e1ba | 2013-03-04 16:41:06 +0000 | [diff] [blame] | 114 | '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] | 115 | 'nexus_s': AndroidConfigList((256, 256), 0.4897, [], (480, 800), |
borenet@google.com | 9afba74 | 2012-12-18 21:44:53 +0000 | [diff] [blame] | 116 | do_gpu=False), |
borenet@google.com | 8b95474 | 2012-12-19 14:47:53 +0000 | [diff] [blame] | 117 | 'xoom': AndroidConfigList((256, 256), 1.2244, [], (1200, 800)), |
borenet@google.com | 9f6c23e | 2013-08-30 13:19:18 +0000 | [diff] [blame] | 118 | 'galaxy_nexus': AndroidConfigList((256, 256), 0.8163, [], (800, 1280)), |
borenet@google.com | 1cf02a8 | 2013-09-16 20:39:23 +0000 | [diff] [blame] | 119 | 'nexus_4': AndroidConfigList((256, 256), 0.7836, [], (768, 1280)) + \ |
| 120 | [msaa4], |
robertphillips@google.com | a99aba7 | 2013-08-28 12:31:49 +0000 | [diff] [blame] | 121 | 'nexus_7': AndroidConfigList((256, 256), 1.3061, [4], (1280, 800)), |
borenet@google.com | fc52e31 | 2013-07-15 13:50:35 +0000 | [diff] [blame] | 122 | 'nexus_10': AndroidConfigList((512, 512), 2.6122, [], (2560, 1600), |
| 123 | do_gpu=False) + [msaa4], |
borenet@google.com | 1ce5cef | 2013-05-07 12:09:54 +0000 | [diff] [blame] | 124 | 'razr_i': AndroidConfigList((256, 256), 0.5510, [], (540, 960)) + \ |
| 125 | [msaa4], |
borenet@google.com | 065224d | 2013-08-13 20:32:22 +0000 | [diff] [blame] | 126 | 'intel_rhb': AndroidConfigList((256, 256), 0.5510, [], (540, 960)) + \ |
| 127 | [msaa4], |
scroggo@google.com | 161e1ba | 2013-03-04 16:41:06 +0000 | [diff] [blame] | 128 | } |