Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / gpu / command_buffer / service / framebuffer_completeness_cache.h
blob7200cbdea66d7c1ea832f79c322f0dda9104f214
1 // Copyright 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.
5 #ifndef GPU_COMMAND_BUFFER_SERVICE_FRAMEBUFFER_COMPLETENESS_CACHE_H_
6 #define GPU_COMMAND_BUFFER_SERVICE_FRAMEBUFFER_COMPLETENESS_CACHE_H_
8 #include "base/containers/hash_tables.h"
9 #include "base/memory/ref_counted.h"
10 #include "gpu/gpu_export.h"
12 namespace gpu {
13 namespace gles2 {
15 // Refcounted wrapper for a hash_set of framebuffer format signatures
16 // representing framebuffer configurations that are reported by the GL
17 // driver as complete according to glCheckFramebufferStatusEXT.
18 class GPU_EXPORT FramebufferCompletenessCache
19 : public base::RefCounted<FramebufferCompletenessCache> {
20 public:
21 FramebufferCompletenessCache();
23 bool IsComplete(const std::string& signature) const;
24 void SetComplete(const std::string& signature);
26 protected:
27 virtual ~FramebufferCompletenessCache();
29 private:
30 friend class base::RefCounted<FramebufferCompletenessCache>;
32 typedef base::hash_set<std::string> Map;
34 Map cache_;
36 DISALLOW_COPY_AND_ASSIGN(FramebufferCompletenessCache);
39 } // namespace gles2
40 } // namespace gpu
42 #endif // GPU_COMMAND_BUFFER_SERVICE_FRAMEBUFFER_COMPLETENESS_CACHE_H_