Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
gradient_generator.h
Go to the documentation of this file.
1// Copyright 2013 The Flutter 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 FLUTTER_IMPELLER_ENTITY_CONTENTS_GRADIENT_GENERATOR_H_
6#define FLUTTER_IMPELLER_ENTITY_CONTENTS_GRADIENT_GENERATOR_H_
7
8#include <functional>
9#include <memory>
10#include <vector>
11
12#include "flutter/fml/macros.h"
13#include "flutter/impeller/core/texture.h"
19
20namespace impeller {
21
22class Context;
23
24/**
25 * @brief Create a host visible texture that contains the gradient defined
26 * by the provided gradient data.
27 */
28std::shared_ptr<Texture> CreateGradientTexture(
29 const GradientData& gradient_data,
30 const std::shared_ptr<impeller::Context>& context);
31
37
38/**
39 * @brief Populate a vector with the color and stop data for a gradient
40 *
41 * @param colors
42 * @param stops
43 * @return StopData
44 */
45std::vector<StopData> CreateGradientColors(const std::vector<Color>& colors,
46 const std::vector<Scalar>& stops);
47
48} // namespace impeller
49
50#endif // FLUTTER_IMPELLER_ENTITY_CONTENTS_GRADIENT_GENERATOR_H_
float Scalar
Definition scalar.h:18
std::vector< StopData > CreateGradientColors(const std::vector< Color > &colors, const std::vector< Scalar > &stops)
Populate a vector with the color and stop data for a gradient.
std::shared_ptr< Texture > CreateGradientTexture(const GradientData &gradient_data, const std::shared_ptr< impeller::Context > &context)
Create a host visible texture that contains the gradient defined by the provided gradient data.