haikuwebkit/LayoutTests/fast/text/frequent-text.html

31 lines
769 B
HTML
Raw Permalink Normal View History

[Cocoa] REGRESSION(r269211): Text with emoji can trigger drawing corruption https://bugs.webkit.org/show_bug.cgi?id=218636 <rdar://problem/71066011> Reviewed by Simon Fraser. Source/WebCore: We have an optimization for frequently-painting layers that we will turn text drawing commands into display lists. r269211 added a bunch of context state introspection and recreation code to make sure that the state being recorded matches the state during playback. However, that code is incompatible with this cache idea, where the same DL might be played back into multiple places. The solution is to have two kinds of text display list drawing: 1. Deconstruct drawing commands into a series of commands. E.g. emoji will get deconstructed into DrawImage commands. This kind of drawing must do state introspection to make sure the emoji is drawn in the right place 2. Don't deconstruct the drawing commands; simply gather up the DrawGlyphs commands and record them directly. This doesn't do state introspection. GPU Process display lists use the first kind, while this text cache optimization uses the second kind. Test: fast/text/frequent-text.html * platform/graphics/FontCascade.cpp: (WebCore::FontCascade::displayListForTextRun const): * platform/graphics/displaylists/DisplayListDrawGlyphsRecorder.h: * platform/graphics/displaylists/DisplayListDrawGlyphsRecorderCoreText.cpp: (WebCore::DisplayList::DrawGlyphsRecorder::DrawGlyphsRecorder): (WebCore::DisplayList::DrawGlyphsRecorder::drawGlyphs): * platform/graphics/displaylists/DisplayListDrawGlyphsRecorderHarfBuzz.cpp: (WebCore::DisplayList::DrawGlyphsRecorder::DrawGlyphsRecorder): * platform/graphics/displaylists/DisplayListDrawGlyphsRecorderWin.cpp: (WebCore::DisplayList::DrawGlyphsRecorder::DrawGlyphsRecorder): * platform/graphics/displaylists/DisplayListRecorder.cpp: (WebCore::DisplayList::Recorder::Recorder): * platform/graphics/displaylists/DisplayListRecorder.h: LayoutTests: * fast/text/frequent-text-expected.html: Added. * fast/text/frequent-text.html: Added. Canonical link: https://commits.webkit.org/231297@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@269497 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-11-06 01:45:40 +00:00
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<div id="target">Hello 👋 <span id="inside"></span> World!</div>
<script>
if (window.testRunner)
testRunner.waitUntilDone();
window.requestAnimationFrame(function() {
let target = document.getElementById("target");
let inside = document.getElementById("inside");
if (window.internals) {
for (let i = 0; i < 200; ++i)
internals.incrementFrequentPaintCounter(target);
}
inside.textContext = "middle";
window.requestAnimationFrame(function() {
inside.textContext = "";
window.requestAnimationFrame(function() {
if (window.testRunner)
testRunner.notifyDone();
});
});
});
</script>
</body>
</html>