Closed
Bug 1046550
Opened 10 years ago
Closed 10 years ago
Allow using Direct2D 1.1 for layer rendering
Categories
(Core :: Graphics, defect)
Tracking
()
RESOLVED
FIXED
mozilla35
People
(Reporter: mattwoodrow, Assigned: mattwoodrow)
References
(Depends on 1 open bug)
Details
Attachments
(3 files, 4 obsolete files)
(deleted),
patch
|
mattwoodrow
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
bas.schouten
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
mattwoodrow
:
review+
|
Details | Diff | Splinter Review |
Patch that gets this somewhat working attached. There's still a lot of bugs and we hit asserts frequently.
Attachment #8465219 -
Flags: review?(bas)
Assignee | ||
Comment 1•10 years ago
|
||
A couple of things that I saw:
DrawTargetD2D1 and SourceSurfaceD2D1 can both hold references to each other, causing cycles. It also causes us to fail this assertion http://mxr.mozilla.org/mozilla-central/source/gfx/layers/d3d11/TextureD3D11.cpp#248
Nothing appears to ever remove things from DrawTargetD2D1::mDependentTargets, so we hit this assertion: http://mxr.mozilla.org/mozilla-central/source/gfx/2d/DrawTargetD2D1.cpp#681
Comment 2•10 years ago
|
||
Comment on attachment 8465219 [details] [diff] [review]
allow-d2d11
Review of attachment 8465219 [details] [diff] [review]:
-----------------------------------------------------------------
::: gfx/layers/d3d11/TextureD3D11.cpp
@@ +165,4 @@
> MOZ_ASSERT(mDrawTarget->refCount() == 1);
> + if (mTexture) {
> + LockD3DTexture(mTexture.get());
> + } else {
MOZ_ASSERT(mTexture10)
etc.
::: gfx/thebes/gfxPrefs.h
@@ +157,5 @@
> DECL_GFX_PREF(Live, "gfx.color_management.rendering_intent", CMSRenderingIntent, int32_t, 0);
>
> DECL_GFX_PREF(Once, "gfx.direct2d.disabled", Direct2DDisabled, bool, false);
> DECL_GFX_PREF(Once, "gfx.direct2d.force-enabled", Direct2DForceEnabled, bool, false);
> + DECL_GFX_PREF(Once, "gfx.direct2d.use1_1", Direct2DUse1_1, bool, false);
We might as well make it live I suppose?
::: gfx/thebes/moz.build
@@ +193,5 @@
> 'gfxDWriteTextAnalysis.cpp',
> ]
>
> + if CONFIG['MOZ_ENABLE_DIRECT2D1_1']:
> + DEFINES['USE_D2D1_1'] = True
It's unclear to me what we need this for? :) I'm guessing in some intermediate stage you had something conditional inside gfxWindowsPlatform?
Attachment #8465219 -
Flags: review?(bas) → review+
Assignee | ||
Comment 3•10 years ago
|
||
gfxWindowsPlatform includes 2D.h which checks USE_D2D1_1.
Assignee | ||
Comment 4•10 years ago
|
||
Updated patch without the racy device.
Attachment #8465938 -
Flags: review?(bas)
Comment 5•10 years ago
|
||
Slightly cleaned up and splitted out Content device additions.
Attachment #8469227 -
Flags: review?(matt.woodrow)
Comment 6•10 years ago
|
||
This is basically Matt Woodrow's patch split up and rebased. Carrying my t+.
Attachment #8469296 -
Flags: review+
Comment 7•10 years ago
|
||
Last bit of Matt's patch, rebased. Carrying my r+.
Attachment #8465219 -
Attachment is obsolete: true
Attachment #8465938 -
Attachment is obsolete: true
Attachment #8465938 -
Flags: review?(bas)
Attachment #8469302 -
Flags: review+
Assignee | ||
Comment 8•10 years ago
|
||
Comment on attachment 8469227 [details] [diff] [review]
Part 1: Add content device to gfxWindowsPlatform
Review of attachment 8469227 [details] [diff] [review]:
-----------------------------------------------------------------
::: gfx/thebes/gfxWindowsPlatform.cpp
@@ +1495,5 @@
> + if (FAILED(hr)) {
> + return;
> + }
> +
> + hr = d3d11CreateDevice(adapter, D3D_DRIVER_TYPE_UNKNOWN, nullptr,
You might want to #ifdef this piece in USE_D3D1_1 to avoid allocating it if it won't ever be used. Not that it matters much.
Attachment #8469227 -
Flags: review?(matt.woodrow) → review+
Comment 9•10 years ago
|
||
This adds a bunch of code to assure temporary DTs created are also of the right backend.
Attachment #8469302 -
Attachment is obsolete: true
Attachment #8488164 -
Flags: review?(matt.woodrow)
Comment 10•10 years ago
|
||
The right patch this time.
Attachment #8488165 -
Flags: review?(matt.woodrow)
Updated•10 years ago
|
Attachment #8488164 -
Attachment is obsolete: true
Attachment #8488164 -
Flags: review?(matt.woodrow)
Assignee | ||
Comment 11•10 years ago
|
||
Comment on attachment 8488165 [details] [diff] [review]
Part 3: Use Direct2D 1.1 when preffed on in D3D11 layers v2
Review of attachment 8488165 [details] [diff] [review]:
-----------------------------------------------------------------
::: gfx/layers/moz.build
@@ +99,5 @@
> 'd3d11/CompositorD3D11.cpp',
> 'd3d11/ReadbackManagerD3D11.cpp',
> + ]
> + if CONFIG['MOZ_ENABLE_DIRECT2D1_1']:
> + DEFINES['USE_D2D1_1'] = True
Whitespace!
Attachment #8488165 -
Flags: review?(matt.woodrow) → review+
Comment 12•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/418e2846120f
https://hg.mozilla.org/mozilla-central/rev/20e97c8496e4
https://hg.mozilla.org/mozilla-central/rev/7b9201731195
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla35
Comment 13•10 years ago
|
||
Comment on attachment 8488165 [details] [diff] [review]
Part 3: Use Direct2D 1.1 when preffed on in D3D11 layers v2
>+ if (gfxPrefs::Direct2DUse1_1() && Factory::SupportsD2D1()) {
>+ contentMask |= BackendTypeBit(BackendType::DIRECT2D1_1);
>+ defaultBackend = BackendType::DIRECT2D1_1;
>+ } else {
>+ defaultBackend = BackendType::DIRECT2D;
>+ }
SupportsD2D1() is #ifdef in 2D.h so the compile fails if you don't have it. Perhaps you could write
#ifdef USE_D2D1_1
if (gfxPrefs::Direct2DUse1_1() && Factory::SupportsD2D1()) {
contentMask |= BackendTypeBit(BackendType::DIRECT2D1_1);
defaultBackend = BackendType::DIRECT2D1_1;
} else
#endif
defaultBackend = BackendType::DIRECT2D;
Comment 14•10 years ago
|
||
My bad, I now see bug 1068590 exists for that.
You need to log in
before you can comment on or make changes to this bug.
Description
•