summaryrefslogtreecommitdiffstats
path: root/content/common/gpu/gpu_rendering_stats.cc
blob: 88e54f08f6ea071fcbf94df49105d28409fbcd6f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// 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.

#include "content/common/gpu/gpu_rendering_stats.h"

namespace content {

GpuRenderingStats::GpuRenderingStats()
    : global_texture_upload_count(0),
      texture_upload_count(0),
      global_video_memory_bytes_allocated(0) {
}

GpuRenderingStats::~GpuRenderingStats() {
}

void GpuRenderingStats::EnumerateFields(
    cc::RenderingStats::Enumerator* enumerator) const {
  enumerator->AddInt("globalTextureUploadCount", global_texture_upload_count);
  enumerator->AddTimeDeltaInSecondsF("globalTotalTextureUploadTimeInSeconds",
                                     global_total_texture_upload_time);
  enumerator->AddInt("textureUploadCount", texture_upload_count);
  enumerator->AddTimeDeltaInSecondsF("totalTextureUploadTimeInSeconds",
                           total_texture_upload_time);
  enumerator->AddTimeDeltaInSecondsF(
      "globalTotalProcessingCommandsTimeInSeconds",
      global_total_processing_commands_time);
  enumerator->AddTimeDeltaInSecondsF("totalProcessingCommandsTimeInSeconds",
                                     total_processing_commands_time);
  enumerator->AddInt64("globalVideoMemoryBytesAllocated",
                       global_video_memory_bytes_allocated);
}

}  // namespace content