[Impeller] Implement tile mode for linear gradient and radial gradient#35087
[Impeller] Implement tile mode for linear gradient and radial gradient#35087auto-submit[bot] merged 8 commits intoflutter:mainfrom
Conversation
bdero
left a comment
There was a problem hiding this comment.
Overall looking good, thanks! Just some comments about where things should live.
impeller/geometry/tile_mode.h
Outdated
|
|
||
| // An enum to define how to repeat, fold, or omit colors outside of the | ||
| // typically defined range of the source of the colors (such as the | ||
| // bounds of an image or the defining geoetry of a gradient). |
There was a problem hiding this comment.
Please use /// for docstring comments.
| const float kTileModeMirror = 2; | ||
| const float kTileModeDecal = 3; | ||
|
|
||
| float GetInterpolantValue(float t, float tile_mode) { |
There was a problem hiding this comment.
Please add a docstring that describes the intended domain and range of this function. Looking at it, the domain appears to be any value and the range is [0 to 1].
| @@ -0,0 +1,21 @@ | |||
| // Copyright 2013 The Flutter Authors. All rights reserved. | |||
There was a problem hiding this comment.
This seems like something that would best be placed in the shader library.
Although it happens to not be being used for a texture in this case. It seems like impeller/compiler/shader_lib/texture.glsl would be an appropriate home for this given its UV mapping behavior. Perhaps call it IPTileTextureCoords?
impeller/geometry/tile_mode.h
Outdated
| @@ -0,0 +1,31 @@ | |||
| // Copyright 2013 The Flutter Authors. All rights reserved. | |||
There was a problem hiding this comment.
geometry is primarily used for math utilities. Please place this enum in the entity framework. Perhaps in the Entity declaration next to the BlendMode enum class.
| // Use of this source code is governed by a BSD-style license that can be | ||
| // found in the LICENSE file. | ||
|
|
||
| const float kTileModeClamp = 0; |
There was a problem hiding this comment.
Please add a comment nearby indicating that these values must correspond to the order of the items in the Entity::TileMode enum class.
Co-authored-by: Brandon DeRosier <[email protected]>
Co-authored-by: Brandon DeRosier <[email protected]>
fix flutter/flutter#108810
Pre-launch Checklist
writing and running engine tests.
///).