2012-12-12 20:13:26 +00:00
|
|
|
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
|
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
|
|
# found in the LICENSE file.
|
|
|
|
|
|
|
|
|
|
|
|
"""
|
|
|
|
This file defines the configurations in which bench_pictures should be run
|
|
|
|
on various platforms. The buildbots read these configurations from the
|
|
|
|
bench_pictures_cfg dictionary. Everything else in this file exists to help in
|
|
|
|
constructing that dictionary.
|
|
|
|
|
|
|
|
This code is executed directly on the buildbot so that convenient things like
|
|
|
|
variables and loops can be used to avoid unnecessary verbosity. With great power
|
|
|
|
comes great responsibility; don't put any nasty code here. To reiterate, code in
|
|
|
|
this file will be directly executed on the build slaves.
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
|
|
|
|
|
|
|
|
if 'import_path' in globals():
|
|
|
|
sys.path.append(import_path)
|
|
|
|
|
|
|
|
|
|
|
|
from bench_pictures_cfg_helper import *
|
|
|
|
|
|
|
|
|
|
|
|
# Default tile sizes
|
|
|
|
DEFAULT_TILE_X = '256'
|
|
|
|
DEFAULT_TILE_Y = '256'
|
|
|
|
|
|
|
|
|
|
|
|
# Configs to run on most bots
|
|
|
|
default_configs = [
|
|
|
|
# Basic CPU and GPU configs
|
|
|
|
TiledBitmapConfig(DEFAULT_TILE_X, DEFAULT_TILE_Y),
|
|
|
|
TiledGPUConfig(DEFAULT_TILE_X, DEFAULT_TILE_Y),
|
|
|
|
|
|
|
|
# CopyTiles
|
|
|
|
CopyTilesConfig(DEFAULT_TILE_X, DEFAULT_TILE_Y),
|
|
|
|
|
|
|
|
# Record
|
|
|
|
RecordConfig(),
|
|
|
|
|
|
|
|
# Multi-threaded
|
|
|
|
MultiThreadTileConfig(2, DEFAULT_TILE_X, DEFAULT_TILE_Y),
|
|
|
|
MultiThreadTileConfig(3, DEFAULT_TILE_X, DEFAULT_TILE_Y),
|
|
|
|
MultiThreadTileConfig(4, DEFAULT_TILE_X, DEFAULT_TILE_Y),
|
|
|
|
|
|
|
|
# Different tile sizes
|
|
|
|
TiledBitmapConfig(512, 512),
|
|
|
|
TiledBitmapConfig(1024, 256),
|
|
|
|
TiledBitmapConfig(1024, 64),
|
|
|
|
|
|
|
|
# Different bounding box heirarchies, for different modes.
|
2012-12-19 14:47:53 +00:00
|
|
|
RecordRTreeConfig(),
|
|
|
|
PlaybackCreationRTreeConfig(),
|
|
|
|
TileRTreeConfig( DEFAULT_TILE_X, DEFAULT_TILE_Y),
|
2012-12-17 17:21:04 +00:00
|
|
|
RecordGridConfig( DEFAULT_TILE_X, DEFAULT_TILE_Y),
|
|
|
|
PlaybackCreationGridConfig( DEFAULT_TILE_X, DEFAULT_TILE_Y),
|
|
|
|
TileGridConfig( DEFAULT_TILE_X, DEFAULT_TILE_Y),
|
2012-12-12 20:13:26 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
|
2012-12-18 21:44:53 +00:00
|
|
|
def AndroidConfigList(tile_size, scale, cores, viewport, do_gpu=True):
|
|
|
|
tile_x = tile_size[0]
|
|
|
|
tile_y = tile_size[1]
|
|
|
|
|
|
|
|
viewport_x = viewport[0]
|
|
|
|
viewport_y = viewport[1]
|
|
|
|
|
|
|
|
configs = [
|
|
|
|
# Record
|
2012-12-19 14:47:53 +00:00
|
|
|
RecordConfig( scale=str(scale)),
|
|
|
|
RecordRTreeConfig(scale=str(scale)),
|
2012-12-18 21:44:53 +00:00
|
|
|
RecordGridConfig( tile_x, tile_y, scale=str(scale)),
|
|
|
|
|
|
|
|
# Tiled playback
|
|
|
|
TiledBitmapConfig(tile_x, tile_y, scale=str(scale)),
|
|
|
|
TileRTreeConfig( tile_x, tile_y, scale=str(scale)),
|
|
|
|
TileGridConfig( tile_x, tile_y, scale=str(scale)),
|
|
|
|
|
|
|
|
# Viewport playback
|
|
|
|
ViewportBitmapConfig(viewport_x, viewport_y, scale=str(scale)),
|
|
|
|
ViewportRTreeConfig( viewport_x, viewport_y, scale=str(scale)),
|
|
|
|
]
|
|
|
|
|
|
|
|
if do_gpu:
|
|
|
|
configs.append(TiledGPUConfig(tile_x, tile_y, scale=str(scale)))
|
|
|
|
configs.append(ViewportGPUConfig(viewport_x, viewport_y, scale=str(scale)))
|
|
|
|
|
|
|
|
# Multicore
|
|
|
|
for num_cores in cores:
|
|
|
|
configs.append(MultiThreadTileConfig(num_cores, tile_x, tile_y,
|
|
|
|
scale=str(scale)))
|
|
|
|
|
|
|
|
return configs
|
2012-12-12 20:13:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
# This dictionary defines the sets of configs for all platforms. Each config is
|
|
|
|
# a dictionary of key/value pairs directly corresponding to the command-line
|
|
|
|
# flags passed to bench_pictures.
|
|
|
|
bench_pictures_cfg = {
|
2013-02-20 20:01:23 +00:00
|
|
|
'angle': [TiledConfig(DEFAULT_TILE_X, DEFAULT_TILE_Y, device='angle')],
|
2012-12-14 13:04:24 +00:00
|
|
|
'debug': [TiledBitmapConfig(DEFAULT_TILE_X, DEFAULT_TILE_Y)],
|
2012-12-12 20:13:26 +00:00
|
|
|
'default': default_configs,
|
|
|
|
'no_gpu': [cfg for cfg in default_configs if cfg['device'] != 'gpu'],
|
2012-12-19 14:47:53 +00:00
|
|
|
'nexus_s': AndroidConfigList((256, 256), 0.4897, [], (480, 800),
|
2012-12-18 21:44:53 +00:00
|
|
|
do_gpu=False),
|
2012-12-19 14:47:53 +00:00
|
|
|
'xoom': AndroidConfigList((256, 256), 1.2244, [], (1200, 800)),
|
|
|
|
'galaxy_nexus': AndroidConfigList((256, 256), 0.8163, [], (800, 1280)),
|
|
|
|
'nexus_4': AndroidConfigList((256, 256), 0.7836, [], (768, 1280)),
|
|
|
|
'nexus_7': AndroidConfigList((256, 256), 1.3061, [2], (1280, 800)),
|
|
|
|
'nexus_10': AndroidConfigList((512, 512), 2.6122, [], (2560, 1600)),
|
2012-12-12 20:13:26 +00:00
|
|
|
}
|