Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(566)

Side by Side Diff: content/common/gpu/gpu_memory_tracking.h

Issue 1845563005: Refactor content/common/gpu into gpu/ipc/service (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Drop ref to deleted content_tests_gypi_values.content_unittests_ozone_sources Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/common/gpu/gpu_memory_manager.cc ('k') | content/common/gpu/gpu_memory_tracking.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012 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
5 #ifndef CONTENT_COMMON_GPU_GPU_MEMORY_TRACKING_H_
6 #define CONTENT_COMMON_GPU_GPU_MEMORY_TRACKING_H_
7
8 #include <stdint.h>
9
10 #include "base/process/process.h"
11 #include "content/common/content_export.h"
12 #include "gpu/command_buffer/service/memory_tracking.h"
13
14 namespace content {
15
16 class GpuMemoryManager;
17
18 // All decoders in a context group point to a single GpuMemoryTrackingGroup,
19 // which tracks GPU resource consumption for the entire context group.
20 class CONTENT_EXPORT GpuMemoryTrackingGroup {
21 public:
22 ~GpuMemoryTrackingGroup();
23 void TrackMemoryAllocatedChange(uint64_t old_size, uint64_t new_size);
24 bool EnsureGPUMemoryAvailable(uint64_t size_needed);
25 base::ProcessId GetPid() const {
26 return pid_;
27 }
28 uint64_t GetSize() const { return size_; }
29 gpu::gles2::MemoryTracker* GetMemoryTracker() const {
30 return memory_tracker_;
31 }
32
33 private:
34 friend class GpuMemoryManager;
35
36 GpuMemoryTrackingGroup(base::ProcessId pid,
37 gpu::gles2::MemoryTracker* memory_tracker,
38 GpuMemoryManager* memory_manager);
39
40 base::ProcessId pid_;
41 uint64_t size_;
42
43 // Set and used only during the Manage function, to determine which
44 // non-surface clients should be hibernated.
45 bool hibernated_;
46
47 gpu::gles2::MemoryTracker* memory_tracker_;
48 GpuMemoryManager* memory_manager_;
49 };
50
51 } // namespace content
52
53 #endif // CONTENT_COMMON_GPU_GPU_MEMORY_TRACKING_H_
OLDNEW
« no previous file with comments | « content/common/gpu/gpu_memory_manager.cc ('k') | content/common/gpu/gpu_memory_tracking.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698