trace_util.cc 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // Copyright (c) 2015 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. #include "ui/gl/trace_util.h"
  5. #include "base/format_macros.h"
  6. #include "base/strings/stringprintf.h"
  7. namespace gl {
  8. base::trace_event::MemoryAllocatorDumpGuid GetGLTextureClientGUIDForTracing(
  9. uint64_t context_group_tracing_id,
  10. uint32_t texture_id) {
  11. return base::trace_event::MemoryAllocatorDumpGuid(
  12. base::StringPrintf("gl-texture-client-x-process/%" PRIx64 "/%d",
  13. context_group_tracing_id, texture_id));
  14. }
  15. base::trace_event::MemoryAllocatorDumpGuid GetGLTextureServiceGUIDForTracing(
  16. uint64_t texture_tracing_id) {
  17. return base::trace_event::MemoryAllocatorDumpGuid(base::StringPrintf(
  18. "gl-texture-service-x-process/%" PRIx64, texture_tracing_id));
  19. }
  20. base::trace_event::MemoryAllocatorDumpGuid GetGLBufferGUIDForTracing(
  21. uint64_t context_group_tracing_id,
  22. uint32_t buffer_id) {
  23. return base::trace_event::MemoryAllocatorDumpGuid(
  24. base::StringPrintf("gl-buffer-x-process/%" PRIx64 "/%d",
  25. context_group_tracing_id, buffer_id));
  26. }
  27. base::trace_event::MemoryAllocatorDumpGuid GetGLRenderbufferGUIDForTracing(
  28. uint64_t context_group_tracing_id,
  29. uint32_t renderbuffer_id) {
  30. return base::trace_event::MemoryAllocatorDumpGuid(
  31. base::StringPrintf("gl-renderbuffer-x-process/%" PRIx64 "/%d",
  32. context_group_tracing_id, renderbuffer_id));
  33. }
  34. base::trace_event::MemoryAllocatorDumpGuid GetGLTextureRasterGUIDForTracing(
  35. uint32_t texture_id) {
  36. return base::trace_event::MemoryAllocatorDumpGuid(
  37. base::StringPrintf("gl-texture-raster-gpu-process/%d", texture_id));
  38. }
  39. } // namespace gl