#include <dl_color_source.h>
|
static std::shared_ptr< DlLinearGradientColorSource > | MakeLinear (const SkPoint start_point, const SkPoint end_point, uint32_t stop_count, const DlColor *colors, const float *stops, DlTileMode tile_mode, const SkMatrix *matrix=nullptr) |
|
static std::shared_ptr< DlRadialGradientColorSource > | MakeRadial (SkPoint center, SkScalar radius, uint32_t stop_count, const DlColor *colors, const float *stops, DlTileMode tile_mode, const SkMatrix *matrix=nullptr) |
|
static std::shared_ptr< DlConicalGradientColorSource > | MakeConical (SkPoint start_center, SkScalar start_radius, SkPoint end_center, SkScalar end_radius, uint32_t stop_count, const DlColor *colors, const float *stops, DlTileMode tile_mode, const SkMatrix *matrix=nullptr) |
|
static std::shared_ptr< DlSweepGradientColorSource > | MakeSweep (SkPoint center, SkScalar start, SkScalar end, uint32_t stop_count, const DlColor *colors, const float *stops, DlTileMode tile_mode, const SkMatrix *matrix=nullptr) |
|
static std::shared_ptr< DlRuntimeEffectColorSource > | MakeRuntimeEffect (sk_sp< DlRuntimeEffect > runtime_effect, std::vector< std::shared_ptr< DlColorSource > > samplers, std::shared_ptr< std::vector< uint8_t > > uniform_data) |
|
Definition at line 285 of file dl_color_source.h.
◆ DlGradientColorSourceBase()
flutter::DlGradientColorSourceBase::DlGradientColorSourceBase |
( |
uint32_t |
stop_count, |
|
|
DlTileMode |
tile_mode, |
|
|
const SkMatrix * |
matrix = nullptr |
|
) |
| |
|
inlineprotected |
Definition at line 312 of file dl_color_source.h.
DlTileMode tile_mode() const
const SkMatrix & matrix() const
DlMatrixColorSourceBase(const SkMatrix *matrix)
◆ base_equals_()
Definition at line 325 of file dl_color_source.h.
325 {
326 if (mode_ != other_base->mode_ ||
matrix() != other_base->matrix() ||
327 stop_count_ != other_base->stop_count_) {
328 return false;
329 }
330 static_assert(
sizeof(
colors()[0]) == 4);
331 static_assert(
sizeof(
stops()[0]) == 4);
332 int num_bytes = stop_count_ * 4;
333 return (memcmp(
colors(), other_base->colors(), num_bytes) == 0 &&
334 memcmp(
stops(), other_base->stops(), num_bytes) == 0);
335 }
const DlColor * colors() const
const float * stops() const
◆ colors()
const DlColor * flutter::DlGradientColorSourceBase::colors |
( |
| ) |
const |
|
inline |
◆ is_opaque()
bool flutter::DlGradientColorSourceBase::is_opaque |
( |
| ) |
const |
|
inlineoverridevirtual |
Implements flutter::DlColorSource.
Definition at line 287 of file dl_color_source.h.
287 {
289 return false;
290 }
292 for (uint32_t
i = 0;
i < stop_count_;
i++) {
293 if (my_colors[
i].getAlpha() < 255) {
294 return false;
295 }
296 }
297 return true;
298 }
◆ isGradient()
bool flutter::DlGradientColorSourceBase::isGradient |
( |
| ) |
const |
|
inlineoverridevirtual |
If the underlying platform data represents a gradient.
TODO(matanl): Remove this flag when the Skia backend is
removed, https://github.com/flutter/flutter/issues/112498.
- Returns
- True if the class represents the output of a gradient.
Reimplemented from flutter::DlColorSource.
Definition at line 300 of file dl_color_source.h.
◆ pod()
virtual const void * flutter::DlGradientColorSourceBase::pod |
( |
| ) |
const |
|
protectedpure virtual |
◆ stop_count()
int flutter::DlGradientColorSourceBase::stop_count |
( |
| ) |
const |
|
inline |
◆ stops()
const float * flutter::DlGradientColorSourceBase::stops |
( |
| ) |
const |
|
inline |
◆ store_color_stops()
void flutter::DlGradientColorSourceBase::store_color_stops |
( |
void * |
pod, |
|
|
const DlColor * |
color_data, |
|
|
const float * |
stop_data |
|
) |
| |
|
inlineprotected |
Definition at line 337 of file dl_color_source.h.
339 {
341 memcpy(color_storage, color_data, stop_count_ * sizeof(*color_data));
342 float* stop_storage = reinterpret_cast<float*>(color_storage + stop_count_);
343 if (stop_data) {
344 memcpy(stop_storage, stop_data, stop_count_ * sizeof(*stop_data));
345 } else {
346 float div = stop_count_ - 1;
347 if (div <= 0) {
348 div = 1;
349 }
350 for (uint32_t
i = 0;
i < stop_count_;
i++) {
351 stop_storage[
i] =
i / div;
352 }
353 }
354 }
◆ tile_mode()
DlTileMode flutter::DlGradientColorSourceBase::tile_mode |
( |
| ) |
const |
|
inline |
◆ vector_sizes()
size_t flutter::DlGradientColorSourceBase::vector_sizes |
( |
| ) |
const |
|
inlineprotected |
The documentation for this class was generated from the following file: