Commit 43f5c398 authored by Fredrik Söderqvist's avatar Fredrik Söderqvist Committed by Commit Bot

Use a DrawInfo for passing per-draw information in SVGImage

The new class DrawInfo packages the various parameters used when drawing
an SVGImage - container size, zoom and URL.
The intent is to reduce the amount of arguments that needs to be passed
around as well as prepare for better (more centralized) handling of the
container size to get better control of the various representations used
(FloatSize, LayoutSize, IntSize).

Also move DrawNeedsLayer() closer to its user and perform minor tweaks
to DrawPatternForContainer() (reorder matrix setup; return PaintRecord
directly to MakePaintRecord).

Change-Id: Id231682c9d85a322a3c585a75b2793a68628c348
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2550915Reviewed-by: default avatarStephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#830131}
parent f62142c6
...@@ -372,8 +372,13 @@ FloatSize SVGImage::ConcreteObjectSize( ...@@ -372,8 +372,13 @@ FloatSize SVGImage::ConcreteObjectSize(
return default_object_size; return default_object_size;
} }
SVGImage::DrawInfo::DrawInfo(const FloatSize& container_size,
float zoom,
const KURL& url)
: container_size_(container_size), zoom_(zoom), url_(url) {}
template <typename Func> template <typename Func>
void SVGImage::ForContainer(const FloatSize& container_size, Func&& func) { void SVGImage::ForContainer(const DrawInfo& draw_info, Func&& func) {
if (!page_) if (!page_)
return; return;
...@@ -381,6 +386,7 @@ void SVGImage::ForContainer(const FloatSize& container_size, Func&& func) { ...@@ -381,6 +386,7 @@ void SVGImage::ForContainer(const FloatSize& container_size, Func&& func) {
// re-laying out the image. // re-laying out the image.
ImageObserverDisabler image_observer_disabler(this); ImageObserverDisabler image_observer_disabler(this);
FloatSize container_size = draw_info.ContainerSize();
LayoutSize rounded_container_size = RoundedLayoutSize(container_size); LayoutSize rounded_container_size = RoundedLayoutSize(container_size);
if (LayoutSVGRoot* layout_root = LayoutRoot()) if (LayoutSVGRoot* layout_root = LayoutRoot())
...@@ -390,42 +396,39 @@ void SVGImage::ForContainer(const FloatSize& container_size, Func&& func) { ...@@ -390,42 +396,39 @@ void SVGImage::ForContainer(const FloatSize& container_size, Func&& func) {
rounded_container_size.Height() / container_size.Height())); rounded_container_size.Height() / container_size.Height()));
} }
void SVGImage::DrawForContainer(cc::PaintCanvas* canvas, void SVGImage::DrawForContainer(const DrawInfo& draw_info,
cc::PaintCanvas* canvas,
const PaintFlags& flags, const PaintFlags& flags,
const FloatSize& container_size,
float zoom,
const FloatRect& dst_rect, const FloatRect& dst_rect,
const FloatRect& src_rect, const FloatRect& src_rect) {
const KURL& url) { ForContainer(draw_info, [&](const FloatSize& residual_scale) {
ForContainer(container_size, [&](const FloatSize& residual_scale) {
FloatRect scaled_src = src_rect; FloatRect scaled_src = src_rect;
scaled_src.Scale(1 / zoom); scaled_src.Scale(1 / draw_info.Zoom());
// Compensate for the container size rounding by adjusting the source rect. // Compensate for the container size rounding by adjusting the source rect.
FloatSize adjusted_src_size = scaled_src.Size(); FloatSize adjusted_src_size = scaled_src.Size();
adjusted_src_size.Scale(residual_scale.Width(), residual_scale.Height()); adjusted_src_size.Scale(residual_scale.Width(), residual_scale.Height());
scaled_src.SetSize(adjusted_src_size); scaled_src.SetSize(adjusted_src_size);
DrawInternal(canvas, flags, dst_rect, scaled_src, url); DrawInternal(draw_info, canvas, flags, dst_rect, scaled_src);
}); });
} }
PaintImage SVGImage::PaintImageForCurrentFrame() { PaintImage SVGImage::PaintImageForCurrentFrame() {
const DrawInfo draw_info(FloatSize(intrinsic_size_), 1, NullURL());
auto builder = CreatePaintImageBuilder(); auto builder = CreatePaintImageBuilder();
PopulatePaintRecordForCurrentFrameForContainer(builder, Size(), 1, NullURL()); PopulatePaintRecordForCurrentFrameForContainer(draw_info, builder);
return builder.TakePaintImage(); return builder.TakePaintImage();
} }
void SVGImage::DrawPatternForContainer(GraphicsContext& context, void SVGImage::DrawPatternForContainer(const DrawInfo& draw_info,
const FloatSize container_size, GraphicsContext& context,
float zoom,
const FloatRect& src_rect, const FloatRect& src_rect,
const FloatSize& tile_scale, const FloatSize& tile_scale,
const FloatPoint& phase, const FloatPoint& phase,
SkBlendMode composite_op, SkBlendMode composite_op,
const FloatRect& dst_rect, const FloatRect& dst_rect,
const FloatSize& repeat_spacing, const FloatSize& repeat_spacing) {
const KURL& url) {
// Tile adjusted for scaling/stretch. // Tile adjusted for scaling/stretch.
FloatRect tile(src_rect); FloatRect tile(src_rect);
tile.Scale(tile_scale.Width(), tile_scale.Height()); tile.Scale(tile_scale.Width(), tile_scale.Height());
...@@ -434,6 +437,10 @@ void SVGImage::DrawPatternForContainer(GraphicsContext& context, ...@@ -434,6 +437,10 @@ void SVGImage::DrawPatternForContainer(GraphicsContext& context,
FloatRect spaced_tile(tile); FloatRect spaced_tile(tile);
spaced_tile.Expand(FloatSize(repeat_spacing)); spaced_tile.Expand(FloatSize(repeat_spacing));
SkMatrix pattern_transform;
pattern_transform.setTranslate(phase.X() + spaced_tile.X(),
phase.Y() + spaced_tile.Y());
PaintRecordBuilder builder(context); PaintRecordBuilder builder(context);
{ {
DrawingRecorder recorder(builder.Context(), builder, DrawingRecorder recorder(builder.Context(), builder,
...@@ -442,20 +449,14 @@ void SVGImage::DrawPatternForContainer(GraphicsContext& context, ...@@ -442,20 +449,14 @@ void SVGImage::DrawPatternForContainer(GraphicsContext& context,
// spacing area. // spacing area.
if (tile != spaced_tile) if (tile != spaced_tile)
builder.Context().Clip(tile); builder.Context().Clip(tile);
PaintFlags flags; DrawForContainer(draw_info, builder.Context().Canvas(), PaintFlags(), tile,
DrawForContainer(builder.Context().Canvas(), flags, container_size, zoom, src_rect);
tile, src_rect, url);
} }
sk_sp<PaintRecord> record = builder.EndRecording();
SkMatrix pattern_transform;
pattern_transform.setTranslate(phase.X() + spaced_tile.X(),
phase.Y() + spaced_tile.Y());
PaintFlags flags; PaintFlags flags;
flags.setShader( flags.setShader(PaintShader::MakePaintRecord(
PaintShader::MakePaintRecord(record, spaced_tile, SkTileMode::kRepeat, builder.EndRecording(), spaced_tile, SkTileMode::kRepeat,
SkTileMode::kRepeat, &pattern_transform)); SkTileMode::kRepeat, &pattern_transform));
// If the shader could not be instantiated (e.g. non-invertible matrix), // If the shader could not be instantiated (e.g. non-invertible matrix),
// draw transparent. // draw transparent.
// Note: we can't simply bail, because of arbitrary blend mode. // Note: we can't simply bail, because of arbitrary blend mode.
...@@ -470,10 +471,8 @@ void SVGImage::DrawPatternForContainer(GraphicsContext& context, ...@@ -470,10 +471,8 @@ void SVGImage::DrawPatternForContainer(GraphicsContext& context,
} }
void SVGImage::PopulatePaintRecordForCurrentFrameForContainer( void SVGImage::PopulatePaintRecordForCurrentFrameForContainer(
PaintImageBuilder& builder, const DrawInfo& draw_info,
const IntSize& zoomed_container_size, PaintImageBuilder& builder) {
float zoom,
const KURL& url) {
builder.set_completion_state( builder.set_completion_state(
load_state_ == LoadState::kLoadCompleted load_state_ == LoadState::kLoadCompleted
? PaintImage::CompletionState::DONE ? PaintImage::CompletionState::DONE
...@@ -481,42 +480,26 @@ void SVGImage::PopulatePaintRecordForCurrentFrameForContainer( ...@@ -481,42 +480,26 @@ void SVGImage::PopulatePaintRecordForCurrentFrameForContainer(
if (!page_) if (!page_)
return; return;
const IntRect container_rect(IntPoint(), zoomed_container_size);
// Compute a new container size based on the zoomed (and potentially
// rounded) size.
FloatSize container_size(zoomed_container_size);
container_size.Scale(1 / zoom);
PaintRecorder recorder; PaintRecorder recorder;
cc::PaintCanvas* canvas = recorder.beginRecording(container_rect); const FloatSize size(draw_info.ContainerSize().ScaledBy(draw_info.Zoom()));
DrawForContainer(canvas, PaintFlags(), container_size, zoom, const IntRect dest_rect(IntPoint(), RoundedIntSize(size));
FloatRect(container_rect), FloatRect(container_rect), url); cc::PaintCanvas* canvas = recorder.beginRecording(dest_rect);
builder.set_paint_record(recorder.finishRecordingAsPicture(), container_rect, DrawForContainer(draw_info, canvas, PaintFlags(), FloatRect(dest_rect),
FloatRect(FloatPoint(), size));
builder.set_paint_record(recorder.finishRecordingAsPicture(), dest_rect,
PaintImage::GetNextContentId()); PaintImage::GetNextContentId());
} }
static bool DrawNeedsLayer(const PaintFlags& flags) { bool SVGImage::ApplyShaderInternal(const DrawInfo& draw_info,
if (SkColorGetA(flags.getColor()) < 255) PaintFlags& flags,
return true; const SkMatrix& local_matrix) {
// This is needed to preserve the dark mode filter that
// has been set in GraphicsContext.
if (flags.getColorFilter())
return true;
return flags.getBlendMode() != SkBlendMode::kSrcOver;
}
bool SVGImage::ApplyShaderInternal(PaintFlags& flags,
const SkMatrix& local_matrix,
const KURL& url) {
const FloatSize size(ContainerSize()); const FloatSize size(ContainerSize());
if (size.IsEmpty()) if (size.IsEmpty())
return false; return false;
FloatRect bounds(FloatPoint(), size); FloatRect bounds(FloatPoint(), size);
flags.setShader(PaintShader::MakePaintRecord( flags.setShader(PaintShader::MakePaintRecord(
PaintRecordForCurrentFrame(url), bounds, SkTileMode::kRepeat, PaintRecordForCurrentFrame(draw_info), bounds, SkTileMode::kRepeat,
SkTileMode::kRepeat, &local_matrix)); SkTileMode::kRepeat, &local_matrix));
// Animation is normally refreshed in draw() impls, which we don't reach when // Animation is normally refreshed in draw() impls, which we don't reach when
...@@ -527,22 +510,25 @@ bool SVGImage::ApplyShaderInternal(PaintFlags& flags, ...@@ -527,22 +510,25 @@ bool SVGImage::ApplyShaderInternal(PaintFlags& flags,
} }
bool SVGImage::ApplyShader(PaintFlags& flags, const SkMatrix& local_matrix) { bool SVGImage::ApplyShader(PaintFlags& flags, const SkMatrix& local_matrix) {
return ApplyShaderInternal(flags, local_matrix, NullURL()); // TODO(fs): Passing |intrinsic_size_| even though it shouldn't be used in
// this code-path ATM. (It'll read the currently set container size from the
// SVG root which is a bit iffy/non-deterministic.)
const DrawInfo draw_info(FloatSize(intrinsic_size_), 1, NullURL());
return ApplyShaderInternal(draw_info, flags, local_matrix);
} }
bool SVGImage::ApplyShaderForContainer(const FloatSize& container_size, bool SVGImage::ApplyShaderForContainer(const DrawInfo& draw_info,
float zoom,
const KURL& url,
PaintFlags& flags, PaintFlags& flags,
const SkMatrix& local_matrix) { const SkMatrix& local_matrix) {
bool result = false; bool result = false;
ForContainer(container_size, [&](const FloatSize& residual_scale) { ForContainer(draw_info, [&](const FloatSize& residual_scale) {
FloatSize zoomed_residual_scale = residual_scale.ScaledBy(draw_info.Zoom());
// Compensate for the container size rounding. // Compensate for the container size rounding.
auto adjusted_local_matrix = local_matrix; auto adjusted_local_matrix = local_matrix;
adjusted_local_matrix.preScale(zoom * residual_scale.Width(), adjusted_local_matrix.preScale(zoomed_residual_scale.Width(),
zoom * residual_scale.Height()); zoomed_residual_scale.Height());
result = ApplyShaderInternal(flags, adjusted_local_matrix, url); result = ApplyShaderInternal(draw_info, flags, adjusted_local_matrix);
}); });
return result; return result;
...@@ -557,10 +543,15 @@ void SVGImage::Draw(cc::PaintCanvas* canvas, ...@@ -557,10 +543,15 @@ void SVGImage::Draw(cc::PaintCanvas* canvas,
ImageDecodingMode) { ImageDecodingMode) {
if (!page_) if (!page_)
return; return;
DrawInternal(canvas, flags, dst_rect, src_rect, NullURL()); // TODO(fs): Passing |intrinsic_size_| even though it shouldn't be used in
// this code-path ATM. (It'll read the currently set container size from the
// SVG root which is a bit iffy/non-deterministic.)
const DrawInfo draw_info(FloatSize(intrinsic_size_), 1, NullURL());
DrawInternal(draw_info, canvas, flags, dst_rect, src_rect);
} }
sk_sp<PaintRecord> SVGImage::PaintRecordForCurrentFrame(const KURL& url) { sk_sp<PaintRecord> SVGImage::PaintRecordForCurrentFrame(
const DrawInfo& draw_info) {
DCHECK(page_); DCHECK(page_);
LocalFrameView* view = GetFrame()->View(); LocalFrameView* view = GetFrame()->View();
IntSize rounded_container_size = RoundedIntSize(ContainerSize()); IntSize rounded_container_size = RoundedIntSize(ContainerSize());
...@@ -569,7 +560,7 @@ sk_sp<PaintRecord> SVGImage::PaintRecordForCurrentFrame(const KURL& url) { ...@@ -569,7 +560,7 @@ sk_sp<PaintRecord> SVGImage::PaintRecordForCurrentFrame(const KURL& url) {
// Always call processUrlFragment, even if the url is empty, because // Always call processUrlFragment, even if the url is empty, because
// there may have been a previous url/fragment that needs to be reset. // there may have been a previous url/fragment that needs to be reset.
view->ProcessUrlFragment(url, /*same_document_navigation=*/false); view->ProcessUrlFragment(draw_info.Url(), /*same_document_navigation=*/false);
// If the image was reset, we need to rewind the timeline back to 0. This // If the image was reset, we need to rewind the timeline back to 0. This
// needs to be done before painting, or else we wouldn't get the correct // needs to be done before painting, or else we wouldn't get the correct
...@@ -589,11 +580,23 @@ sk_sp<PaintRecord> SVGImage::PaintRecordForCurrentFrame(const KURL& url) { ...@@ -589,11 +580,23 @@ sk_sp<PaintRecord> SVGImage::PaintRecordForCurrentFrame(const KURL& url) {
return builder.EndRecording(); return builder.EndRecording();
} }
void SVGImage::DrawInternal(cc::PaintCanvas* canvas, static bool DrawNeedsLayer(const PaintFlags& flags) {
if (SkColorGetA(flags.getColor()) < 255)
return true;
// This is needed to preserve the dark mode filter that
// has been set in GraphicsContext.
if (flags.getColorFilter())
return true;
return flags.getBlendMode() != SkBlendMode::kSrcOver;
}
void SVGImage::DrawInternal(const DrawInfo& draw_info,
cc::PaintCanvas* canvas,
const PaintFlags& flags, const PaintFlags& flags,
const FloatRect& dst_rect, const FloatRect& dst_rect,
const FloatRect& src_rect, const FloatRect& src_rect) {
const KURL& url) {
{ {
PaintCanvasAutoRestore ar(canvas, false); PaintCanvasAutoRestore ar(canvas, false);
if (DrawNeedsLayer(flags)) { if (DrawNeedsLayer(flags)) {
...@@ -607,7 +610,7 @@ void SVGImage::DrawInternal(cc::PaintCanvas* canvas, ...@@ -607,7 +610,7 @@ void SVGImage::DrawInternal(cc::PaintCanvas* canvas,
canvas->clipRect(EnclosingIntRect(dst_rect)); canvas->clipRect(EnclosingIntRect(dst_rect));
canvas->concat(SkMatrix::MakeRectToRect(src_rect, dst_rect, canvas->concat(SkMatrix::MakeRectToRect(src_rect, dst_rect,
SkMatrix::kFill_ScaleToFit)); SkMatrix::kFill_ScaleToFit));
canvas->drawPicture(PaintRecordForCurrentFrame(url)); canvas->drawPicture(PaintRecordForCurrentFrame(draw_info));
canvas->restore(); canvas->restore();
} }
......
...@@ -144,6 +144,22 @@ class CORE_EXPORT SVGImage final : public Image { ...@@ -144,6 +144,22 @@ class CORE_EXPORT SVGImage final : public Image {
// FIXME: Implement this to be less conservative. // FIXME: Implement this to be less conservative.
bool CurrentFrameKnownToBeOpaque() override { return false; } bool CurrentFrameKnownToBeOpaque() override { return false; }
class DrawInfo {
STACK_ALLOCATED();
public:
DrawInfo(const FloatSize& container_size, float zoom, const KURL& url);
float Zoom() const { return zoom_; }
const FloatSize& ContainerSize() const { return container_size_; }
const KURL& Url() const { return url_; }
private:
const FloatSize container_size_;
const float zoom_;
const KURL& url_;
};
void Draw(cc::PaintCanvas*, void Draw(cc::PaintCanvas*,
const cc::PaintFlags&, const cc::PaintFlags&,
const FloatRect& dst_rect, const FloatRect& dst_rect,
...@@ -151,50 +167,41 @@ class CORE_EXPORT SVGImage final : public Image { ...@@ -151,50 +167,41 @@ class CORE_EXPORT SVGImage final : public Image {
RespectImageOrientationEnum, RespectImageOrientationEnum,
ImageClampingMode, ImageClampingMode,
ImageDecodingMode) override; ImageDecodingMode) override;
void DrawForContainer(cc::PaintCanvas*, void DrawForContainer(const DrawInfo&,
cc::PaintCanvas*,
const cc::PaintFlags&, const cc::PaintFlags&,
const FloatSize&, const FloatRect& dst_rect,
float, const FloatRect& src_rect);
const FloatRect&, void DrawPatternForContainer(const DrawInfo&,
const FloatRect&, GraphicsContext&,
const KURL&); const FloatRect& src_rect,
void DrawPatternForContainer(GraphicsContext&, const FloatSize& tile_scale,
const FloatSize, const FloatPoint& phase,
float, SkBlendMode composite_op,
const FloatRect&, const FloatRect& dst_rect,
const FloatSize&, const FloatSize& repeat_spacing);
const FloatPoint&, void PopulatePaintRecordForCurrentFrameForContainer(const DrawInfo&,
SkBlendMode, PaintImageBuilder&);
const FloatRect&,
const FloatSize& repeat_spacing,
const KURL&);
void PopulatePaintRecordForCurrentFrameForContainer(
PaintImageBuilder&,
const IntSize& container_size,
float zoom,
const KURL&);
// Paints the current frame. Returns new PaintRecord. // Paints the current frame. Returns new PaintRecord.
sk_sp<PaintRecord> PaintRecordForCurrentFrame(const KURL&); sk_sp<PaintRecord> PaintRecordForCurrentFrame(const DrawInfo&);
void DrawInternal(cc::PaintCanvas*, void DrawInternal(const DrawInfo&,
cc::PaintCanvas*,
const cc::PaintFlags&, const cc::PaintFlags&,
const FloatRect& dst_rect, const FloatRect& dst_rect,
const FloatRect& src_rect, const FloatRect& src_rect);
const KURL&);
template <typename Func> template <typename Func>
void ForContainer(const FloatSize&, Func&&); void ForContainer(const DrawInfo&, Func&&);
bool ApplyShader(cc::PaintFlags&, const SkMatrix& local_matrix) override; bool ApplyShader(cc::PaintFlags&, const SkMatrix& local_matrix) override;
bool ApplyShaderForContainer(const FloatSize&, bool ApplyShaderForContainer(const DrawInfo&,
float zoom,
const KURL&,
cc::PaintFlags&, cc::PaintFlags&,
const SkMatrix& local_matrix); const SkMatrix& local_matrix);
bool ApplyShaderInternal(cc::PaintFlags&, bool ApplyShaderInternal(const DrawInfo&,
const SkMatrix& local_matrix, cc::PaintFlags&,
const KURL&); const SkMatrix& local_matrix);
void StopAnimation(); void StopAnimation();
void ScheduleTimelineRewind(); void ScheduleTimelineRewind();
......
...@@ -19,12 +19,6 @@ ...@@ -19,12 +19,6 @@
#include "third_party/blink/renderer/core/svg/graphics/svg_image_for_container.h" #include "third_party/blink/renderer/core/svg/graphics/svg_image_for_container.h"
#include "base/memory/scoped_refptr.h"
#include "third_party/blink/renderer/platform/geometry/float_rect.h"
#include "third_party/blink/renderer/platform/geometry/float_size.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkImage.h"
namespace blink { namespace blink {
IntSize SVGImageForContainer::Size() const { IntSize SVGImageForContainer::Size() const {
...@@ -34,9 +28,7 @@ IntSize SVGImageForContainer::Size() const { ...@@ -34,9 +28,7 @@ IntSize SVGImageForContainer::Size() const {
} }
FloatSize SVGImageForContainer::SizeAsFloat(RespectImageOrientationEnum) const { FloatSize SVGImageForContainer::SizeAsFloat(RespectImageOrientationEnum) const {
FloatSize scaled_container_size(container_size_); return container_size_.ScaledBy(zoom_);
scaled_container_size.Scale(zoom_);
return scaled_container_size;
} }
void SVGImageForContainer::Draw(cc::PaintCanvas* canvas, void SVGImageForContainer::Draw(cc::PaintCanvas* canvas,
...@@ -46,8 +38,8 @@ void SVGImageForContainer::Draw(cc::PaintCanvas* canvas, ...@@ -46,8 +38,8 @@ void SVGImageForContainer::Draw(cc::PaintCanvas* canvas,
RespectImageOrientationEnum, RespectImageOrientationEnum,
ImageClampingMode, ImageClampingMode,
ImageDecodingMode) { ImageDecodingMode) {
image_->DrawForContainer(canvas, flags, container_size_, zoom_, dst_rect, const SVGImage::DrawInfo draw_info(container_size_, zoom_, url_);
src_rect, url_); image_->DrawForContainer(draw_info, canvas, flags, dst_rect, src_rect);
} }
void SVGImageForContainer::DrawPattern(GraphicsContext& context, void SVGImageForContainer::DrawPattern(GraphicsContext& context,
...@@ -58,21 +50,21 @@ void SVGImageForContainer::DrawPattern(GraphicsContext& context, ...@@ -58,21 +50,21 @@ void SVGImageForContainer::DrawPattern(GraphicsContext& context,
const FloatRect& dst_rect, const FloatRect& dst_rect,
const FloatSize& repeat_spacing, const FloatSize& repeat_spacing,
RespectImageOrientationEnum) { RespectImageOrientationEnum) {
image_->DrawPatternForContainer(context, container_size_, zoom_, src_rect, const SVGImage::DrawInfo draw_info(container_size_, zoom_, url_);
scale, phase, op, dst_rect, repeat_spacing, image_->DrawPatternForContainer(draw_info, context, src_rect, scale, phase,
url_); op, dst_rect, repeat_spacing);
} }
bool SVGImageForContainer::ApplyShader(cc::PaintFlags& flags, bool SVGImageForContainer::ApplyShader(cc::PaintFlags& flags,
const SkMatrix& local_matrix) { const SkMatrix& local_matrix) {
return image_->ApplyShaderForContainer(container_size_, zoom_, url_, flags, const SVGImage::DrawInfo draw_info(container_size_, zoom_, url_);
local_matrix); return image_->ApplyShaderForContainer(draw_info, flags, local_matrix);
} }
PaintImage SVGImageForContainer::PaintImageForCurrentFrame() { PaintImage SVGImageForContainer::PaintImageForCurrentFrame() {
const SVGImage::DrawInfo draw_info(container_size_, zoom_, url_);
auto builder = CreatePaintImageBuilder(); auto builder = CreatePaintImageBuilder();
image_->PopulatePaintRecordForCurrentFrameForContainer(builder, Size(), zoom_, image_->PopulatePaintRecordForCurrentFrameForContainer(draw_info, builder);
url_);
return builder.TakePaintImage(); return builder.TakePaintImage();
} }
......
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
#include "third_party/blink/renderer/platform/geometry/float_size.h" #include "third_party/blink/renderer/platform/geometry/float_size.h"
#include "third_party/blink/renderer/platform/graphics/image.h" #include "third_party/blink/renderer/platform/graphics/image.h"
#include "third_party/blink/renderer/platform/weborigin/kurl.h" #include "third_party/blink/renderer/platform/weborigin/kurl.h"
#include "third_party/skia/include/core/SkRefCnt.h"
namespace blink { namespace blink {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment