Closed
Bug 593175
Opened 14 years ago
Closed 14 years ago
Use 16bpp when MOZ_GFX_OPTIMIZE_MOBILE is set.
Categories
(Core :: Graphics, defect)
Tracking
()
RESOLVED
FIXED
Tracking | Status | |
---|---|---|
fennec | 2.0b1+ | --- |
People
(Reporter: dougt, Assigned: cjones)
References
Details
Attachments
(5 files, 3 obsolete files)
1.44 KB,
patch
|
karlt
:
review+
|
Details | Diff | Splinter Review |
7.02 KB,
patch
|
karlt
:
review+
|
Details | Diff | Splinter Review |
1.10 KB,
patch
|
karlt
:
review+
|
Details | Diff | Splinter Review |
49.60 KB,
patch
|
Details | Diff | Splinter Review | |
4.41 KB,
patch
|
karlt
:
review+
|
Details | Diff | Splinter Review |
right now we use 32/24 bit images in our basic canvas layer. we should default these to 16 bit when MOZ_GFX_OPTIMIZE_MOBILE is set.
Reporter | ||
Comment 1•14 years ago
|
||
this just hard codes, we probably can do something smarter at some point.. maybe move this into a inline.
Assignee: nobody → doug.turner
Attachment #471657 -
Flags: review?(jones.chris.g)
Comment 2•14 years ago
|
||
Comment on attachment 471657 [details] [diff] [review] patch v.1 > if (mGLContext) { > nsRefPtr<gfxImageSurface> isurf = > new gfxImageSurface(gfxIntSize(mBounds.width, mBounds.height), >+#ifdef MOZ_GFX_OPTIMIZE_MOBILE >+ gfxASurface::ImageFormatRGB16_565); >+#else > IsOpaqueContent() > ? gfxASurface::ImageFormatRGB24 > : gfxASurface::ImageFormatARGB32); >+#endif >+ I think it is not really good to drop ARGB surface for mobile in general... I think we should do switch to 565 only when content is opaque && defaultSystemDepth == 16...
Reporter | ||
Comment 3•14 years ago
|
||
indeed. this patch forces 16bpp with a hammer which is wrong.
Comment 4•14 years ago
|
||
Also it would be probably nice to use gfxPlatform->CreateOffscreenSurface, that function will create for us platform preferred surface with automatic 16bpp switch
Comment 5•14 years ago
|
||
Also I think this bug should cooperate with bug 576437
Assignee | ||
Comment 6•14 years ago
|
||
Note [17:35] <karl> cjones: i don't know what the plan is for the 16/24 choice [17:36] <cjones> hm [17:36] <karl> cjones: there is a pref somewhere, but if it is going to be composited with an ARGB32, i'd choose 24
Comment 7•14 years ago
|
||
Currently Fennec sets mozilla.widget.force-24bpp: http://hg.mozilla.org/mobile-browser/file/bf6750e6e92a/app/mobile.js#l110 If that pref is unset, then it would probably make sense to use the root window with its default visual for gfxPlatform::ScreenReferenceSurface().
(In reply to comment #6) > Note > > [17:35] <karl> cjones: i don't know what the plan is for the 16/24 choice > [17:36] <cjones> hm > [17:36] <karl> cjones: there is a pref somewhere, but if it is going to > be composited with an ARGB32, i'd choose 24 so this was always my argument against 16bpp, but based on romaxa's testing, it sounds like halving the memory bandwidth needed has a far greater positive impact on performance than the extra computation required to composite 32-bit argb and 16-bit 5:6:5 rgb. a standalone benchmark with some numbers would be great to confirm this, though; can probably do it with pixman/cairo directly.
Assignee | ||
Comment 9•14 years ago
|
||
Hey Doug, mind if I steal this bug from you? I ported your original patch to what gfx/layers will be after bug 570625.
Reporter | ||
Updated•14 years ago
|
Assignee: doug.turner → jones.chris.g
Assignee | ||
Updated•14 years ago
|
Attachment #471657 -
Flags: review?(jones.chris.g) → review-
Assignee | ||
Comment 10•14 years ago
|
||
Doesn't really fit here, but I thought I'd sneak it in ;).
Attachment #475000 -
Flags: review?(karlt)
Assignee | ||
Comment 11•14 years ago
|
||
Attachment #475001 -
Flags: review?(roc)
Assignee | ||
Comment 12•14 years ago
|
||
Attachment #471657 -
Attachment is obsolete: true
Attachment #475002 -
Flags: review?(karlt)
Assignee | ||
Comment 13•14 years ago
|
||
Requesting blocking based on comment 8. This should hopefully also be a win with GL compositing for similar reasons.
tracking-fennec: --- → ?
Reporter | ||
Updated•14 years ago
|
tracking-fennec: ? → 2.0+
Why is OptimalFormatFor duplicated?
Assignee | ||
Comment 15•14 years ago
|
||
Might be different for different backends. I'd be happy to keep one impl and split as needed, if you prefer.
Updated•14 years ago
|
Attachment #475000 -
Flags: review?(karlt) → review+
Comment 16•14 years ago
|
||
Chris does it make sense fix bug 576437? will it help for fixing this bug?
Comment 17•14 years ago
|
||
blocking b1 on this -- makes a pretty big difference on Maemo.
tracking-fennec: 2.0+ → 2.0b1+
Comment 18•14 years ago
|
||
Comment on attachment 475002 [details] [diff] [review] part 2: Hand out 5-6-5 opaque buffers on mobile platforms >--- a/gfx/layers/ipc/ShadowLayerUtilsX11.cpp >+++ b/gfx/layers/ipc/ShadowLayerUtilsX11.cpp I don't think it's good to expect a 565 pict format to exist because MOZ_GFX_OPTIMIZE_MOBILE was on (and my comment in bug 570625 comment 53 about the ABORT_IF_FALSE wasn't addressed). What I suggest for a quick simple solution here is to use XRenderFindVisualFormat(Display*, DefaultVisualOfScreen(Screen*)) in CreateSimilar. I don't mind whether or not that is conditional on MOZ_GFX_OPTIMIZE_MOBILE. Might as well forget ImageFormats in (the X11) CreateSimilar and use XRenderFindStandardFormat(Display*, PictStandardARGB32) for COLOR_ALPHA. >--- a/gfx/layers/ipc/ShadowLayers.cpp >+++ b/gfx/layers/ipc/ShadowLayers.cpp >@@ -340,18 +340,21 @@ ShadowLayerForwarder::EndTransaction(nsT > return PR_TRUE; > } > > static gfxASurface::gfxImageFormat > OptimalFormatFor(gfxASurface::gfxContentType aContent) > { > switch (aContent) { > case gfxASurface::CONTENT_COLOR: >- // FIXME/bug 593175: investigate 16bpp >+#ifdef MOZ_GFX_OPTIMIZE_MOBILE >+ return gfxASurface::ImageFormatRGB16_565; >+#else > return gfxASurface::ImageFormatRGB24; >+#endif This gfxASurface::ImageFormatRGB16_565 for MOZ_GFX_OPTIMIZE_MOBILE in ShadowLayers.cpp is fine because image surfaces are known to support image formats. Please turn off mozilla.widget.force-24bpp in Fennec if Gecko is not going to be consistent in honoring it.
Attachment #475002 -
Flags: review?(karlt) → review-
Comment 19•14 years ago
|
||
Ok, I'm about to push bug 576437 (checking it on try server).. I think it make sense create this fixes based on fix from bug 576437
Depends on: 576437
Assignee | ||
Comment 20•14 years ago
|
||
Also fixed missed review comment.
Attachment #475001 -
Attachment is obsolete: true
Attachment #475002 -
Attachment is obsolete: true
Attachment #476018 -
Flags: review?(karlt)
Attachment #475001 -
Flags: review?(roc)
Assignee | ||
Comment 21•14 years ago
|
||
Mobile/X11 can be a separate patch when dep is fixed.
Attachment #476019 -
Flags: review?(karlt)
Updated•14 years ago
|
Attachment #476018 -
Flags: review?(karlt) → review+
Updated•14 years ago
|
Attachment #476019 -
Flags: review?(karlt) → review+
Assignee | ||
Comment 22•14 years ago
|
||
Assignee | ||
Comment 23•14 years ago
|
||
Attachment #476337 -
Flags: review?(karlt)
Updated•14 years ago
|
Attachment #476337 -
Flags: review?(karlt) → review+
Comment 24•14 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/bb22acd87a02 http://hg.mozilla.org/mozilla-central/rev/266e981a31bd http://hg.mozilla.org/mozilla-central/rev/4746a5bf6662 http://hg.mozilla.org/mozilla-central/rev/abc747783d43
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
•