Closed
Bug 589978
Opened 14 years ago
Closed 14 years ago
[D3D9] 2D canvas layers always have premultiplied alpha
Categories
(Core :: Graphics, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: mattwoodrow, Assigned: mattwoodrow)
References
Details
Attachments
(1 file, 2 obsolete files)
2.04 KB,
patch
|
bas.schouten
:
review+
|
Details | Diff | Splinter Review |
No description provided.
Assignee | ||
Comment 1•14 years ago
|
||
Fixes reftest image-element/canvas-outside-document.html
Attachment #468524 -
Flags: review?(bas.schouten)
Comment 2•14 years ago
|
||
Hmm. Could we get away with not using premultiplied in some cases? I thought we just did that because that's what cairo image surfaces do?
Assignee | ||
Comment 3•14 years ago
|
||
2D content coming from canvas is a cairo surface. Don't know enough about this to say whether we could change the canvas backend to skip this.
This is correct; we should rename the flag to something like mDataIsPremultiplied. The canvas 2d data is always premult, only WebGL content can be either.
Comment 5•14 years ago
|
||
Comment on attachment 468524 [details] [diff] [review]
Fix
Let's do this, but let's do the rename Vlad suggested too.
Attachment #468524 -
Flags: review?(bas.schouten) → review+
Assignee | ||
Comment 6•14 years ago
|
||
Attachment #468524 -
Attachment is obsolete: true
Attachment #468584 -
Flags: review+
Comment 7•14 years ago
|
||
Comment on attachment 468584 [details] [diff] [review]
Renamed var
>diff --git a/gfx/layers/d3d9/ThebesLayerD3D9.cpp b/gfx/layers/d3d9/ThebesLayerD3D9.cpp
>--- a/gfx/layers/d3d9/ThebesLayerD3D9.cpp
>+++ b/gfx/layers/d3d9/ThebesLayerD3D9.cpp
>@@ -360,6 +360,17 @@ ThebesLayerD3D9::DrawRegion(const nsIntR
> LayerManagerD3D9::CallbackInfo cbInfo = mD3DManager->GetCallbackInfo();
> cbInfo.Callback(this, context, aRegion, nsIntRegion(), cbInfo.CallbackData);
>
>+ nsRefPtr<gfxImageSurface> isurf =
>+ new gfxImageSurface(gfxIntSize(bounds.width, bounds.height),
>+ gfxASurface::ImageFormatARGB32);
>+
>+ nsRefPtr<gfxContext> cx = new gfxContext(isurf);
>+
>+ cx->SetOperator(gfxContext::OPERATOR_SOURCE);
>+ cx->SetSource(destinationSurface);
>+ cx->Paint();
>+ void *bits = isurf->Data();
>+
> if (UseOpaqueSurface(this)) {
> surf->ReleaseDC(dc);
> } else {
Looks like something spilled into the patch.
Assignee | ||
Comment 8•14 years ago
|
||
Argh.
Attachment #468584 -
Attachment is obsolete: true
Attachment #468589 -
Flags: review+
Updated•14 years ago
|
Attachment #468589 -
Flags: review+
Updated•14 years ago
|
Attachment #468589 -
Flags: review+
Comment 9•14 years ago
|
||
Comment on attachment 468589 [details] [diff] [review]
And without debugging code
http://hg.mozilla.org/mozilla-central/rev/24ab75c424af
Updated•14 years ago
|
Assignee: nobody → matt.woodrow+bugzilla
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•