Closed
Bug 919936
Opened 11 years ago
Closed 8 years ago
Add texture client/host tests for serialization and deserialization
Categories
(Core :: Graphics: Layers, defect)
Core
Graphics: Layers
Tracking
()
RESOLVED
FIXED
People
(Reporter: nical, Assigned: nical)
References
(Blocks 1 open bug)
Details
Attachments
(3 files, 2 obsolete files)
5.25 KB,
patch
|
BenWa
:
review+
|
Details | Diff | Splinter Review |
8.60 KB,
patch
|
BenWa
:
review+
|
Details | Diff | Splinter Review |
10.83 KB,
patch
|
BenWa
:
review+
|
Details | Diff | Splinter Review |
Let's add some automated testing for all the serialization/deserialization logic.
Assignee | ||
Comment 1•11 years ago
|
||
Tests allocating - serializing - deserializing a MemoryTextureClient with several image formats. The same test could be run on other texture client types but I need to figure out how to allocate shared memory without all the IPDL stuff.
Attachment #809069 -
Flags: review?(bgirard)
Assignee | ||
Updated•11 years ago
|
Whiteboard: [leave open]
Comment 2•11 years ago
|
||
Comment on attachment 809069 [details] [diff] [review] A bit of MemoryTextureClient serialization gtest love Review of attachment 809069 [details] [diff] [review]: ----------------------------------------------------------------- Nice! ::: gfx/tests/gtest/TestTextures.cpp @@ +1,1 @@ > +#include "gtest/gtest.h" License public domain. See TestLayers.cpp @@ +120,5 @@ > + gfxASurface::ImageFormatRGB24, > + gfxASurface::ImageFormatA8, > + }; > + > + for (int f = 0; f<3; ++f) { style f < 3 @@ +121,5 @@ > + gfxASurface::ImageFormatA8, > + }; > + > + for (int f = 0; f<3; ++f) { > + RefPtr<gfxImageSurface> surface = new gfxImageSurface(gfxIntSize(800,600), formats[f]); Do we need to test for such a large size? You filling and reading each pixels. We should get the same coverage by testing a much smaller surface.
Attachment #809069 -
Flags: review?(bgirard) → review+
Assignee | ||
Comment 3•11 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/ab5af752fa81
Assignee | ||
Comment 4•11 years ago
|
||
build busted, backed out: https://hg.mozilla.org/integration/mozilla-inbound/rev/c1f06e0edcf5
Assignee | ||
Comment 5•11 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/e56e8fbacb7c
Assignee | ||
Comment 6•11 years ago
|
||
Adding the same test for YCbCr surfaces is relatively straightforward, except that right now textureHost::GetAsSurface() will return a surface containing only the Y plane. GetAsSurface() is only intended for debugging puposes (and now it is also used by the gtest stuff), should I fix it to return an actual RGB surface with YUV->RGB convertion, or should I just consider that testing the equality between the client and host Y planes is sufficient? Otherwise I can also add a bit of API in TextureHost to retrieve the data in the PlanarYCbCrImage::Data form (which would only ever be used by gtests). It would be a bit ugly because TextureHost doesn't any expose any YCbCr-specific API.
Comment 7•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/e56e8fbacb7c
Flags: in-testsuite+
Assignee | ||
Comment 8•11 years ago
|
||
Attachment #812854 -
Flags: review?(bgirard)
Assignee | ||
Comment 9•11 years ago
|
||
I have some more gtest stuff coming which reuses some of the helpers so let's move them to their own file.
Attachment #812858 -
Flags: review?(bgirard)
Comment 10•11 years ago
|
||
Comment on attachment 812854 [details] [diff] [review] Same thing for YCbCr surfaces Review of attachment 812854 [details] [diff] [review]: ----------------------------------------------------------------- I'm ok with the test but would like to avoid shipping test code. Tentative r- unless you can convince me this is ok/worth it. ::: gfx/layers/composite/TextureHost.cpp @@ +456,5 @@ > return true; > } > > +bool > +BufferTextureHost::GetYCbCrData(PlanarYCbCrData& aData) Do you plan on using this method later on in release code? Otherwise maybe you can put this code in TestTexture.cpp in a new class and make it a friend. If that's not possible we can put everything under #ifdef DEBUG and have the test only run in debug builds. ::: gfx/layers/composite/TextureHost.h @@ +452,5 @@ > virtual gfx::IntSize GetSize() const MOZ_OVERRIDE { return mSize; } > > virtual already_AddRefed<gfxImageSurface> GetAsSurface() MOZ_OVERRIDE; > > + virtual bool GetYCbCrData(PlanarYCbCrData& aOutData) MOZ_OVERRIDE; Also this adds a vtable entry.
Attachment #812854 -
Flags: review?(bgirard) → review-
Comment 11•11 years ago
|
||
Comment on attachment 812858 [details] [diff] [review] Regroup some common gtest texture helper functions Review of attachment 812858 [details] [diff] [review]: ----------------------------------------------------------------- You forgot to hg add LayersTestUtils.h
Attachment #812858 -
Flags: review?(bgirard) → review-
Assignee | ||
Comment 12•11 years ago
|
||
Attachment #812854 -
Attachment is obsolete: true
Attachment #815012 -
Flags: review?(bgirard)
Assignee | ||
Comment 13•11 years ago
|
||
Attachment #812858 -
Attachment is obsolete: true
Attachment #815014 -
Flags: review?(bgirard)
Comment 14•11 years ago
|
||
Comment on attachment 815012 [details] [diff] [review] Same thing for YCbCr surfaces (v2) Review of attachment 815012 [details] [diff] [review]: ----------------------------------------------------------------- ::: gfx/layers/composite/TextureHost.cpp @@ +17,5 @@ > #include "mozilla/layers/YCbCrImageDataSerializer.h" > #include "nsAString.h" > #include "nsAutoPtr.h" // for nsRefPtr > #include "nsPrintfCString.h" // for nsPrintfCString > +#include "ImageContainer.h" Shouldn't be required here. ::: gfx/layers/composite/TextureHost.h @@ +47,5 @@ > class TextureSourceD3D11; > class TextureSourceBasic; > class TextureParent; > class DataTextureSource; > +class PlanarYCbCrData; Shouldn't be required here.
Attachment #815012 -
Flags: review?(bgirard) → review+
Comment 15•11 years ago
|
||
Comment on attachment 815014 [details] [diff] [review] Regroup some common gtest texture helper functions (v2) Review of attachment 815014 [details] [diff] [review]: ----------------------------------------------------------------- ::: gfx/tests/gtest/LayerTestUtils.h @@ +22,5 @@ > +class Compositor; > + > +Compositor* CreateCompositor(LayersBackend aBakend, nsIWidget* aWidget); > + > +/// fills the surface with values betwee 0 and 100. between* here and bellow
Attachment #815014 -
Flags: review?(bgirard) → review+
Assignee | ||
Comment 16•11 years ago
|
||
fixed Ben's last comments and landed: https://hg.mozilla.org/integration/mozilla-inbound/rev/8ce7c4424b8a https://hg.mozilla.org/integration/mozilla-inbound/rev/2f879cfc861f
And backed out for breaking Windows builds: https://hg.mozilla.org/integration/mozilla-inbound/rev/257a97e05777
Assignee | ||
Comment 18•11 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/048984fc3cd1
Assignee | ||
Comment 20•8 years ago
|
||
No activity here for a long while and I don't plan to work on this so let's consider the stuff that's already landed is enough.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Whiteboard: [leave open]
You need to log in
before you can comment on or make changes to this bug.
Description
•