chromium/third_party/blink/renderer/modules/csspaint/nativepaint/background_color_paint_definition.cc

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

#include "third_party/blink/renderer/modules/csspaint/nativepaint/background_color_paint_definition.h"

#include "cc/paint/paint_recorder.h"
#include "third_party/blink/renderer/core/animation/animation_effect.h"
#include "third_party/blink/renderer/core/animation/compositor_animations.h"
#include "third_party/blink/renderer/core/animation/css/compositor_keyframe_double.h"
#include "third_party/blink/renderer/core/animation/css_color_interpolation_type.h"
#include "third_party/blink/renderer/core/animation/element_animations.h"
#include "third_party/blink/renderer/core/css/css_color.h"
#include "third_party/blink/renderer/core/css/css_color_mix_value.h"
#include "third_party/blink/renderer/core/css/cssom/paint_worklet_deferred_image.h"
#include "third_party/blink/renderer/core/css/cssom/paint_worklet_input.h"
#include "third_party/blink/renderer/core/css/cssom/paint_worklet_style_property_map.h"
#include "third_party/blink/renderer/core/css/cssom/style_property_map_read_only.h"
#include "third_party/blink/renderer/core/css/properties/longhands.h"
#include "third_party/blink/renderer/core/css/resolver/style_resolver.h"
#include "third_party/blink/renderer/core/frame/web_local_frame_impl.h"
#include "third_party/blink/renderer/core/layout/layout_object.h"
#include "third_party/blink/renderer/core/paint/paint_layer.h"
#include "third_party/blink/renderer/platform/graphics/color.h"
#include "third_party/blink/renderer/platform/wtf/casting.h"

namespace blink {

namespace {

ColorKeyframe;
ColorKeyframeVector;

Color InterpolateColor(unsigned index,
                       double progress,
                       const ColorKeyframeVector& keyframes) {}

// Check for ancestor node with filter that moves pixels. The compositor cannot
// easily track the filters applied within a layer (i.e. composited filters) and
// is unable to expand the damage rect. To workaround this, we want to disallow
// composited background animations if there are decomposited filters, but we do
// not know that at this stage of the pipeline.  Therefore, we simple disallow
// any pixel moving filters between this object and the nearest ancestor known
// to be composited.
bool CompositorMayHaveIncorrectDamageRect(const Element* element) {}

// This class includes information that is required by the compositor thread
// when painting background color.
class BackgroundColorPaintWorkletInput : public PaintWorkletInput {};

Color GetColorFromKeyframe(const PropertySpecificKeyframe* frame,
                           const KeyframeEffectModelBase* model,
                           const Element* element) {}

void ExtractKeyframes(const Element* element,
                      const Animation* compositable_animation,
                      ColorKeyframeVector& color_keyframes) {}

bool ValidateColorValue(const Element* element,
                        const CSSValue* value,
                        const InterpolableValue* interpolable_value) {}

}  // namespace

template <>
struct DowncastTraits<BackgroundColorPaintWorkletInput> {};

Animation* BackgroundColorPaintDefinition::GetAnimationIfCompositable(
    const Element* element) {}

// static
BackgroundColorPaintDefinition* BackgroundColorPaintDefinition::Create(
    LocalFrame& local_root) {}

BackgroundColorPaintDefinition::BackgroundColorPaintDefinition(
    LocalFrame& local_root)
    :{}

PaintRecord BackgroundColorPaintDefinition::Paint(
    const CompositorPaintWorkletInput* compositor_input,
    const CompositorPaintWorkletJob::AnimatedPropertyValues&
        animated_property_values) {}

scoped_refptr<Image> BackgroundColorPaintDefinition::Paint(
    const gfx::SizeF& container_size,
    const Node* node) {}

PaintRecord BackgroundColorPaintDefinition::PaintForTest(
    const Vector<Color>& animated_colors,
    const Vector<double>& offsets,
    const CompositorPaintWorkletJob::AnimatedPropertyValues&
        animated_property_values) {}

void BackgroundColorPaintDefinition::Trace(Visitor* visitor) const {}

}  // namespace blink