This repository was archived by the owner on Feb 25, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6k
[Impeller] Don't define CanvasRecorder if IMPELLER_TRACE_CANVAS is not set.
#46476
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gaaclarke
approved these changes
Oct 3, 2023
Member
gaaclarke
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh wild, I didn't expect to see such a difference in compilers. Nice find. I was trying to keep the ifdef compact but this will work, lgtm.
CanvasRecorder if IMPELLER_TRACE_CANVAS is not setCanvasRecorder if IMPELLER_TRACE_CANVAS is not set.
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Oct 4, 2023
…_CANVAS` is not set. (flutter/engine#46476)
auto-submit bot
pushed a commit
to flutter/flutter
that referenced
this pull request
Oct 4, 2023
…135945) flutter/engine@2fda861...857f800 2023-10-04 [email protected] [Impeller] Don't define `CanvasRecorder` if `IMPELLER_TRACE_CANVAS` is not set. (flutter/engine#46476) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Mairramer
pushed a commit
to Mairramer/flutter
that referenced
this pull request
Oct 10, 2023
…lutter#135945) flutter/engine@2fda861...857f800 2023-10-04 [email protected] [Impeller] Don't define `CanvasRecorder` if `IMPELLER_TRACE_CANVAS` is not set. (flutter/engine#46476) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
harryterkelsen
pushed a commit
that referenced
this pull request
Oct 23, 2023
…s not set. (#46476) Internal bug: b/303067268 #46376 is causing a breakage to the internal engine build because of https://github.com/flutter/engine/blob/150d1b6ab51f34c07e21fc32ef76e4842edd4d04/impeller/aiks/canvas_recorder.h#L58-L62. Internally, we do not set `IMPELLER_TRACE_CANVAS`. It looks like the cause is that the internal toolchain causes the `static_assert` to be compiled even though the template is not instantiated. @chingjun helped me to figure out the following: https://stackoverflow.com/questions/5246049/c11-static-assert-and-template-instantiation points us to the spec. In the later version (ISO/IEC 14882:2017(E)): > The program is ill-formed, no diagnostic required, if ... no valid specialization can be generated for a template or a substatement of a constexpr if statement (9.4.1) within a template and the template is not instantiated, <details> <summary>The relevant section</summary>  </details> Interpretation: the compiler can either choose to emit the error caused by the `static_assert` or not. Currently the compiler used by the build here on LUCI does not; internally it does. For example, the following links shows that simply changing the Clang version affects whether the error appears or not for a minimal template. - ok: https://godbolt.org/z/n9nYrcvcP - not ok: https://godbolt.org/z/fWcvdcn35 Hence, `#ifdef` out the class instead of using a `static_assert` for more consistent behavior across these two toolchains. [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Internal bug: b/303067268
#46376 is causing a breakage to the internal engine build because of
engine/impeller/aiks/canvas_recorder.h
Lines 58 to 62 in 150d1b6
IMPELLER_TRACE_CANVAS.It looks like the cause is that the internal toolchain causes the
static_assertto be compiled even though the template is not instantiated.@chingjun helped me to figure out the following:
https://stackoverflow.com/questions/5246049/c11-static-assert-and-template-instantiation points us to the spec. In the later version (ISO/IEC 14882:2017(E)):
The relevant section
Interpretation: the compiler can either choose to emit the error caused by the
static_assertor not. Currently the compiler used by the build here on LUCI does not; internally it does.For example, the following links shows that simply changing the Clang version affects whether the error appears or not for a minimal template.
Hence,
#ifdefout the class instead of using astatic_assertfor more consistent behavior across these two toolchains.Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.