blob: c4071811b5cc1b8719b25668745ccadb2ac20142 [file] [log] [blame]
borenet@google.com1558d682012-12-12 20:13:26 +00001# 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""" Helper functions to be used in bench_pictures.cfg. """
7
8
9def Config(**kwargs):
10 config = {}
11 for key in kwargs:
12 config[key] = kwargs[key]
13 return config
14
15
16def BitmapConfig(**kwargs):
17 return Config(device='bitmap', **kwargs)
18
19
20def GPUConfig(**kwargs):
21 return Config(device='gpu', **kwargs)
22
23
24def TiledBitmapConfig(tile_x, tile_y, **kwargs):
25 return BitmapConfig(mode=['tile', str(tile_x), str(tile_y)], **kwargs)
26
27
28def TiledGPUConfig(tile_x, tile_y, **kwargs):
29 return GPUConfig(mode=['tile', str(tile_x), str(tile_y)], **kwargs)
30
31
32def CopyTilesConfig(tile_x, tile_y, **kwargs):
33 return BitmapConfig(mode=['copyTile', str(tile_x), str(tile_y)], **kwargs)
34
35
36def RecordConfig(**kwargs):
37 return BitmapConfig(mode='record', **kwargs)
38
39
40def PlaybackCreationConfig(**kwargs):
41 return BitmapConfig(mode='playbackCreation', **kwargs)
42
43
44def MultiThreadTileConfig(threads, tile_x, tile_y, **kwargs):
45 return TiledBitmapConfig(multi=threads, tile_x=tile_x, tile_y=tile_y,
46 **kwargs)