blob: 0c06ad17d3a3c72c2528ecdab7f48d2b6d8b10ca [file] [log] [blame]
// Copyright 2013 The Flutter 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 FLUTTER_IMPELLER_CORE_SAMPLER_H_
#define FLUTTER_IMPELLER_CORE_SAMPLER_H_
#include <unordered_map>
#include "impeller/base/comparable.h"
#include "impeller/core/sampler_descriptor.h"
namespace impeller {
class Sampler {
public:
virtual ~Sampler();
virtual bool IsValid() const = 0;
const SamplerDescriptor& GetDescriptor() const;
protected:
SamplerDescriptor desc_;
explicit Sampler(SamplerDescriptor desc);
private:
Sampler(const Sampler&) = delete;
Sampler& operator=(const Sampler&) = delete;
};
using SamplerMap = std::unordered_map<SamplerDescriptor,
std::shared_ptr<const Sampler>,
ComparableHash<SamplerDescriptor>,
ComparableEqual<SamplerDescriptor>>;
} // namespace impeller
#endif // FLUTTER_IMPELLER_CORE_SAMPLER_H_