0
Files
src/cc
Joel Hockey 88bc06cfca Revert "Roll src/buildtools/third_party/libc++/trunk/ 8fa879467..79a2e924d (426 commits)"
This reverts commit 6db04c43bc.

Reason for revert: breaks chromeos-chrome builds crbug.com/1222564

Original change's description:
> Roll src/buildtools/third_party/libc++/trunk/ 8fa879467..79a2e924d (426 commits)
>
> 8fa8794677..79a2e924d9
>
> Main changes in this patch:
> -Adds a __config_site file that contains some libc++ macros.
> -Links libcpmt.lib/msvcprt.lib (C++ std library headers on windows) to
> the link, which provide exception_ptr definitions. Previously,
> a file was including a windows header that would link these
> headers, but that header is no longer being included.
>
>
> $ git log 8fa879467..79a2e924d --date=short --no-merges --format='%ad %ae %s'
> 2021-05-25 ldionne.2 [libc++] Try to fix the oss-fuzz failure
> 2021-05-25 arthur.j.odwyer [libc++] [test] Make iter_difference_t.pass.cpp into a .compile.pass.cpp. NFCI.
> 2021-05-25 arthur.j.odwyer [libc++] [test] Format some C++20 iterator_traits tests. NFCI.
> 2021-05-19 arthur.j.odwyer [libc++] Assume that __wrap_iter always wraps a fancy pointer.
> 2021-05-24 koraq [libc++][doc] Update format paper status.
> 2021-05-23 joerg [libc++] use more early returns for consistency
> 2021-05-21 z.zoelec2 [libcxx][gardening] Re-order includes across libcxx.
> 2021-04-23 z.zoelec2 [libcxx][ranges] Add ranges::data CPO.
> 2021-05-08 ldionne.2 [libc++] Translate the test suite sanitizer support to the DSL
> 2021-05-13 z.zoelec2 [libcxx][ranges] Implement `ranges::borrowed_range`.
> 2021-05-20 ldionne.2 [libc++] Fix documentation build failure
> 2021-05-08 ldionne.2 [libc++] Remove workaround for PR28391 (ODR violations with ASAN)
> 2021-02-26 ldionne.2 [libc++] Switch a few CI jobs to the minimal Lit configuration
> 2021-05-13 cjdb [libcxx][ranges] adds concept `sized_range` and cleans up `ranges::size`
> 2021-05-04 cjdb [libcxx][iterator][nfc] acquires lock for working on [range.iter.ops]
> 2021-03-15 akhuang Apply [[standalone_debug]] to some types in the STL.
> 2021-05-12 arthur.j.odwyer [libc++] Alphabetize header inclusions and include-what-you-use <__debug>. NFCI.
> 2021-05-12 arthur.j.odwyer [libc++] Some fixes to the <bit> utilities.
> 2021-04-18 kbessonova [libcxx][test] Attempt to make debug mode tests more bulletproof
> 2021-05-15 kbessonova [libcxx] NFC. Add missed articles to _LIPCPP_ASSERT messages in <list>
> 2021-04-27 z.zoelec2 [libcxx][ranges] Add `contiguous_iterator`.
> 2021-05-13 koraq [libc++] Improve make_string test support.
> 2021-03-11 martin [libcxx] [test] Change the generic_string_alloc test to test conversions to all char types
> 2021-05-13 z.zoelec2 [libcxx][docs] Add two locks: transform_view and take_view.
> 2021-05-13 z.zoelec2 [libcxx][docs] Update the One Ranges PRoposal Status with open revisions.
> 2021-05-11 z.zoelec2 [libcxx][ranges] Fix `ranges::empty` when begin, end, and empty members are provided.
> 2021-05-12 kbessonova [libcxx] NFC. Fix misprint unodered -> unordered
> 2021-05-02 cjdb [libcxx] modifies `_CmpUnspecifiedParam` ignore types outside its domain
> 2021-05-03 martin [libcxx] [test] Fix fs.op.last_write_time for Windows
> 2021-05-12 koraq [libc++][nfc] remove duplicated __to_unsigned.
> 2021-05-09 kbessonova [libcxx] NFC. Correct wordings of _LIBCPP_ASSERT debug messages
> 2021-05-10 kbessonova [libcxx][test] Split more debug mode tests
> 2021-05-11 vvereschaka [libc++] Run `substitutes-in-compile-flags.sh.cpp` test on Windows.
> 2021-02-26 martin [libcxx] [test] Fix filesystem permission tests for windows
> 2021-05-11 z.zoelec2 [libcxx][tests] Fix incomplte.verify tests by disabling them on clang-10.
> 2021-05-10 arthur.j.odwyer [libc++] Remove more unnecessary _VSTD:: from type names. NFCI.
> 2021-05-10 arthur.j.odwyer [libc++] s/_VSTD::is_unsigned/is_unsigned/ in <random>. NFCI.
> 2021-05-10 arthur.j.odwyer [libc++] s/_VSTD::chrono/chrono/g. NFCI.
> 2021-05-10 arthur.j.odwyer [libc++] s/std::size_t/size_t/g. NFCI.
> 2021-05-10 arthur.j.odwyer [libc++] s/_VSTD::declval/declval/g. NFCI.
> 2021-05-10 kbessonova [libcxx][test] Make string.modifiers/clear_and_shrink_db1.pass.cpp a regular mode test
> 2021-05-02 cjdb [libcxx] deprecates/removes `std::raw_storage_iterator`
> 2021-05-01 cjdb [libcxx] makes comparison operators for `std::*_ordering` types hidden friends
> 2021-04-12 cjdb [libcxx] removes operator!= and globally guards against no spaceship operator
> 2021-04-23 z.zoelec2 [libcxx][ranges] Add ranges::empty CPO.
> 2021-04-12 cjdb [libcxx] removes `weak_equality` and `strong_equality` from <compare>
> 2021-05-09 koraq [libc++][NFC] Remove _VSTD:: when not needed.
> 2021-05-10 jasonliu.development [libc++][AIX] Define _LIBCPP_ELAST
> 2021-05-09 koraq [libc++][doc] Update the Format library status.
> 2021-05-08 ldionne.2 [libc++] NFC: Refactor Lit annotations
> (...)
> 2021-02-24 martin [libcxx] [test] Quote the path to the python interpreter
> 2021-02-24 ldionne.2 [libc++] NFC: Fix a few tests in tuple that would succeed trivially
> 2021-02-24 ldionne.2 [libc++] NFC: Fix a few tests in pair that would succeed trivially
> 2020-10-22 martin [libcxx] [test] Don't pass INCLUDE to clang via -isystem
> 2021-02-24 marek.kurdej [libc++] [docs] [C++2b] Update status page with papers adopted in February 2021 virtual meeting.
> 2020-11-02 martin [libcxx] [test] Define _CRT_STDIO_ISO_WIDE_SPECIFIERS while building tests
> 2021-02-22 koraq [NFC][libc++] Fix _LIBCPP_HAS_BITSCAN64 usage.
> 2018-07-31 ldionne [libc++] Fix tuple assignment from types derived from a tuple-like
> 2021-02-20 martin [libcxx] [test] Call create_directory_symlink when linking directories
> 2020-11-06 martin [libcxx] Make path::format a non-class enum
> 2021-02-20 koraq [libc++] Fix the build for AppleClang.
> 2021-02-19 martin [libcxx] [test] Remove two unnecesary files/variables in a test
> 2021-01-09 martin [libcxx] Rename a method in PathParser for clarity. NFC.
> 2021-02-20 koraq [libc++] Fixes _LIBCPP_HAS_NO_CONCEPTS
> 2021-02-19 z.zoelec2 [libc++][nfc] Only test if pair is_assignable after C++03.
> 2020-11-05 martin [libcxx] Enable filesystem by default for mingw targets
> 2021-02-19 z.zoelec2 [libc++][nfc] SFINAE on pair/tuple assignment operators: LWG 2729.
> 2020-11-09 martin [libcxx] Make generic_*string return paths with forward slashes on windows
> 2021-02-19 z.zoelec2 [libcxx] Fix LWG 2875: shared_ptr::shared_ptr(Y*, D, […]) constructors should be constrained.
> 2020-11-05 martin [libcxx] Have lexically_normal return the path with preferred separators
> 2021-02-19 marek.kurdej [libc++] Turn off clang-format for auto-generated version header. NFC.
> 2021-02-18 z.zoelec2 [libc++] shared_ptr deleter requirements (LWG 2802).
> 2021-02-18 z.zoelec2 Mark 2534 as Complete.
> 2021-02-17 cjdb.ns [libcxx] adds concept `std::uniform_random_bit_generator`
> 2021-02-17 joerg libcxx: use early returns
> 2021-02-18 thakis libcxx: fix a documentation typo
> 2021-02-18 zibi [SystemZ][ZOS] Guard using declaration for ::fchmodat
> 2020-11-04 martin [libcxx] Implement append and operator/ properly for windows
> 2020-11-01 martin [libcxx] Implement is_absolute properly for windows
> 2021-02-17 ldionne.2 [libc++] Allow retries in a few more flaky tests
> 2020-11-03 martin [libcxx] Implement parsing of root_name for paths on windows
> 2021-02-16 zibi [SystemZ][ZOS] Prefer -nostdlib++ as opposed to -nodefaultlibs when building c++ libraries
> 2021-02-16 colin [libc++] Build thread_win32.cpp only if LIBCXX_HAS_PTHREAD_API is not set
> 2021-02-15 arthur.j.odwyer [libc++] Change `std::numeric_limits` to just `numeric_limits` in <chrono>.
> 2021-02-15 ldionne.2 [libc++] Mark __cpp_lib_constexpr_memory as being implemented
> 2021-02-15 dimitry Define new/delete in libc++ when using libcxxrt
> 2021-02-12 zibi [SystemZ][ZOS] Fix __libcpp_thrad_isnull()
> 2021-02-12 zibi [SystemZ][ZOS] Provide CLOCK_MONOTONIC alternative
> 2021-02-11 koraq [libc++][format] Enable format_error on older compilers.
> 2021-02-11 koraq [libc++][format] Improve Add basic_format_parse_context.
> 2021-02-02 koraq [libc++][format] Add basic_format_parse_context.
> 2021-02-10 tokarip [libc++] Use builtins in more math.h functions.
> 2021-02-08 cjdb [libcxx] adds concepts `std::invocable` and `std::regular_invocable`
> 2021-02-04 cjdb [libcxx] adds concept std::derived_from
> 2021-01-21 cjdb [libcxx] adds [concepts.arithmetic]
> 2021-02-10 ldionne.2 [libc++] Remove c++98 Lit features in the test suite
> 2021-02-08 cjdb [libcxx] adds concept `std::copy_constructible`
> 2021-02-08 cjdb [libcxx] adds concept `std::move_constructible`
> 2021-02-10 colin [libc++] Fix copy-paste mistake in __threading_support
> 2021-02-04 cjdb [libcxx] adds concept `std::convertible_to`
>
> Created with:
>   roll-dep src/buildtools/third_party/libc++/trunk
>
> Bug: 1212755
> Change-Id: Ifeda696255c9b32f736249a041f50e4538938e7d
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2917761
> Reviewed-by: Amy Huang <akhuang@google.com>
> Reviewed-by: Nico Weber <thakis@chromium.org>
> Reviewed-by: Reid Kleckner <rnk@chromium.org>
> Reviewed-by: Hans Wennborg <hans@chromium.org>
> Reviewed-by: David Bokan <bokan@chromium.org>
> Commit-Queue: Amy Huang <akhuang@google.com>
> Cr-Commit-Position: refs/heads/master@{#894495}

Bug: 1222564
Bug: 1212755
Change-Id: I8df91ca5198053b99e650ba8cfb91603335df33a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2978431
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Joel Hockey <joelhockey@chromium.org>
Owners-Override: Joel Hockey <joelhockey@chromium.org>
Cr-Commit-Position: refs/heads/master@{#894563}
2021-06-22 06:51:55 +00:00
..
2021-06-17 14:09:12 +00:00

cc/

This directory contains a compositor, used in both the renderer and the browser. In the renderer, Blink is the client. In the browser, both ui and Android browser compositor are the clients.

The public API of the compositor is LayerTreeHost and Layer and its derived types. Embedders create a LayerTreeHost (single, multithreaded, or synchronous) and then attach a tree of Layers to it.

When Layers are updated they request a commit, which takes the structure of the tree of Layers, the data on each Layer, and the data of its host and atomically pushes it all to a tree of LayerImpls and a LayerTreeHostImpl and LayerTreeImpl. The main thread (which owns the tree of Layers and the embedder) is blocked during this commit operation.

The commit is from the main thread Layer tree to the pending tree in multithreaded mode. The pending tree is a staging tree for rasterization. When enough rasterization has completed for invalidations, the pending tree is ready to activate. Activate is an analogous operation to commit, and pushes data from the pending tree to the active tree. The pending tree exists so that all of the updates from the main thread can be displayed to the user atomically while the previous frame can be scrolled or animated.

The single threaded compositor commits directly to the active tree and then stops drawing until the content is ready to be drawn.

The active tree is responsible for drawing. The Scheduler and its SchedulerStateMachine decide when to draw (along with when to commit, etc etc). "Drawing" in a compositor consists of LayerImpl::AppendQuads which batches up a set of DrawQuads and RenderPasses into a CompositorFrame which is sent via a CompositorFrameSink.

CompositorFrames from individual compositors are sent to the SurfaceManager (which is in the GPU process). The SurfaceAggregator combines all CompositorFrames together when asked to by the Display. These are given to the viz::DirectRenderer, which finally draws the entire composited browser contents. See //components/viz for more details on the display compositor.

Design documents for the graphics stack can be found at chromium-graphics.

Other Docs

Glossaries

Active CompositorFrame

Active Tree

The set of layers and property trees that was/will be used to submit a CompositorFrame from the layer compositor. Composited effects such as scrolling, pinch, and animations are done by modifying the active tree, which allows for producing and submitting a new CompositorFrame.

CompositorFrame

A set of RenderPasses (which are a list of DrawQuads) along with metadata. Conceptually this is the instructions (transforms, texture ids, etc) for how to draw an entire scene which will be presented in a surface.

CopyOutputRequest (or Copy Request)

A request for a texture (or bitmap) copy of some part of the compositor's output. Such requests force the compositor to use a separate RenderPass for the content to be copied, which allows it to do the copy operation once the RenderPass has been drawn to.

ElementID

Chosen by cc's clients and can be used as a stable identifier across updates. For example, blink uses ElementIDs as a stable id for the object (opaque to cc) that is responsible for a composited animation. Some additional information in element_id.h

DirectRenderer

An abstraction that provides an API for the Display to draw a fully-aggregated CompositorFrame to a physical output. Subclasses of it provide implementations for various backends, currently GL, Skia, or Software. See viz::DirectRenderer for details.

Layer

A conceptual piece of content that can appear on screen and has some known position with respect to the viewport. The Layer class only is used on the main thread. This, along with LayerTreeHost, is the main API for the compositor.

LayerImpl

The same as Layer, but on the compositor thread.

LayerTree

Occlusion Culling

Avoiding work by skipping over things which are not visible due to being occluded (hidden from sight by other opaque things in front of them). Most commonly refers to skipping drawing (ie culling) of DrawQuads when other DrawQuads will be in front and occluding them.

Property Trees

See also presentations on Compositor Property Trees and Blink Property Trees.

Display

A controller class that takes CompositorFrames for each surface and draws them to a physical output. See viz::Display for details.

Draw

Filling pixels in a physical output (technically could be to an offscreen texture), but this is the final output of the display compositor.

DrawQuad

A unit of work for drawing. Each DrawQuad has its own texture id, transform, offset, etc.

Shared Quad State

A shared set of states used by multiple draw quads. DrawQuads that are linked to the same shared quad state will all use the same properties from it, with the addition of things found on their individual DrawQuad structures.

Render Pass

A list of DrawQuads which will all be drawn together into the same render target (either a texture or physical output). Most times all DrawQuads are part of a single RenderPass. Additional RenderPasses are used for effects that require a set of DrawQuads to be drawn together into a buffer first, with the effect applied then to the buffer instead of each individual DrawQuad.

Render Surface

Synonym for RenderPass now. Historically part of the Layer tree data structures, with a 1:1 mapping to RenderPasses. RenderSurfaceImpl is a legacy piece that remains.

Surface

Record

Raster

Paint

Pending CompositorFrame

Pending Tree

The set of layers and property trees that is generated from a main frame (or BeginMainFrame, or commit). The pending tree exists to do raster work in the layer compositor without clobbering the active tree until it is done. This allows the active tree to be used in the meantime.

Composite

To produce a single graphical output from multiple inputs. In practice, the layer compositor does raster from recordings and manages memory, performs composited effects such as scrolling, pinch, animations, producing a CompositorFrame. The display compositor does an actual "composite" to draw the final output into a single physical output.

Invalidation

Invalidation is a unit of content update. Any content updates from Blink or ui must be accompanied by an invalidation to tell the compositor that a piece of content must be rerasterized. For example, if a 10x10 div with a background color has its width increased by 5 pixels, then there will be a 5x10 invalidation (at least) for the new space covered by the larger div.

Ideally, invalidations represent the minimum amount of content that must be rerastered from the previous frame. They are passed to the compositor via Layer::SetNeedsDisplay(Rect). Invalidation is tracked both to minimize the amount of raster work needed, but also to allow for partial raster of Tiles. Invalidations also eventually become damage.

Damage

Damage is the equivalent of invalidation, but for the final display. As invalidation is the difference between two frames worth of content, damage is the difference between two CompositorFrames. Damage is tracked via the DamageTracker. This allows for partial swap, where only the parts of the final CompositorFrame that touch the screen are drawn, and only that drawn portion is swapped, which saves quite a bit of power for small bits of damage.

Invalidation creates damage, in that if a piece of content updates, then that content invalidation creates damage on screen. Other things that cause damage are analogous operations to invalidations, but on Layers. For example, moving a Layer around, changing properties of Layers (e.g. opacity), and adding/removing/reordering Layers will all create damage (aka screen updates) but do not create invalidations (aka raster work).

Tiles

An abstraction of a piece of content of a Layer. A tile may be rasterized or not. It may be known to be a solid color or not. A PictureLayerImpl indirectly owns a sparse set of Tiles to represent its rasterizable content. When tiles are invalidated, they are replaced with new tiles.

Prepare Tiles

Prioritize and schedule needed tiles for raster. This is the entry point to a system that converts painting (raster sources / recording sources) into rasterized resources that live on tiles. This also kicks off any dependent image decodes for images that need to be decode for the raster to take place.

Device Scale Factor

The scale at which we want to display content on the output device. For very high resolution monitors, everything would become too small if just presented 1:1 with the pixels. So we use a larger number of physical pixels per logical pixels. This ratio is the device scale factor. 1 or 2 is the most common on ChromeOS. Values between 1 and 2 are common on Windows.