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 upEnsure calling VertexDataTexture::update always guarantees texture() to succeed. #3185
Conversation
|
Asking for some clarifications |
| @@ -1232,7 +1232,7 @@ impl Device { | |||
| 0, | |||
| desc.external, | |||
| desc.pixel_type, | |||
| pixels.map(texels_to_u8_slice), | |||
| pixels.and_then(texels_to_u8_slice), | |||
This comment has been minimized.
This comment has been minimized.
kvark
Oct 11, 2018
Member
I don't think this is correct. If the slice is provided, we exactly X bytes of data. Just ignoring empty data slices and treating them as storage allocation without initialization is something we shouldn't need to do.
This comment has been minimized.
This comment has been minimized.
emilio
Oct 11, 2018
Author
Member
Well, pixels.as_ptr() will return something close to null, but yeah, I guess it's not really needed if the size is zero.
This comment has been minimized.
This comment has been minimized.
emilio
Oct 11, 2018
Author
Member
Reverted these changes. This was just me being overly cautious with &[T].as_ptr() returning something non-null, which has bit me in the past.
|
@bors-servo r+ |
|
|
Ensure calling VertexDataTexture::update always guarantees texture() to succeed. Alternative is stop assuming there's a texture, which we may or may not want to do (happy to do that, but I know Bobby has in-flight patches for a bunch of the texture stuff, so this probably is less breaking). Fixes #3184 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/webrender/3185) <!-- Reviewable:end -->
|
@bors-servo r- |
7ed06a7
to
98ddee0
|
I don't get why we'd want |
|
Thanks! |
|
|
Ensure calling VertexDataTexture::update always guarantees texture() to succeed. Alternative is stop assuming there's a texture, which we may or may not want to do (happy to do that, but I know Bobby has in-flight patches for a bunch of the texture stuff, so this probably is less breaking). Fixes #3184 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/webrender/3185) <!-- Reviewable:end -->
|
|
emilio commentedOct 11, 2018
•
edited by larsbergstrom
Alternative is stop assuming there's a texture, which we may or may not want to
do (happy to do that, but I know Bobby has in-flight patches for a bunch of the
texture stuff, so this probably is less breaking).
Fixes #3184
This change is