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

Side by Side Diff: gpu/command_buffer/service/fence_manager.h

Issue 2383753002: gpu: Add GpuFence framework.
Patch Set: rebase Created 4 years, 1 month 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
OLDNEW
(Empty)
1 // Copyright 2016 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 GPU_COMMAND_BUFFER_SERVICE_FENCE_MANAGER_H_
6 #define GPU_COMMAND_BUFFER_SERVICE_FENCE_MANAGER_H_
7
8 #include <stdint.h>
9
10 #include "base/containers/hash_tables.h"
11 #include "base/macros.h"
12 #include "base/memory/ref_counted.h"
13 #include "gpu/gpu_export.h"
14
15 namespace gl {
16 class GLFence;
17 }
18
19 namespace gpu {
20 namespace gles2 {
21
22 // This class keeps track of the fences and their state.
23 class GPU_EXPORT FenceManager {
24 public:
25 FenceManager();
26 ~FenceManager();
27
28 void Destroy(bool have_context);
29 void AddFence(std::unique_ptr<gl::GLFence> fence, int32_t service_id);
30 void RemoveFence(int32_t service_id);
31 gl::GLFence* LookupFence(int32_t service_id);
32
33 private:
34 typedef base::hash_map<int32_t, std::unique_ptr<gl::GLFence>> GLFenceMap;
35 GLFenceMap fences_;
36
37 DISALLOW_COPY_AND_ASSIGN(FenceManager);
38 };
39
40 } // namespage gles2
41 } // namespace gpu
42
43 #endif // GPU_COMMAND_BUFFER_SERVICE_FENCE_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698