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 |
borenet@google.com | 40fbcae | 2013-12-20 14:48:38 +0000 | [diff] [blame] | 35 | DEFAULT_VIEWPORT_X = 1000 |
borenet@google.com | aa84ac3 | 2013-09-09 15:13:25 +0000 | [diff] [blame] | 36 | DEFAULT_VIEWPORT_Y = 1000 |
| 37 | |
borenet@google.com | 40fbcae | 2013-12-20 14:48:38 +0000 | [diff] [blame] | 38 | # Default scale factor for scaled configs. |
| 39 | DEFAULT_SCALE = 1.1 |
borenet@google.com | 1558d68 | 2012-12-12 20:13:26 +0000 | [diff] [blame] | 40 | |
| 41 | # Configs to run on most bots |
| 42 | default_configs = [ |
borenet@google.com | aa84ac3 | 2013-09-09 15:13:25 +0000 | [diff] [blame] | 43 | # Viewport CPU and GPU |
borenet@google.com | a5ed2ae | 2013-09-09 15:24:40 +0000 | [diff] [blame] | 44 | ViewportBitmapConfig(DEFAULT_VIEWPORT_X, DEFAULT_VIEWPORT_Y), |
| 45 | ViewportGPUConfig(DEFAULT_VIEWPORT_X, DEFAULT_VIEWPORT_Y), |
borenet@google.com | 1558d68 | 2012-12-12 20:13:26 +0000 | [diff] [blame] | 46 | |
borenet@google.com | 40fbcae | 2013-12-20 14:48:38 +0000 | [diff] [blame] | 47 | # Scaled viewport, CPU and GPU |
| 48 | ViewportBitmapConfig(DEFAULT_VIEWPORT_X, DEFAULT_VIEWPORT_Y, |
| 49 | scale=str(DEFAULT_SCALE)), |
| 50 | ViewportGPUConfig(DEFAULT_VIEWPORT_X, DEFAULT_VIEWPORT_Y, |
| 51 | scale=str(DEFAULT_SCALE)), |
borenet@google.com | 1558d68 | 2012-12-12 20:13:26 +0000 | [diff] [blame] | 52 | ] |
| 53 | |
borenet@google.com | 40fbcae | 2013-12-20 14:48:38 +0000 | [diff] [blame] | 54 | default_no_gpu = [cfg for cfg in default_configs if cfg['config'] != 'gpu'] |
borenet@google.com | 1558d68 | 2012-12-12 20:13:26 +0000 | [diff] [blame] | 55 | |
| 56 | |
borenet@google.com | 40fbcae | 2013-12-20 14:48:38 +0000 | [diff] [blame] | 57 | msaa4 = Config(config='msaa4', viewport=[str(DEFAULT_VIEWPORT_X), |
| 58 | str(DEFAULT_VIEWPORT_Y)]) |
borenet@google.com | 1ce5cef | 2013-05-07 12:09:54 +0000 | [diff] [blame] | 59 | |
commit-bot@chromium.org | a6d46cb | 2014-01-14 18:47:07 +0000 | [diff] [blame] | 60 | msaa16 = Config(config='msaa16', viewport=[str(DEFAULT_VIEWPORT_X), |
| 61 | str(DEFAULT_VIEWPORT_Y)]) |
| 62 | |
commit-bot@chromium.org | d82aae7 | 2014-05-21 21:51:48 +0000 | [diff] [blame] | 63 | viewport_angle = Config(config='angle', viewport=[str(DEFAULT_VIEWPORT_X), |
| 64 | str(DEFAULT_VIEWPORT_Y)]) |
borenet@google.com | 1ce5cef | 2013-05-07 12:09:54 +0000 | [diff] [blame] | 65 | |
borenet@google.com | 1558d68 | 2012-12-12 20:13:26 +0000 | [diff] [blame] | 66 | # This dictionary defines the sets of configs for all platforms. Each config is |
| 67 | # a dictionary of key/value pairs directly corresponding to the command-line |
| 68 | # flags passed to bench_pictures. |
| 69 | bench_pictures_cfg = { |
commit-bot@chromium.org | 05fadd1 | 2014-05-21 20:18:49 +0000 | [diff] [blame] | 70 | 'angle': [viewport_angle], |
borenet@google.com | 40fbcae | 2013-12-20 14:48:38 +0000 | [diff] [blame] | 71 | 'debug': [ViewportBitmapConfig(DEFAULT_VIEWPORT_X, DEFAULT_VIEWPORT_Y)], |
borenet@google.com | 1558d68 | 2012-12-12 20:13:26 +0000 | [diff] [blame] | 72 | 'default': default_configs, |
borenet@google.com | 40fbcae | 2013-12-20 14:48:38 +0000 | [diff] [blame] | 73 | 'no_gpu': default_no_gpu, |
| 74 | 'nexus_s': default_no_gpu, |
| 75 | 'xoom': default_configs, |
| 76 | 'galaxy_nexus': default_configs, |
| 77 | 'nexus_4': default_configs + [msaa4], |
| 78 | 'nexus_7': default_configs, |
| 79 | 'nexus_10': default_configs + [msaa4], |
| 80 | 'razr_i': default_configs + [msaa4], |
commit-bot@chromium.org | 1b3beef | 2014-05-02 19:59:59 +0000 | [diff] [blame] | 81 | 'intel_rhb': default_no_gpu, |
commit-bot@chromium.org | a6d46cb | 2014-01-14 18:47:07 +0000 | [diff] [blame] | 82 | 'default_msaa16': default_configs + [msaa16], |
scroggo@google.com | 161e1ba | 2013-03-04 16:41:06 +0000 | [diff] [blame] | 83 | } |