Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
6edfc3f
Adds wide gamut colors to the framework.
gaaclarke Aug 6, 2024
40084ae
added tests
gaaclarke Aug 7, 2024
8c4c410
expanded tests
gaaclarke Aug 7, 2024
ce78b22
++
gaaclarke Aug 7, 2024
04aaf75
++
gaaclarke Aug 7, 2024
0d73206
added transform test
gaaclarke Aug 7, 2024
509520e
format
gaaclarke Aug 7, 2024
637edf4
added test
gaaclarke Aug 7, 2024
b78eaa9
++
gaaclarke Aug 8, 2024
ed53d48
++
gaaclarke Aug 8, 2024
2381f63
++
gaaclarke Aug 8, 2024
039988b
started sending down the wider colors in paint
gaaclarke Aug 8, 2024
c739705
tidy
gaaclarke Aug 12, 2024
c0cdc80
added missing round
gaaclarke Aug 13, 2024
29c53bf
expanded precision of transforms
gaaclarke Aug 13, 2024
f7fbdae
moved dart tests to existing fixture
gaaclarke Aug 13, 2024
7b01f51
removed deprecated value call
gaaclarke Aug 13, 2024
0cdc28f
updated scaleAlpha
gaaclarke Aug 13, 2024
a6ea956
updated lerp
gaaclarke Aug 13, 2024
74935a4
made lerp continuous
gaaclarke Aug 13, 2024
e50b5e1
made lerping different colorspaces an exception
gaaclarke Aug 13, 2024
bddf6ae
reverted equality logic and lowered the lerp bend
gaaclarke Aug 14, 2024
8ae9792
added todo
gaaclarke Aug 14, 2024
35ab99b
added alpha blend asserts
gaaclarke Aug 14, 2024
f222469
fixed hashcode
gaaclarke Aug 14, 2024
3605d2e
reverted lerp changes for now, added todo
gaaclarke Aug 14, 2024
bebcbc1
update docstrings
gaaclarke Aug 14, 2024
eb85b82
made change generate less garbage
gaaclarke Aug 14, 2024
515021b
made sure lerp handles colorspaces
gaaclarke Aug 14, 2024
008feb0
made sure that alphaBlend keeps the colorspace
gaaclarke Aug 14, 2024
0491e94
removed unnecessary function
gaaclarke Aug 14, 2024
2c345f1
waffled back to minimal changes to lerp
gaaclarke Aug 14, 2024
554b542
updated docstring
gaaclarke Aug 14, 2024
f60b4f2
made constructor math more backwards compatible
gaaclarke Aug 14, 2024
6dacccd
docstrings
gaaclarke Aug 14, 2024
678d190
updated docstrings
gaaclarke Aug 14, 2024
968e4fc
duplicated constructor logic for `with*` methods.
gaaclarke Aug 14, 2024
7da170e
docstring update
gaaclarke Aug 14, 2024
c48427b
jonah feedback
gaaclarke Aug 14, 2024
3dec51d
withValues
gaaclarke Aug 14, 2024
ad87f52
jonah feedback
gaaclarke Aug 14, 2024
c88ba11
brought over web_ui changes
gaaclarke Aug 14, 2024
edf2f10
fixed web ui test and copied to our non web tests
gaaclarke Aug 15, 2024
a19d2c0
moved change to web
gaaclarke Aug 16, 2024
4f0e01a
made sure we don't get overflow when converting to int8
gaaclarke Aug 16, 2024
d6b20ec
fixed subclassing cupertino cases
gaaclarke Aug 19, 2024
500afda
moved changes to web
gaaclarke Aug 19, 2024
a293de1
reverted opacity change to acommodate subclasses
gaaclarke Aug 20, 2024
f69e7f1
moved back to int storage
gaaclarke Aug 20, 2024
d2405aa
brought over web changes
gaaclarke Aug 20, 2024
ec7315e
fixed equality
gaaclarke Aug 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion lib/gpu/lib/src/render_pass.dart
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,15 @@ base class RenderTarget {
final DepthStencilAttachment? depthStencilAttachment;
}

// TODO(gaaclarke): Refactor this to support wide gamut colors.
int _colorToInt(ui.Color color) {
assert(color.colorSpace == ui.ColorSpace.sRGB);
return ((color.a * 255.0).round() << 24) |
((color.r * 255.0).round() << 16) |
((color.g * 255.0).round() << 8) |
((color.b * 255.0).round() << 0);
}

base class RenderPass extends NativeFieldWrapperClass1 {
/// Creates a new RenderPass.
RenderPass._(CommandBuffer commandBuffer, RenderTarget renderTarget) {
Expand All @@ -105,7 +114,7 @@ base class RenderPass extends NativeFieldWrapperClass1 {
index,
color.loadAction.index,
color.storeAction.index,
color.clearValue.value,
_colorToInt(color.clearValue),
color.texture,
color.resolveTexture);
if (error != null) {
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/lerp.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ double? lerpDouble(num? a, num? b, double t) {
///
/// Same as [lerpDouble] but specialized for non-null `double` type.
double _lerpDouble(double a, double b, double t) {
return a * (1.0 - t) + b * t;
return a + (b - a) * t;
}

/// Linearly interpolate between two integers.
Expand Down
Loading