#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) { … }
bool CompositorMayHaveIncorrectDamageRect(const Element* element) { … }
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) { … }
}
template <>
struct DowncastTraits<BackgroundColorPaintWorkletInput> { … };
Animation* BackgroundColorPaintDefinition::GetAnimationIfCompositable(
const Element* element) { … }
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 { … }
}