parent
429d7d2944
commit
aaa8532a46
@ -0,0 +1,46 @@
|
||||
commit 4bdca157e7edfeb5b9c0ac77e3afbfe288f7f9cf
|
||||
Author: Stefan Zager <szager@chromium.org>
|
||||
Date: Mon Feb 26 02:36:37 2024 +0000
|
||||
|
||||
Make SameSizeAsShapeResult robust against uncommon gn args
|
||||
|
||||
When using uncommon build configurations, it's currently possible
|
||||
to fail this assert due to details of struct field packing:
|
||||
|
||||
ASSERT_SIZE(ShapeResult, SameSizeAsShapeResult);
|
||||
|
||||
In particular, `cppgc_enable_pointer_compression = false` in args.gn
|
||||
will trigger it.
|
||||
|
||||
This changes makes the struct layout of SameSizeAsShapeResult more
|
||||
closely match that of ShapeResult, which should make it harder to
|
||||
fail the assert.
|
||||
|
||||
Change-Id: I7406b0ac333303b6808807fa1eaf5cbecb85d858
|
||||
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5323558
|
||||
Auto-Submit: Stefan Zager <szager@chromium.org>
|
||||
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
|
||||
Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org>
|
||||
Cr-Commit-Position: refs/heads/main@{#1265024}
|
||||
|
||||
diff --git a/third_party/blink/renderer/platform/fonts/shaping/shape_result.cc b/third_party/blink/renderer/platform/fonts/shaping/shape_result.cc
|
||||
index 28aabc7d66cd8..a2bfdec2775e4 100644
|
||||
--- a/third_party/blink/renderer/platform/fonts/shaping/shape_result.cc
|
||||
+++ b/third_party/blink/renderer/platform/fonts/shaping/shape_result.cc
|
||||
@@ -78,10 +78,13 @@ struct SameSizeAsRunInfo {
|
||||
ASSERT_SIZE(ShapeResult::RunInfo, SameSizeAsRunInfo);
|
||||
|
||||
struct SameSizeAsShapeResult {
|
||||
- Vector<int> vectors[2];
|
||||
- UntracedMember<void*> members[2];
|
||||
float width;
|
||||
- unsigned integers[2];
|
||||
+ UntracedMember<void*> deprecated_ink_bounds_;
|
||||
+ Vector<int> runs_;
|
||||
+ Vector<int> character_position_;
|
||||
+ UntracedMember<void*> primary_font_;
|
||||
+ unsigned start_index_;
|
||||
+ unsigned num_characters_;
|
||||
unsigned bitfields : 32;
|
||||
};
|
||||
|
Loading…
Reference in new issue