Closed Bug 1209715 Opened 4 years ago Closed 4 years ago
Result operators to make it easier to combine different Draw Results
Right now we only combine different DrawResults in nsCSSRendering::PaintBackgroundWithSC(), but to fix 1209703 we're going to have to combine them in *many* places, because borders are frequently drawn using loops. This operation is going to be so common that I think operator overloads are justified. The operators that I think make the most sense to use for this are the bitwise AND operators, because conceptually combining DrawResults works in the same way as bitwise AND: the result is DrawResult::SUCCESS only if both operands are DrawResult::SUCCESS, and otherwise the result is failure. The details are slightly more complicated, because DrawResult::BAD_IMAGE should also be sticky; see the comments in the patch for details.
(In reply to Seth Fowler [:seth] [:s2h] from comment #0) > DrawResult::BAD_IMAGE should > also be sticky; see the comments in the patch for details. Actually I stated this exactly backwards - DrawResult::BAD_IMAGE is explicitly non-sticky, because we want to know if there were any recoverable failures that might go away if we do another paint. So we only want to return DrawResult::BAD_IMAGE if there were no recoverable failures. Unlike comment 0, the comments in the patch get this right. =)
Here's the patch.
Attachment #8667515 - Flags: review?(tnikkel)
Attachment #8667515 - Flags: review?(tnikkel) → review+
Thanks for the review!
You need to log in before you can comment on or make changes to this bug.