summaryrefslogtreecommitdiffstats
path: root/components/mus/gles2/gpu_memory_tracker.h
blob: 91b9b98234057438bb51e8a78e3e33dfb06347d5 (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 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.

#ifndef COMPONENTS_MUS_GLES2_GPU_MEMORY_TRACKER_H_
#define COMPONENTS_MUS_GLES2_GPU_MEMORY_TRACKER_H_

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

namespace mus {

// TODO(fsamuel, rjkroege): This is a stub implementation that needs to be
// completed for proper memory tracking.
class GpuMemoryTracker : public gpu::gles2::MemoryTracker {
 public:
  GpuMemoryTracker();

  // gpu::MemoryTracker implementation:
  void TrackMemoryAllocatedChange(
      size_t old_size,
      size_t new_size,
      gpu::gles2::MemoryTracker::Pool pool) override;
  bool EnsureGPUMemoryAvailable(size_t size_needed) override;
  uint64_t ClientTracingId() const override;
  int ClientId() const override;

 private:
  ~GpuMemoryTracker() override;

  DISALLOW_COPY_AND_ASSIGN(GpuMemoryTracker);
};

}  // namespace mus

#endif  // COMPONENTS_MUS_GLES2_GPU_MEMORY_TRACKER_H_