author Alexis Beingessner <a.beingessner@gmail.com>
Mon, 19 Jun 2017 10:58:28 -0400
changeset 424982 564959d26e8db243ded3d57380842620e60e89e7
parent 424950 2619edc827ada43379ff483c26271284cfdd199a
child 433978 cf5ecd16d87ed1afb96e4956d06fa2b50f260bea
permissions -rw-r--r--
Bug 1357545 - handle text-shadows/decorations with webrender (layers-free) r=jrmuizel This replaces our DrawTargetCapture hack with a similar but more powerful TextDrawTarget hack. The old design had several limitations: * It couldn't handle shadows * It couldn't handle selections * It couldn't handle font/color changes in a single text-run * It couldn't handle decorations (underline, overline, line-through) Mostly this was a consequence of the fact that it only modified the start and end of the rendering algorithm, and therefore couldn't distinguish draw calls for different parts of the text. This new design is based on a similar principle as DrawTargetCapture, but also passes down the TextDrawTarget in the drawing arguments, so that the drawing algorithm can notify us of changes in phase (e.g. "now we're doing underlines"). This also lets us directly pass data to TextDrawTarget when possible (as is done for shadows and selections). In doing this, I also improved the logic copied from ContainsOnlyColoredGlyphs to handle changes in font/color mid-text-run (which can happen because of font fallback). The end result is: * We handle all shadows natively * We handle all selections natively * We handle all decorations natively * We handle font/color changes in a single text-run * Although we still hackily intercept draw calls * But we don't need to buffer commands, reducing total memcopies In addition, this change integrates webrender's PushTextShadow and PushLine APIs, which were designed for this use case. This is only done in the layerless path; WebrenderTextLayer continues to be semantically limited, as we aren't actively maintaining non-layers-free webrender anymore. This also doesn't modify TextLayers, to minimize churn. In theory they can be augmented to support the richer semantics that TextDrawTarget has, but there's little motivation since the API is largely unused with this change. MozReview-Commit-ID: 4IjTsSW335h

# .hgignore - List of filenames hg should ignore

# Filenames that should be ignored wherever they appear

# Vim swap files.

# Emacs directory variable files.

# User files that may appear at the root

# Empty marker file that's generated when we check out NSS

# Build directories

# gecko.log is generated by various test harnesses

# Build directories for js shell

# SpiderMonkey configury
# SpiderMonkey test result logs
# SpiderMonkey clone of the webassembly spec repository

# Java HTML5 parser classes

# SVN directories

# Ignore the files and directory that Eclipse IDE creates

# Ignore the files and directory that JetBrains IDEs create.
# Android Monitor in Android Studio creates a captures/ directory.

# Gradle cache.

# Local Gradle configuration properties.

# Python stuff installed at build time.

# Git repositories

# Ignore chrome.manifest files from the devtools loader

# Ignore node_modules directories in devtools

# git checkout of libstagefright

# Tag files generated by GNU Global

# Git clone directory for updating web-platform-tests

# Third party metadata for web-platform-tests

# Android Gradle artifacts.

# XCode project cruft

# Ignore mozharness execution files

# Ignore tox generated dir

# Ignore ESLint node_modules

# Ignore talos virtualenv and tp5n files.
# The tp5n set is supposed to be decompressed at
# testing/talos/talos/tests/tp5n in order to run tests like tps
# locally. Similarly, running talos requires a Python package virtual
# environment. Both the virtual environment and tp5n files end up littering
# the status command, so we ignore them.

# Ignore files created when running a reftest.

# tup database

# Ignore Visual Studio Code workspace files.


# Ignore Infer output