Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upRemove the other Color type. The idea is to use AzColor for everything. #141
Conversation
| AzColor { r: r, g: g, b: b, a: a } | ||
| } | ||
|
|
||
| pub fn hack(color: AzColor) -> AzColor { |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
mrobinson
Feb 9, 2015
Member
Why is it necessary? It's unclear why you need to create a new AzColor where it's used.
This comment has been minimized.
This comment has been minimized.
Adenilson
Feb 9, 2015
Author
Contributor
Legacy code calls converting the Color to AzColor and vice-versa. I will
try to remove them.
On Mon, Feb 9, 2015 at 12:38 PM, Martin Robinson notifications@github.com
wrote:
In src/azure.rs
#141 (comment):@@ -261,6 +261,16 @@ impl PartialEq for AzColor {
}
}+impl AzColor {
- pub fn new(r: AzFloat, g: AzFloat, b: AzFloat, a: AzFloat) -> AzColor {
AzColor { r: r, g: g, b: b, a: a }- }
- pub fn hack(color: AzColor) -> AzColor {
Why is it necessary? It's unclear why you need to create a new AzColor
where it's used.—
Reply to this email directly or view it on GitHub
https://github.com/servo/rust-azure/pull/141/files#r24363008.
|
Yeah, there is a need to make an explicit copy of a immutable AzColor to pass it to C code. I will rename the function to 'copy' as it better describes it use. |
| AzColor { r: r, g: g, b: b, a: a } | ||
| } | ||
|
|
||
| pub fn copy(color: AzColor) -> AzColor { |
This comment has been minimized.
This comment has been minimized.
| @@ -244,7 +244,7 @@ pub static AZ_ATT_TRANSFER_DISABLE_B: u32 = 2; | |||
| pub static AZ_ATT_TRANSFER_DISABLE_A: u32 = 3; | |||
|
|
|||
| #[repr(C)] | |||
| #[derive(Clone)] | |||
| #[derive(Copy, Clone)] | |||
This comment has been minimized.
This comment has been minimized.
|
This looks good to me. |
|
I'm not a huge fan of the |
|
Agreed. Please check the updated patch. |
(i.e. AzColor). This patch will also move the auxiliar new() function to inside Servo (together with rgb(), rgba(), black(), etc). Also addresses reviewer's comment about AzColor.
|
Needs rebase, will close this request and open a new one. |
Adenilson commentedFeb 9, 2015
No description provided.