Closed Bug 1042411 Opened 11 years ago Closed 11 years ago

"ASSERTION: It is assumed the initial operator is OPERATOR_OVER, when it is restored later"

Categories

(Core :: Graphics, defect)

x86_64
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla34

People

(Reporter: jruderman, Assigned: cabanier)

References

Details

(Keywords: assertion, testcase)

Attachments

(3 files, 6 obsolete files)

Attached file testcase
###!!! ASSERTION: It is assumed the initial operator is OPERATOR_OVER, when it is restored later: 'ctx->CurrentOperator() == gfxContext::OPERATOR_OVER', file layout/base/nsCSSRendering.cpp, line 2838 The testcase uses the "background-blend-mode" CSS property, which was added in bug 841601 and enabled in bug 970600.
Attached file stack
Assignee: nobody → cabanier
I'm unsure how to write a test for this. Are asserts logged as part of testing?
Attachment #8462750 - Flags: review?(roc)
Attachment #8462750 - Flags: review?(roc)
Attachment #8462750 - Attachment is obsolete: true
Attachment #8462787 - Flags: review?(roc)
Attachment #8462787 - Flags: review?(roc)
removed debug code + extra tabs
Attachment #8462787 - Attachment is obsolete: true
Attachment #8462790 - Attachment is obsolete: true
Attachment #8462791 - Flags: review?(roc)
Comment on attachment 8462791 [details] [diff] [review] Fix that isolates moz-element drawing + test Review of attachment 8462791 [details] [diff] [review]: ----------------------------------------------------------------- ::: layout/base/nsCSSRendering.cpp @@ +4785,5 @@ > > + gfxContext* ctx = aRenderingContext.ThebesContext(); > + gfxContext::GraphicsOperator op = ctx->CurrentOperator(); > + if (op != gfxContext::OPERATOR_OVER) { > + ctx->PushGroup(gfxContentType::COLOR); This needs to be COLOR_ALPHA. @@ +4795,5 @@ > filter, aDest, aFill, aAnchor, aDirtyRect, > ConvertImageRendererToDrawFlags(mFlags)); > + > + if (op != gfxContext::OPERATOR_OVER) { > + ctx->PopGroupToSource(); Er, don't you need to call ctx->Paint() here? Your test should have caught these bugs... The problem is probably that your -moz-element reference doesn't paint anything!
Attachment #8462791 - Flags: review?(roc) → review-
> I'm unsure how to write a test for this. Are asserts logged as part of testing? Yes, most of our test suites (including reftest) count asserts and fail unless the test is annotated as expecting that number of asserts. I see that you made a reftest pair to ensure the correct behavior, which is even better.
You're right. The "paint" call was needed. I updated the code and the test so it draws something. try build: https://tbpl.mozilla.org/?tree=Try&rev=b3fc9c6293dd
Attachment #8462791 - Attachment is obsolete: true
Attachment #8463213 - Flags: review?(roc)
Comment on attachment 8463213 [details] [diff] [review] Fix that isolates moz-element drawing + test Review of attachment 8463213 [details] [diff] [review]: ----------------------------------------------------------------- ::: layout/base/nsCSSRendering.cpp @@ +4785,5 @@ > > + gfxContext* ctx = aRenderingContext.ThebesContext(); > + gfxContext::GraphicsOperator op = ctx->CurrentOperator(); > + if (op != gfxContext::OPERATOR_OVER) { > + ctx->PushGroup(gfxContentType::COLOR); This should be COLOR_ALPHA. Your test should test something that isn't fully opaque.
Attachment #8463213 - Flags: review?(roc) → review-
I was wondering what that parameter did. I couldn't find documentation so picked the API that sounded right. Update code + made test transparent + verified that the test was broken without the fix try run: https://tbpl.mozilla.org/?tree=Try&rev=2ccbf0faea91
Attachment #8463213 - Attachment is obsolete: true
Attachment #8463506 - Flags: review?(roc)
Comment on attachment 8463506 [details] [diff] [review] Fix that isolates moz-element drawing + test Review of attachment 8463506 [details] [diff] [review]: ----------------------------------------------------------------- ::: layout/base/nsCSSRendering.cpp @@ +4785,5 @@ > > + gfxContext* ctx = aRenderingContext.ThebesContext(); > + gfxContext::GraphicsOperator op = ctx->CurrentOperator(); > + if (op != gfxContext::OPERATOR_OVER) { > + ctx->PushGroup(gfxContentType::ALPHA); COLOR_ALPHA. I mean it :-). The temporary buffer needs both color channels and an alpha channel. That's what COLOR_ALPHA means. I'm not sure how this passes your test...
Attachment #8463506 - Flags: review?(roc) → review-
argh, sorry about that. Updated patch is attached. try run: https://tbpl.mozilla.org/?tree=Try&rev=30aaecebdb73
Attachment #8463506 - Attachment is obsolete: true
Attachment #8463682 - Flags: review?(roc)
Keywords: checkin-needed
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: