tobiasjs | fc199b47 | 2015-08-22 00:39:06 | [diff] [blame] | 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. |
| 4 | |
| 5 | #ifndef GPU_COMMAND_BUFFER_SERVICE_FRAMEBUFFER_COMPLETENESS_CACHE_H_ |
| 6 | #define GPU_COMMAND_BUFFER_SERVICE_FRAMEBUFFER_COMPLETENESS_CACHE_H_ |
| 7 | |
davidben | 411d3f7 | 2016-01-22 01:41:41 | [diff] [blame] | 8 | #include <string> |
| 9 | |
tobiasjs | fc199b47 | 2015-08-22 00:39:06 | [diff] [blame] | 10 | #include "base/containers/hash_tables.h" |
avi | f15d60a | 2015-12-21 17:06:33 | [diff] [blame] | 11 | #include "base/macros.h" |
tobiasjs | fc199b47 | 2015-08-22 00:39:06 | [diff] [blame] | 12 | #include "gpu/gpu_export.h" |
| 13 | |
| 14 | namespace gpu { |
| 15 | namespace gles2 { |
| 16 | |
| 17 | // Refcounted wrapper for a hash_set of framebuffer format signatures |
| 18 | // representing framebuffer configurations that are reported by the GL |
| 19 | // driver as complete according to glCheckFramebufferStatusEXT. |
Antoine Labour | 6bf94249 | 2017-06-14 00:33:42 | [diff] [blame] | 20 | class GPU_EXPORT FramebufferCompletenessCache { |
tobiasjs | fc199b47 | 2015-08-22 00:39:06 | [diff] [blame] | 21 | public: |
| 22 | FramebufferCompletenessCache(); |
Antoine Labour | 6bf94249 | 2017-06-14 00:33:42 | [diff] [blame] | 23 | ~FramebufferCompletenessCache(); |
tobiasjs | fc199b47 | 2015-08-22 00:39:06 | [diff] [blame] | 24 | |
| 25 | bool IsComplete(const std::string& signature) const; |
| 26 | void SetComplete(const std::string& signature); |
| 27 | |
tobiasjs | fc199b47 | 2015-08-22 00:39:06 | [diff] [blame] | 28 | private: |
tobiasjs | fc199b47 | 2015-08-22 00:39:06 | [diff] [blame] | 29 | typedef base::hash_set<std::string> Map; |
| 30 | |
| 31 | Map cache_; |
| 32 | |
| 33 | DISALLOW_COPY_AND_ASSIGN(FramebufferCompletenessCache); |
| 34 | }; |
| 35 | |
| 36 | } // namespace gles2 |
| 37 | } // namespace gpu |
| 38 | |
| 39 | #endif // GPU_COMMAND_BUFFER_SERVICE_FRAMEBUFFER_COMPLETENESS_CACHE_H_ |