/* * Copyright (C) 2000 Lars Knoll ([email protected]) * (C) 2000 Antti Koivisto ([email protected]) * (C) 2000 Dirk Mueller ([email protected]) * (C) 2004 Allan Sandfeld Jensen ([email protected]) * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights * reserved. * Copyright (C) 2009 Google Inc. All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * */ #ifndef THIRD_PARTY_BLINK_RENDERER_CORE_PAINT_PAINT_PHASE_H_ #define THIRD_PARTY_BLINK_RENDERER_CORE_PAINT_PAINT_PHASE_H_ namespace blink { // The painting of a layer occurs in 5 phases, Each involves a recursive // descent into the layer's layout objects in painting order: // 1. Background phase: backgrounds and borders of all blocks are painted. // Inlines are not painted at all. Touch-action and wheel hit test rects are // also painted during this phase (see: paint/README.md#hit-test-painting). // 2. ForcedColorsModeBackplate phase: a readability backplate is painted // behind all inline text, split by paragraph. This phase should only paint // content when in forced colors mode to ensure readability for text above // images. // 3. Float phase: floating objects are painted above block backgrounds but // entirely below inline content that can overlap them. // 4. Foreground phase: all inlines are fully painted. Atomic inline elements // will get all 4 non-backplate phases invoked on them during this phase, // as if they were stacking contexts (see // ObjectPainter::PaintAllPhasesAtomically()). // 5. Outline phase: outlines are painted over the foreground. enum class PaintPhase { … }; inline bool ShouldPaintSelfBlockBackground(PaintPhase phase) { … } inline bool ShouldPaintSelfOutline(PaintPhase phase) { … } inline bool ShouldPaintDescendantBlockBackgrounds(PaintPhase phase) { … } inline bool ShouldPaintDescendantOutlines(PaintPhase phase) { … } } // namespace blink #endif // THIRD_PARTY_BLINK_RENDERER_CORE_PAINT_PAINT_PHASE_H_