blob: b83ac6fc46c78c2df9a9ecc0a7e9975529afa0fb [file] [log] [blame]
// Copyright (c) 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef UI_GL_SHADER_TRACKING_H_
#define UI_GL_SHADER_TRACKING_H_
#include <string>
#include "base/macros.h"
#include "base/no_destructor.h"
#include "base/synchronization/lock.h"
#include "build/build_config.h"
#include "ui/gl/gl_export.h"
namespace ui {
namespace gl {
class GL_EXPORT ShaderTracking {
public:
static ShaderTracking* GetInstance();
static const size_t kMaxShaderSize = 1024;
void GetShaders(std::string* shader0, std::string* shader1);
void SetShaders(const char* shader0, const char* shader1);
private:
friend base::NoDestructor<ShaderTracking>;
ShaderTracking() {}
~ShaderTracking() {}
mutable base::Lock lock_;
std::string shaders_[2];
DISALLOW_COPY_AND_ASSIGN(ShaderTracking);
};
} // namespace gl
} // namespace ui
#endif // UI_GL_SHADER_TRACKING_H_