summaryrefslogtreecommitdiffstats
path: root/ui/gl/trace_util.cc
blob: 825de2802bfa8d9311cc0105daf539ec7be1371e (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
36
37
38
39
40
41
42
43
// Copyright (c) 2015 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 "ui/gl/trace_util.h"

#include "base/format_macros.h"
#include "base/strings/stringprintf.h"

namespace gfx {

base::trace_event::MemoryAllocatorDumpGuid GetGLTextureClientGUIDForTracing(
    uint64_t share_group_guid,
    uint32_t texture_id) {
  return base::trace_event::MemoryAllocatorDumpGuid(
      base::StringPrintf("gl-texture-client-x-process/%" PRIx64 "/%d",
                         share_group_guid, texture_id));
}

base::trace_event::MemoryAllocatorDumpGuid GetGLTextureServiceGUIDForTracing(
    uint64_t share_group_guid,
    uint32_t texture_id) {
  return base::trace_event::MemoryAllocatorDumpGuid(
      base::StringPrintf("gl-texture-service-x-process/%" PRIx64 "/%d",
                         share_group_guid, texture_id));
}

base::trace_event::MemoryAllocatorDumpGuid GetGLBufferGUIDForTracing(
    uint64_t share_group_guid,
    uint32_t buffer_id) {
  return base::trace_event::MemoryAllocatorDumpGuid(base::StringPrintf(
      "gl-buffer-x-process/%" PRIx64 "/%d", share_group_guid, buffer_id));
}

base::trace_event::MemoryAllocatorDumpGuid GetGLRenderbufferGUIDForTracing(
    uint64_t share_group_guid,
    uint32_t renderbuffer_id) {
  return base::trace_event::MemoryAllocatorDumpGuid(
      base::StringPrintf("gl-renderbuffer-x-process/%" PRIx64 "/%d",
                         share_group_guid, renderbuffer_id));
}

}  // namespace ui