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

gpu / command_buffer / service / test_memory_tracker.h [blame]

// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef GPU_COMMAND_BUFFER_SERVICE_TEST_MEMORY_TRACKER_H_
#define GPU_COMMAND_BUFFER_SERVICE_TEST_MEMORY_TRACKER_H_

#include "gpu/command_buffer/service/memory_tracking.h"

namespace gpu {

class TestMemoryTracker : public MemoryTracker {
 public:
  TestMemoryTracker() = default;
  TestMemoryTracker(const TestMemoryTracker&) = delete;
  TestMemoryTracker& operator=(const TestMemoryTracker&) = delete;
  ~TestMemoryTracker() override = default;

  // MemoryTracker implementation.
  void TrackMemoryAllocatedChange(int64_t delta) override;
  uint64_t GetSize() const override;
  uint64_t ClientTracingId() const override;
  int ClientId() const override;
  uint64_t ContextGroupTracingId() const override;

 private:
  uint64_t current_size_ = 0;
};

}  // namespace gpu

#endif  // GPU_COMMAND_BUFFER_SERVICE_TEST_MEMORY_TRACKER_H_