Details
- Reviewers
mstange sotaro kvark - Commits
- rMOZILLACENTRALc81cf0c409bc: Bug 1604383 - Refactor the Compositor trait to allow support for DC virtual…
- Bugzilla Bug ID
- 1604383
Diff Detail
- Repository
- rMOZILLACENTRAL mozilla-central
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Event Timeline
WORK IN PROGRESS
This isn't complete yet - I haven't done the Mac implementation, and it still needs some tidy up / comments / commit splitting.
But, putting it up now in case anyone has early feedback / comments / questions.
Of note: This doesn't use the virtual surface DC APIs yet. The idea is to refactor the interface but maintain the existing DC API usage, and then land the virtual surface API usage as a follow up (which should be a small amount of work).
The synopsis is:
- The Compositor trait now exposes both the concept of surfaces and tiles.
- A surface maps 1:1 with a picture cache slice.
- Tiles exist within a given surface.
- A given surface has a constant tile size (the surface is re-created if the tile size changes).
- A tile is uniquely identified by (surface id, x, y) where (x, y) are the index of the tile on each axis (signed).
- The DC implementation is expanded to have DCSurface and DCTile (currently the old name DCLayer).
- A DC visual is created for each tile, and also one for each surface.
- Tile visuals are attached to the surface visual, and placed in a local space offset.
- Surface visuals are attached to the root. Clip rect and scroll position are applied to the surface visual.
Oh, I also tried to make the hashmaps in DCLayerTree a bit more type-safe, since there are now two levels of hashing (root -> surface -> tile).
Code analysis found 25 defects in the diff 208884:
- 25 defects found by clang-format
You can run this analysis locally with:
- ./mach clang-format -s -p gfx/webrender_bindings/RenderCompositor.h gfx/webrender_bindings/RenderCompositorANGLE.cpp gfx/webrender_bindings/RenderCompositor.cpp gfx/webrender_bindings/DCLayerTree.cpp gfx/webrender_bindings/RenderCompositorOGL.h gfx/webrender_bindings/RenderCompositorOGL.cpp gfx/webrender_bindings/RenderCompositorANGLE.h gfx/webrender_bindings/DCLayerTree.h (C/C++)
For your convenience, here is a patch that fixes all the source-test-clang-format defects (use it in your repository with hg import or git apply -p0).
If you see a problem in this automated review, please report it here.
In our previous code coverage analysis run, we found some files which had no coverage and are being modified in this patch:
- gfx/webrender_bindings/RenderCompositorOGL.cpp
- gfx/webrender_bindings/RenderCompositorANGLE.cpp
- gfx/webrender_bindings/RenderCompositor.cpp
- gfx/webrender_bindings/DCLayerTree.cpp
Should they have tests, or are they dead code ?
- You can file a bug blocking Bug 1415824 for untested files that should be tested.
- You can file a bug blocking Bug 1415819 for untested files that should be removed.
If you see a problem in this automated review, please report it here.
Rebased, ran clang-format, and added a simple Mac implementation that retains the existing behavior.
The C++ bits are a bit rough, but this should be ready for an initial review now, I think!
I can try to split this up into separate commits, if that would simplify things - although it's not obvious that I can do that without each individual commit being broken, which probably isn't ideal?
Code analysis found 2 defects in the diff 208888:
- 2 defects found by clang-tidy
You can run this analysis locally with:
- ./mach static-analysis check gfx/webrender_bindings/RenderCompositorOGL.cpp gfx/webrender_bindings/RenderCompositorOGL.h (C/C++)
If you see a problem in this automated review, please report it here.
| gfx/webrender_bindings/RenderCompositorOGL.cpp | ||
|---|---|---|
| 180 | Warning: Use range-based for loop instead [clang-tidy: modernize-loop-convert] | |
| gfx/webrender_bindings/RenderCompositorOGL.h | ||
| 87 | Warning: Bad implicit conversion constructor for 'Surface' [clang-tidy: mozilla-implicit-constructor] | |
In our previous code coverage analysis run, we found some files which had no coverage and are being modified in this patch:
- gfx/webrender_bindings/RenderCompositorOGL.cpp
- gfx/webrender_bindings/RenderCompositorANGLE.cpp
- gfx/webrender_bindings/RenderCompositor.cpp
- gfx/webrender_bindings/DCLayerTree.cpp
Should they have tests, or are they dead code ?
- You can file a bug blocking Bug 1415824 for untested files that should be tested.
- You can file a bug blocking Bug 1415819 for untested files that should be removed.
If you see a problem in this automated review, please report it here.
The patch worked well on windows and looks good.
| gfx/wr/example-compositor/compositor-windows/src/lib.cpp | ||
|---|---|---|
| 59 | Is there a reason why hash function is different from DCLayerTree.h and RenderCompositorOGL.h? | |
Code analysis found 1 defect in the diff 209266:
- 1 defect found by clang-tidy
You can run this analysis locally with:
- ./mach static-analysis check gfx/webrender_bindings/RenderCompositorOGL.cpp (C/C++)
If you see a problem in this automated review, please report it here.
| gfx/webrender_bindings/RenderCompositorOGL.cpp | ||
|---|---|---|
| 180 | Warning: Use range-based for loop instead [clang-tidy: modernize-loop-convert] | |
In our previous code coverage analysis run, we found some files which had no coverage and are being modified in this patch:
- gfx/webrender_bindings/RenderCompositorOGL.cpp
- gfx/webrender_bindings/RenderCompositorANGLE.cpp
- gfx/webrender_bindings/RenderCompositor.cpp
- gfx/webrender_bindings/DCLayerTree.cpp
Should they have tests, or are they dead code ?
- You can file a bug blocking Bug 1415824 for untested files that should be tested.
- You can file a bug blocking Bug 1415819 for untested files that should be removed.
If you see a problem in this automated review, please report it here.
I like the OpenGL implementation that you chose. I didn't look at the rust code.
| gfx/webrender_bindings/RenderCompositor.h | ||
|---|---|---|
| 94–96 | Mozilla style usually avoids plain int and uses int32_t instead. | |
| gfx/webrender_bindings/RenderCompositorOGL.cpp | ||
| 179 | typo: layout -> layer | |
| 180 | Yeah, please change this to for (const auto& it : mSurfaces). | |
| gfx/webrender_bindings/RenderCompositorOGL.h | ||
| 79–81 | Might as well do return HashGeneric(aId.mX, aID.mY); for shorter code. | |
Code analysis found 3 defects in the diff 209304:
- 3 defects found by clang-format
You can run this analysis locally with:
- ./mach clang-format -s -p gfx/webrender_bindings/RenderCompositor.h gfx/webrender_bindings/DCLayerTree.h (C/C++)
For your convenience, here is a patch that fixes all the source-test-clang-format defects (use it in your repository with hg import or git apply -p0).
If you see a problem in this automated review, please report it here.
In our previous code coverage analysis run, we found some files which had no coverage and are being modified in this patch:
- gfx/webrender_bindings/RenderCompositorOGL.cpp
- gfx/webrender_bindings/RenderCompositorANGLE.cpp
- gfx/webrender_bindings/RenderCompositor.cpp
- gfx/webrender_bindings/DCLayerTree.cpp
Should they have tests, or are they dead code ?
- You can file a bug blocking Bug 1415824 for untested files that should be tested.
- You can file a bug blocking Bug 1415819 for untested files that should be removed.
If you see a problem in this automated review, please report it here.
In our previous code coverage analysis run, we found some files which had no coverage and are being modified in this patch:
- gfx/webrender_bindings/RenderCompositorOGL.cpp
- gfx/webrender_bindings/RenderCompositorANGLE.cpp
- gfx/webrender_bindings/RenderCompositor.cpp
- gfx/webrender_bindings/DCLayerTree.cpp
Should they have tests, or are they dead code ?
- You can file a bug blocking Bug 1415824 for untested files that should be tested.
- You can file a bug blocking Bug 1415819 for untested files that should be removed.
If you see a problem in this automated review, please report it here.