#include "third_party/blink/renderer/core/svg/graphics/svg_image.h"
#include "base/memory/scoped_refptr.h"
#include "third_party/blink/renderer/core/animation/document_animations.h"
#include "third_party/blink/renderer/core/animation/document_timeline.h"
#include "third_party/blink/renderer/core/dom/flat_tree_traversal.h"
#include "third_party/blink/renderer/core/dom/node_traversal.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/frame/local_frame_view.h"
#include "third_party/blink/renderer/core/frame/settings.h"
#include "third_party/blink/renderer/core/frame/visual_viewport.h"
#include "third_party/blink/renderer/core/layout/intrinsic_sizing_info.h"
#include "third_party/blink/renderer/core/layout/layout_view.h"
#include "third_party/blink/renderer/core/layout/svg/layout_svg_root.h"
#include "third_party/blink/renderer/core/page/page_animator.h"
#include "third_party/blink/renderer/core/paint/paint_auto_dark_mode.h"
#include "third_party/blink/renderer/core/svg/animation/smil_time_container.h"
#include "third_party/blink/renderer/core/svg/graphics/isolated_svg_document_host.h"
#include "third_party/blink/renderer/core/svg/graphics/svg_image_chrome_client.h"
#include "third_party/blink/renderer/core/svg/svg_animated_preserve_aspect_ratio.h"
#include "third_party/blink/renderer/core/svg/svg_document_extensions.h"
#include "third_party/blink/renderer/core/svg/svg_fe_image_element.h"
#include "third_party/blink/renderer/core/svg/svg_foreign_object_element.h"
#include "third_party/blink/renderer/core/svg/svg_image_element.h"
#include "third_party/blink/renderer/core/svg/svg_svg_element.h"
#include "third_party/blink/renderer/core/svg/svg_view_spec.h"
#include "third_party/blink/renderer/platform/bindings/script_forbidden_scope.h"
#include "third_party/blink/renderer/platform/graphics/graphics_context.h"
#include "third_party/blink/renderer/platform/graphics/image_observer.h"
#include "third_party/blink/renderer/platform/graphics/paint/cull_rect.h"
#include "third_party/blink/renderer/platform/graphics/paint/paint_canvas.h"
#include "third_party/blink/renderer/platform/graphics/paint/paint_record.h"
#include "third_party/blink/renderer/platform/graphics/paint/paint_record_builder.h"
#include "third_party/blink/renderer/platform/graphics/paint/paint_shader.h"
#include "third_party/blink/renderer/platform/instrumentation/tracing/trace_event.h"
#include "third_party/blink/renderer/platform/scheduler/public/main_thread.h"
#include "third_party/blink/renderer/platform/scheduler/public/main_thread_scheduler.h"
#include "third_party/blink/renderer/platform/wtf/functional.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/rect_conversions.h"
#include "ui/gfx/geometry/size_conversions.h"
#include "ui/gfx/geometry/skia_conversions.h"
namespace blink {
namespace {
bool HasSmilAnimations(const Document& document) { … }
}
void SVGImageViewInfo::Trace(Visitor* visitor) const { … }
SVGImage::SVGImage(ImageObserver* observer, bool is_multipart)
: … { … }
SVGImage::~SVGImage() { … }
bool SVGImage::IsInSVGImage(const Node* node) { … }
LocalFrame* SVGImage::GetFrame() const { … }
SVGSVGElement* SVGImage::RootElement() const { … }
LayoutSVGRoot* SVGImage::LayoutRoot() const { … }
Page* SVGImage::GetPageForTesting() { … }
void SVGImage::CheckLoaded() const { … }
bool SVGImage::CurrentFrameHasSingleSecurityOrigin() const { … }
gfx::Size SVGImage::SizeWithConfig(SizeConfig) const { … }
const SVGImageViewInfo* SVGImage::CreateViewInfo(const String& fragment) const { … }
void SVGImage::ApplyViewInfo(const SVGImageViewInfo* viewinfo) { … }
bool SVGImage::GetIntrinsicSizingInfo(
const SVGViewSpec* override_viewspec,
IntrinsicSizingInfo& intrinsic_sizing_info) const { … }
SVGImage::DrawInfo::DrawInfo(const gfx::SizeF& container_size,
float zoom,
const SVGImageViewInfo* viewinfo,
bool is_dark_mode_enabled)
: … { … }
gfx::SizeF SVGImage::DrawInfo::CalculateResidualScale() const { … }
void SVGImage::DrawForContainer(const DrawInfo& draw_info,
cc::PaintCanvas* canvas,
const cc::PaintFlags& flags,
const gfx::RectF& dst_rect,
const gfx::RectF& src_rect) { … }
PaintImage SVGImage::PaintImageForCurrentFrame() { … }
void SVGImage::SetPreferredColorScheme(
mojom::blink::PreferredColorScheme preferred_color_scheme) { … }
void SVGImage::DrawPatternForContainer(const DrawInfo& draw_info,
GraphicsContext& context,
const cc::PaintFlags& base_flags,
const gfx::RectF& dst_rect,
const ImageTilingInfo& tiling_info) { … }
void SVGImage::PopulatePaintRecordForCurrentFrameForContainer(
const DrawInfo& draw_info,
PaintImageBuilder& builder) { … }
bool SVGImage::ApplyShaderInternal(const DrawInfo& draw_info,
cc::PaintFlags& flags,
const gfx::RectF& unzoomed_src_rect,
const SkMatrix& local_matrix) { … }
bool SVGImage::ApplyShader(cc::PaintFlags& flags,
const SkMatrix& local_matrix,
const gfx::RectF& src_rect,
const ImageDrawOptions& draw_options) { … }
bool SVGImage::ApplyShaderForContainer(const DrawInfo& draw_info,
cc::PaintFlags& flags,
const gfx::RectF& src_rect,
const SkMatrix& local_matrix) { … }
void SVGImage::Draw(cc::PaintCanvas* canvas,
const cc::PaintFlags& flags,
const gfx::RectF& dst_rect,
const gfx::RectF& src_rect,
const ImageDrawOptions& draw_options) { … }
std::optional<PaintRecord> SVGImage::PaintRecordForCurrentFrame(
const DrawInfo& draw_info,
const gfx::Rect* cull_rect) { … }
static bool DrawNeedsLayer(const cc::PaintFlags& flags) { … }
void SVGImage::DrawInternal(const DrawInfo& draw_info,
cc::PaintCanvas* canvas,
const cc::PaintFlags& flags,
const gfx::RectF& dst_rect,
const gfx::RectF& unzoomed_src_rect) { … }
void SVGImage::ScheduleTimelineRewind() { … }
void SVGImage::FlushPendingTimelineRewind() { … }
void SVGImage::StartAnimation() { … }
void SVGImage::StopAnimation() { … }
void SVGImage::ResetAnimation() { … }
void SVGImage::RestoreAnimation() { … }
bool SVGImage::MaybeAnimated() { … }
void SVGImage::ServiceAnimations(
base::TimeTicks monotonic_animation_start_time) { … }
void SVGImage::AdvanceAnimationForTesting() { … }
SVGImageChromeClient& SVGImage::ChromeClientForTesting() { … }
void SVGImage::UpdateUseCounters(const Document& document) const { … }
void SVGImage::MaybeRecordSvgImageProcessingTime(const Document& document) { … }
Element* SVGImage::GetResourceElement(const AtomicString& id) const { … }
void SVGImage::NotifyAsyncLoadCompleted() { … }
Image::SizeAvailability SVGImage::DataChanged(bool all_data_received) { … }
bool SVGImage::IsSizeAvailable() { … }
String SVGImage::FilenameExtension() const { … }
const AtomicString& SVGImage::MimeType() const { … }
}