blob: dd26bf6974356ea2c22b35ac4ae97126003cb345 [file] [log] [blame]
tobiasjsfc199b472015-08-22 00:39:061// 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
davidben411d3f72016-01-22 01:41:418#include <string>
9
tobiasjsfc199b472015-08-22 00:39:0610#include "base/containers/hash_tables.h"
avif15d60a2015-12-21 17:06:3311#include "base/macros.h"
tobiasjsfc199b472015-08-22 00:39:0612#include "gpu/gpu_export.h"
13
14namespace gpu {
15namespace 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 Labour6bf942492017-06-14 00:33:4220class GPU_EXPORT FramebufferCompletenessCache {
tobiasjsfc199b472015-08-22 00:39:0621 public:
22 FramebufferCompletenessCache();
Antoine Labour6bf942492017-06-14 00:33:4223 ~FramebufferCompletenessCache();
tobiasjsfc199b472015-08-22 00:39:0624
25 bool IsComplete(const std::string& signature) const;
26 void SetComplete(const std::string& signature);
27
tobiasjsfc199b472015-08-22 00:39:0628 private:
tobiasjsfc199b472015-08-22 00:39:0629 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_