forked from firka/flutter
drawTextBlob should not be compatible with opacity inheritance (flutter/engine#40396)
drawTextBlob should not be compatible with opacity inheritance
This commit is contained in:
@@ -1124,7 +1124,12 @@ void DisplayListBuilder::drawTextBlob(const sk_sp<SkTextBlob> blob,
|
||||
SkScalar y) {
|
||||
Push<DrawTextBlobOp>(0, 1, blob, x, y);
|
||||
AccumulateOpBounds(blob->bounds().makeOffset(x, y), kDrawTextBlobFlags);
|
||||
CheckLayerOpacityCompatibility();
|
||||
// There is no way to query if the glyphs of a text blob overlap and
|
||||
// there are no current guarantees from either Skia or Impeller that
|
||||
// they will protect overlapping glyphs from the effects of overdraw
|
||||
// so we must make the conservative assessment that this DL layer is
|
||||
// not compatible with group opacity inheritance.
|
||||
UpdateLayerOpacityCompatibility(false);
|
||||
}
|
||||
void DisplayListBuilder::DrawTextBlob(const sk_sp<SkTextBlob>& blob,
|
||||
SkScalar x,
|
||||
|
||||
@@ -645,7 +645,7 @@ TEST(DisplayList, SingleOpsMightSupportGroupOpacityWithOrWithoutBlendMode) {
|
||||
static auto display_list = builder.Build();
|
||||
RUN_TESTS2(builder.drawDisplayList(display_list);, false);
|
||||
}
|
||||
RUN_TESTS(builder.drawTextBlob(TestBlob1, 0, 0););
|
||||
RUN_TESTS2(builder.drawTextBlob(TestBlob1, 0, 0);, false);
|
||||
RUN_TESTS2(builder.drawShadow(kTestPath1, SK_ColorBLACK, 1.0, false, 1.0);
|
||||
, false);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user