chromium/third_party/blink/renderer/platform/graphics/paint_invalidation_reason.h

// Copyright 2014 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_GRAPHICS_PAINT_INVALIDATION_REASON_H_
#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_GRAPHICS_PAINT_INVALIDATION_REASON_H_

#include <stdint.h>

#include <iosfwd>

#include "third_party/blink/renderer/platform/platform_export.h"

namespace blink {

// Reasons of paint invalidation and raster invalidation. A paint invalidation
// reason (<= kLayoutMax) is set in renderer/core (mostly layout and paint)
// on a DisplayItemClient to indicate it will paint differently from the
// previous painted result. During raster invalidation, we use paint
// invalidation reasons as raster invalidation reasons for display items,
// and raster invalidation reasons (> kLayoutMax) for changes such as
// reordering of display item and paint chunks.
enum class PaintInvalidationReason : uint8_t {};

PLATFORM_EXPORT const char* PaintInvalidationReasonToString(
    PaintInvalidationReason);

inline constexpr bool IsFullPaintInvalidationReason(
    PaintInvalidationReason reason) {}

inline constexpr bool IsNonLayoutFullPaintInvalidationReason(
    PaintInvalidationReason reason) {}

inline constexpr bool IsLayoutFullPaintInvalidationReason(
    PaintInvalidationReason reason) {}

inline constexpr bool IsLayoutPaintInvalidationReason(
    PaintInvalidationReason reason) {}

PLATFORM_EXPORT std::ostream& operator<<(std::ostream&,
                                         PaintInvalidationReason);

}  // namespace blink

#endif  // THIRD_PARTY_BLINK_RENDERER_PLATFORM_GRAPHICS_PAINT_INVALIDATION_REASON_H_