Closed
Bug 546515
Opened 13 years ago
Closed 13 years ago
Direct3D 9 Layers Backend
Categories
(Core :: Graphics, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: bas.schouten, Assigned: bas.schouten)
References
(Blocks 1 open bug)
Details
Attachments
(2 files, 2 obsolete files)
4.65 KB,
patch
|
roc
:
review+
|
Details | Diff | Splinter Review |
97.52 KB,
patch
|
jrmuizel
:
review+
|
Details | Diff | Splinter Review |
A Direct3D 9 Layers Backend can be used on Win2K+ where D3D9 is available and working hardware is found for hardware acceleration.
Assignee | ||
Updated•13 years ago
|
Comment 1•13 years ago
|
||
The work for this is happening in: http://hg.mozilla.org/users/bschouten_mozilla.com/ http://hg.mozilla.org/users/jmuizelaar_mozilla.com/
Assignee | ||
Comment 2•13 years ago
|
||
Attachment #446637 -
Flags: review?(jmuizelaar)
Assignee | ||
Comment 3•13 years ago
|
||
Attachment #446643 -
Flags: review?(roc)
It looks like if prefer-opengl is false, but we can't instantiate the GL layer manager, we'll just fall back to basic rendering instead of D2D. I think we should use D2D in that case. So I suggest copying LayerManagerOGL construction in here and don't call nsBaseWidget::GetLayerManager at all for the accelerated case.
By the way, would you mind letting me push (or pushing yourself) patches 4 and 5 from bug 564993 before these land and rot me again?
Assignee | ||
Comment 6•13 years ago
|
||
Attachment #446643 -
Attachment is obsolete: true
Attachment #446648 -
Flags: review?(roc)
Attachment #446643 -
Flags: review?(roc)
Attachment #446648 -
Flags: review?(roc) → review+
Assignee | ||
Comment 7•13 years ago
|
||
Adapted to layers restructuring.
Attachment #446637 -
Attachment is obsolete: true
Attachment #446656 -
Flags: review?(jmuizelaar)
Attachment #446637 -
Flags: review?(jmuizelaar)
Comment 8•13 years ago
|
||
Comment on attachment 446656 [details] [diff] [review] Part 1: Add D3D9 Layers Backend v2 I've only done a quick pass over this, but figure that it's not super high risk. I plan on going through it more thoroughly, but I can also do that after it's landed. If you do land it early, make sure it does indeed work better than the ogl backend before defaulting to it. We don't want any regressions there. I noticed a couple of '/**' comments, and I'm not a huge fan of that style. I find the extra '*' rarely adds much value. > >-DEFINES += -DIMPL_THEBES >+DEFINES += -DIMPL_THEBES -DD3D_DEBUG_INFO We probably don't want to unconditionally define this right? >+ >+#ifdef XP_WIN >+ if (mSurface->GetType() == gfxASurface::SurfaceTypeWin32) { >+ sourceSurface = static_cast<gfxWindowsSurface*>(mSurface.get())->GetImageSurface(); >+ startBits = sourceSurface->Data() + sourceSurface->Stride() * aRect.y + >+ aRect.x * 4; >+ sourceStride = sourceSurface->Stride(); >+ } else >+#endif I'm not sure we need this #ifdef >+void >+LayerManagerD3D9::CopyToTarget() >+{ I think PaintToTarget would be a better name. >+ >+PRBool >+LayerManagerD3D9::VerifyCaps() >+{ >+ return PR_TRUE; >+} Failures in the above would be useful to communicate in a log or some such thing. Probably not needed for this patch though. >+} /* layers */ >+} /* mozilla */ >+#endif /* GFX_THEBESLAYEROGL_H */ s/GFX_THEBESLAYEROGL_H/GFX_THEBESLAYERD3D9_H/
Attachment #446656 -
Flags: review?(jmuizelaar) → review+
Assignee | ||
Comment 9•13 years ago
|
||
Pushed http://hg.mozilla.org/mozilla-central/rev/f87f31d83650. Pushed http://hg.mozilla.org/mozilla-central/rev/d4e5f5f19777.
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Comment 10•13 years ago
|
||
God save Mozilla !
Comment 11•13 years ago
|
||
What needs to be done to use this on XP? I can't find info.
Comment 12•13 years ago
|
||
Correct me if I'm wrong, Right now its being used for full screen Theora videos.
Assignee | ||
Comment 13•13 years ago
|
||
(In reply to comment #12) > Correct me if I'm wrong, Right now its being used for full screen Theora > videos. It is, nothing needs to be done. If you have a GPU supporting Shader Model 2.0 or higher and DirectX 9 installed (comes with XP SP2), you will have this used for fullscreen video.
Comment 14•13 years ago
|
||
So, what SDK do I need to have to be able to build this successfully?
Comment 15•13 years ago
|
||
Comment on attachment 446648 [details] [diff] [review] Part 2: Use D3D9 layers backend as preferred backend on Windows v2 >+ nsCOMPtr<nsIPrefBranch2> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID); Nit: it wasn't necessary to use nsIPrefBranch2 here; nsIPrefBranch suffices.
Assignee | ||
Comment 16•13 years ago
|
||
(In reply to comment #15) > (From update of attachment 446648 [details] [diff] [review]) > >+ nsCOMPtr<nsIPrefBranch2> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID); > Nit: it wasn't necessary to use nsIPrefBranch2 here; nsIPrefBranch suffices. As far as I know you can't get a pref value lower in the branch directly with nsIPrefBranch, can you?
Assignee | ||
Comment 17•13 years ago
|
||
(In reply to comment #14) > So, what SDK do I need to have to be able to build this successfully? They include the needed headers with the Windows SDK these days. But to get a lot of useful tools (The D3D debugger, shader compiler, debug libs, etc.), you'd need the DirectX SDK (any recent version).
Comment 18•13 years ago
|
||
(In reply to comment #16) > (In reply to comment #15) > > (From update of attachment 446648 [details] [diff] [review] [details]) > > >+ nsCOMPtr<nsIPrefBranch2> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID); > > Nit: it wasn't necessary to use nsIPrefBranch2 here; nsIPrefBranch suffices. > As far as I know you can't get a pref value lower in the branch directly with > nsIPrefBranch, can you? ??? The only reason you need an nsIPrefBranch2 is if you need to call addObserver or removeObserver, which don't exist on nsIPrefBranch. (In reply to comment #17) > (In reply to comment #14) > > So, what SDK do I need to have to be able to build this successfully? > They include the needed headers with the Windows SDK these days. Yes, but which one? Prior to this patch you could build (most of) the app with the Windows Server 2003 SDK, since all the optional stuff was #ifdef out.
You need to log in
before you can comment on or make changes to this bug.
Description
•