Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit e4fac78

Browse files
authored
1 parent 7094f0a commit e4fac78

File tree

6 files changed

+80
-811
lines changed

6 files changed

+80
-811
lines changed

lib/gpu/lib/src/render_pass.dart

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,6 @@ base class RenderTarget {
9595
final DepthStencilAttachment? depthStencilAttachment;
9696
}
9797

98-
// TODO(gaaclarke): Refactor this to support wide gamut colors.
99-
int _colorToInt(ui.Color color) {
100-
assert(color.colorSpace == ui.ColorSpace.sRGB);
101-
return ((color.a * 255.0).round() << 24) |
102-
((color.r * 255.0).round() << 16) |
103-
((color.g * 255.0).round() << 8) |
104-
((color.b * 255.0).round() << 0);
105-
}
106-
10798
base class RenderPass extends NativeFieldWrapperClass1 {
10899
/// Creates a new RenderPass.
109100
RenderPass._(CommandBuffer commandBuffer, RenderTarget renderTarget) {
@@ -114,7 +105,7 @@ base class RenderPass extends NativeFieldWrapperClass1 {
114105
index,
115106
color.loadAction.index,
116107
color.storeAction.index,
117-
_colorToInt(color.clearValue),
108+
color.clearValue.value,
118109
color.texture,
119110
color.resolveTexture);
120111
if (error != null) {

lib/ui/lerp.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ double? lerpDouble(num? a, num? b, double t) {
2626
///
2727
/// Same as [lerpDouble] but specialized for non-null `double` type.
2828
double _lerpDouble(double a, double b, double t) {
29-
return a + (b - a) * t;
29+
return a * (1.0 - t) + b * t;
3030
}
3131

3232
/// Linearly interpolate between two integers.

0 commit comments

Comments
 (0)