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