Closed Bug 1592822 Opened 5 years ago Closed 5 years ago

Use serde to serialize more types whose animations could run on the compositor (for IPC layers)

Categories

(Core :: CSS Transitions and Animations, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla74
Tracking Status
firefox74 --- fixed

People

(Reporter: boris, Assigned: boris)

References

(Regressed 1 open bug)

Details

Attachments

(6 files)

This is a follow from D50688.
We can do something like these in this bug:

  1. Maybe mozilla::ipc::ByteBuf could be used from bindgen instead of having StyleVecU8.
  2. Followup for TransformOperation and friends.
Summary: Use serde to serialize more types whose animations could run on the compositor → Use serde to serialize more types whose animations could run on the compositor (for IPC layers)
Assignee: nobody → boris.chiou

The only drawback is: we resolve LengthPercentage value before passing
translate property through IPC, so its percentage part is redundant.
However, this makes us easier to maintain the Rust type.

Though this may make us use more space when serializing
nsTArray<StyleTransofrmOperaion>, but we don't have to do extra
conversion on the compostior side, and this makes us easier to maintain
the Rust type.

Still need to work on motion path properties.

Attachment #9121118 - Attachment description: Bug 1592822 - Use Serde for TransformOperation. → Bug 1592822 - Use Serde for Transform.

We generate ByteBuf by rust bindgen, so we can drop StyleVecU8.
One potential follow-up is that we can merge this together with WrVecU8.

Pushed by bchiou@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9ce641556acc Use macro for the implementation of ParamTraits<> on types which support Serde. r=emilio https://hg.mozilla.org/integration/autoland/rev/99be49183325 Use Serde for rotate, scale, and translate properties. r=emilio https://hg.mozilla.org/integration/autoland/rev/d80e0e3f5b87 Use Serde for Transform. r=emilio https://hg.mozilla.org/integration/autoland/rev/43870cc90433 Use Serde for SVGOffsetPath. r=emilio https://hg.mozilla.org/integration/autoland/rev/9890bad86a0e Use Serde for OffsetRotate and PositionOrAuto. r=emilio https://hg.mozilla.org/integration/autoland/rev/90d0f2ebd310 Replace StyleVecU8 with ipc::ByteBuf. r=emilio

Backed out 6 changesets (Bug 1592822) for bustages complaining about layout/painting/nsDisplayList.cpp

Push with failures: https://treeherder.mozilla.org/#/jobs?repo=autoland&fromchange=90d0f2ebd310a25954914c023e5053051f74c6c0&tochange=7b43c9ba246afdd5f5143f2d10da932020327053&selectedJob=285999889

Backout link: https://hg.mozilla.org/integration/autoland/rev/0a9c9b7bf2deb33e2bcfffeec4f8295d08c11211

Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=285999889&repo=autoland&lineNumber=41263

[task 2020-01-22T19:07:33.230Z] 19:07:33 INFO - make[4]: Entering directory '/builds/worker/workspace/build/src/obj-firefox/layout/painting'
[task 2020-01-22T19:07:33.235Z] 19:07:33 INFO - /builds/worker/fetches/clang/bin/clang++ -std=gnu++17 -o Unified_cpp_layout_painting0.o -c -I/builds/worker/workspace/build/src/obj-firefox/dist/stl_wrappers -I/builds/worker/workspace/build/src/obj-firefox/dist/system_wrappers -include /builds/worker/workspace/build/src/config/gcc_hidden.h -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -DNDEBUG=1 -DTRIMMED=1 -DOS_POSIX=1 -DOS_LINUX=1 -DSTATIC_EXPORTABLE_JS_API -DMOZ_HAS_MOZGLUE -DMOZILLA_INTERNAL_API -DIMPL_LIBXUL -I/builds/worker/workspace/build/src/layout/painting -I/builds/worker/workspace/build/src/obj-firefox/layout/painting -I/builds/worker/workspace/build/src/obj-firefox/ipc/ipdl/_ipdlheaders -I/builds/worker/workspace/build/src/ipc/chromium/src -I/builds/worker/workspace/build/src/ipc/glue -I/builds/worker/workspace/build/src/docshell/base -I/builds/worker/workspace/build/src/dom/base -I/builds/worker/workspace/build/src/gfx/2d -I/builds/worker/workspace/build/src/layout/base -I/builds/worker/workspace/build/src/layout/generic -I/builds/worker/workspace/build/src/layout/style -I/builds/worker/workspace/build/src/layout/svg -I/builds/worker/workspace/build/src/layout/tables -I/builds/worker/workspace/build/src/layout/xul -I/builds/worker/workspace/build/src/gfx/skia -I/builds/worker/workspace/build/src/gfx/skia/skia -I/builds/worker/workspace/build/src/obj-firefox/dist/include -I/builds/worker/workspace/build/src/obj-firefox/dist/include/nspr -I/builds/worker/workspace/build/src/obj-firefox/dist/include/nss -fPIC -DMOZILLA_CLIENT -include /builds/worker/workspace/build/src/obj-firefox/mozilla-config.h -Qunused-arguments -Qunused-arguments -Wall -Wbitfield-enum-conversion -Wempty-body -Wignored-qualifiers -Woverloaded-virtual -Wpointer-arith -Wshadow-field-in-constructor-modified -Wsign-compare -Wtype-limits -Wunreachable-code -Wunreachable-code-return -Wwrite-strings -Wno-invalid-offsetof -Wclass-varargs -Wfloat-overflow-conversion -Wfloat-zero-conversion -Wloop-analysis -Wcomma -Wimplicit-fallthrough -Werror=non-literal-null-conversion -Wstring-conversion -Wtautological-overlap-compare -Wno-inline-new-delete -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=backend-plugin -Wformat -Wformat-security -Wno-gnu-zero-variadic-macro-arguments -Wno-unknown-warning-option -Wno-return-type-c-linkage -D_GLIBCXX_USE_CXX11_ABI=0 -fno-sized-deallocation -fno-aligned-new -fno-exceptions -fno-strict-aliasing -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -fno-math-errno -pthread -pipe -g -O2 -fno-omit-frame-pointer -funwind-tables -Werror -I/builds/worker/workspace/build/src/obj-firefox/dist/include/cairo -Wno-error=shadow -MD -MP -MF .deps/Unified_cpp_layout_painting0.o.pp Unified_cpp_layout_painting0.cpp
[task 2020-01-22T19:07:33.236Z] 19:07:33 INFO - In file included from Unified_cpp_layout_painting0.cpp:128:
[task 2020-01-22T19:07:33.237Z] 19:07:33 ERROR - /builds/worker/workspace/build/src/layout/painting/nsDisplayList.cpp:308:35: error: no viable constructor or deduction guide for deduction of template arguments of 'StyleOwnedSlice'
[task 2020-01-22T19:07:33.238Z] 19:07:33 INFO - auto transform = StyleTransform{StyleOwnedSlice(std::move(result))};
[task 2020-01-22T19:07:33.239Z] 19:07:33 INFO - ^
[task 2020-01-22T19:07:33.240Z] 19:07:33 INFO - /builds/worker/workspace/build/src/obj-firefox/dist/include/mozilla/ServoStyleConsts.h:2515:10: note: candidate template ignored: could not match 'StyleOwnedSlice' against 'Vector'
[task 2020-01-22T19:07:33.240Z] 19:07:33 INFO - inline StyleOwnedSlice(const StyleOwnedSlice&);
[task 2020-01-22T19:07:33.241Z] 19:07:33 INFO - ^
[task 2020-01-22T19:07:33.242Z] 19:07:33 INFO - /builds/worker/workspace/build/src/obj-firefox/dist/include/mozilla/ServoStyleConsts.h:2516:10: note: candidate template ignored: could not match 'StyleOwnedSlice' against 'Vector'
[task 2020-01-22T19:07:33.243Z] 19:07:33 INFO - inline StyleOwnedSlice(StyleOwnedSlice&&);
[task 2020-01-22T19:07:33.244Z] 19:07:33 INFO - ^
[task 2020-01-22T19:07:33.245Z] 19:07:33 INFO - /builds/worker/workspace/build/src/obj-firefox/dist/include/mozilla/ServoStyleConsts.h:2517:19: note: candidate template ignored: substitution failure [with T = mozilla::StyleGenericTransformOperation<mozilla::StyleAngle, float, mozilla::StyleCSSPixelLength, int, mozilla::StyleLengthPercentageUnion>]
[task 2020-01-22T19:07:33.245Z] 19:07:33 INFO - inline explicit StyleOwnedSlice(Vector<T>&&);
[task 2020-01-22T19:07:33.246Z] 19:07:33 INFO - ^
[task 2020-01-22T19:07:33.247Z] 19:07:33 INFO - /builds/worker/workspace/build/src/obj-firefox/dist/include/mozilla/ServoStyleConsts.h:2504:3: note: candidate function template not viable: requires 0 arguments, but 1 was provided
[task 2020-01-22T19:07:33.248Z] 19:07:33 INFO - StyleOwnedSlice() :
[task 2020-01-22T19:07:33.249Z] 19:07:33 INFO - ^
[task 2020-01-22T19:07:33.250Z] 19:07:33 INFO - 1 error generated.
[task 2020-01-22T19:07:33.251Z] 19:07:33 INFO - /builds/worker/workspace/build/src/config/rules.mk:744: recipe for target 'Unified_cpp_layout_painting0.o' failed
[task 2020-01-22T19:07:33.252Z] 19:07:33 ERROR - make[4]: *** [Unified_cpp_layout_painting0.o] Error 1
[task 2020-01-22T19:07:33.252Z] 19:07:33 INFO - make[4]: Leaving directory '/builds/worker/workspace/build/src/obj-firefox/layout/painting'
[task 2020-01-22T19:07:33.253Z] 19:07:33 INFO - make[4]: *** Waiting for unfinished jobs....
[task 2020-01-22T19:07:33.255Z] 19:07:33 INFO - make[4]: Entering directory '/builds/worker/workspace/build/src/obj-firefox/accessible/generic'
[task 2020-01-22T19:07:33.256Z] 19:07:33 INFO - mkdir -p '.deps/'
[task 2020-01-22T19:07:33.257Z] 19:07:33 INFO - make[4]: Leaving directory '/builds/worker/workspace/build/src/obj-firefox/accessible/generic'

Flags: needinfo?(boris.chiou)

Fixed build bustage on Bug 1592822 - Use Serde for Transform..

Flags: needinfo?(boris.chiou)
Pushed by bchiou@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/f3fff8e870b0 Use macro for the implementation of ParamTraits<> on types which support Serde. r=emilio https://hg.mozilla.org/integration/autoland/rev/e50eca558fc5 Use Serde for rotate, scale, and translate properties. r=emilio https://hg.mozilla.org/integration/autoland/rev/4d5948650668 Use Serde for Transform. r=emilio https://hg.mozilla.org/integration/autoland/rev/16bb4faec15e Use Serde for SVGOffsetPath. r=emilio https://hg.mozilla.org/integration/autoland/rev/f5294292d16c Use Serde for OffsetRotate and PositionOrAuto. r=emilio https://hg.mozilla.org/integration/autoland/rev/4fa736c9e13d Replace StyleVecU8 with ipc::ByteBuf. r=emilio
Regressions: 1663695
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: