1# Copyright 2013 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
5class GpuRenderingStats(object):
6  def __init__(self, rendering_stats_deltas):
7    rs = rendering_stats_deltas
8
9    # Scroll Stats
10    self.total_time = rs.get('totalTimeInSeconds', 0)
11    self.screen_frame_count = rs.get('numFramesSentToScreen', 0)
12    self.dropped_frame_count = rs.get('droppedFrameCount', 0)
13    self.impl_thread_scroll_count = rs.get('numImplThreadScrolls', 0)
14    self.main_thread_scroll_count = rs.get('numMainThreadScrolls', 0)
15    self.drawn_layers_count = rs.get('numLayersDrawn', 0)
16    self.missing_tile_count = rs.get('numMissingTiles', 0)
17
18    # Texture Upload Stats
19    self.texture_upload_count = rs.get('textureUploadCount', 0)
20    self.texture_upload_time = rs.get('totalTextureUploadTimeInSeconds', 0)
21    self.commit_count = rs.get('totalCommitCount', 0)
22    self.commit_time = rs.get('totalCommitTimeInSeconds', 0)
23
24    # Image Decoding Stats
25    self.deferred_image_decode_count = rs.get(
26        'totalDeferredImageDecodeCount', 0)
27    self.deferred_image_decode_time = rs.get(
28        'totalDeferredImageDecodeTimeInSeconds', 0)
29    self.deferred_image_cache_hits = rs.get(
30        'totalDeferredImageCacheHitCount', 0)
31    self.image_gathering_count = rs.get('totalImageGatheringCount', 0)
32    self.image_gathering_time = rs.get('totalImageGatheringTimeInSeconds', 0)
33
34    # Tile Analysis Stats
35    self.tile_analysis_count = rs.get('totalTilesAnalyzed', 0)
36    self.tile_analysis_time = rs.get('totalTileAnalysisTimeInSeconds', 0)
37    self.solid_color_tile_analysis_count = rs.get('solidColorTilesAnalyzed', 0)
38
39    # Latency Stats
40    self.input_event_count = rs.get('inputEventCount', 0)
41    self.input_event_latency = rs.get('totalInputLatency', 0)
42    self.touch_ui_count = rs.get('touchUICount', 0)
43    self.touch_ui_latency = rs.get('totalTouchUILatency', 0)
44    self.touch_acked_count = rs.get('touchAckedCount', 0)
45    self.touch_acked_latency = rs.get('totalTouchAckedLatency', 0)
46    self.scroll_update_count = rs.get('scrollUpdateCount', 0)
47    self.scroll_update_latency = rs.get('totalScrollUpdateLatency', 0)
48