blob: 8c79c7e977deb29c0a6269f8c4d320dcdc0a6cdb [file] [log] [blame]
/*
* Copyright 2022 Google LLC
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef skgpu_graphite_GlobalCache_DEFINED
#define skgpu_graphite_GlobalCache_DEFINED
#include "include/core/SkRefCnt.h"
class SkShaderCodeDictionary;
namespace SkSL {
struct ShaderCaps;
}
namespace skgpu::graphite {
// TODO: This class needs to be thread safe. In the current version there is no thread safety and
// we need to go back and add protection around access to any of its memebers.
class GlobalCache : public SkRefCnt {
public:
GlobalCache();
~GlobalCache() override;
SkShaderCodeDictionary* shaderCodeDictionary() const { return fShaderCodeDictionary.get(); }
private:
std::unique_ptr<SkShaderCodeDictionary> fShaderCodeDictionary;
};
} // namespace skgpu::graphite
#endif // skgpu_graphite_GlobalCache_DEFINED