Commit a11f72c8 authored by jstenback's avatar jstenback Committed by Commit bot

Remove unnecessary zoom argument from GetImage() as its value is always...

Remove unnecessary zoom argument from GetImage() as its value is always available through the LayoutObject argument. (rebased)

BUG=716203
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2847303002
Cr-Commit-Position: refs/heads/master@{#469560}
parent 617af2a7
...@@ -114,15 +114,14 @@ void CSSImageGeneratorValue::PutImage(const IntSize& size, ...@@ -114,15 +114,14 @@ void CSSImageGeneratorValue::PutImage(const IntSize& size,
PassRefPtr<Image> CSSImageGeneratorValue::GetImage( PassRefPtr<Image> CSSImageGeneratorValue::GetImage(
const LayoutObject& layout_object, const LayoutObject& layout_object,
const IntSize& size, const IntSize& size) {
float zoom) {
switch (GetClassType()) { switch (GetClassType()) {
case kCrossfadeClass: case kCrossfadeClass:
return ToCSSCrossfadeValue(this)->GetImage(layout_object, size); return ToCSSCrossfadeValue(this)->GetImage(layout_object, size);
case kLinearGradientClass: case kLinearGradientClass:
return ToCSSLinearGradientValue(this)->GetImage(layout_object, size); return ToCSSLinearGradientValue(this)->GetImage(layout_object, size);
case kPaintClass: case kPaintClass:
return ToCSSPaintValue(this)->GetImage(layout_object, size, zoom); return ToCSSPaintValue(this)->GetImage(layout_object, size);
case kRadialGradientClass: case kRadialGradientClass:
return ToCSSRadialGradientValue(this)->GetImage(layout_object, size); return ToCSSRadialGradientValue(this)->GetImage(layout_object, size);
case kConicGradientClass: case kConicGradientClass:
......
...@@ -57,7 +57,7 @@ class CORE_EXPORT CSSImageGeneratorValue : public CSSValue { ...@@ -57,7 +57,7 @@ class CORE_EXPORT CSSImageGeneratorValue : public CSSValue {
void AddClient(const LayoutObject*, const IntSize&); void AddClient(const LayoutObject*, const IntSize&);
void RemoveClient(const LayoutObject*); void RemoveClient(const LayoutObject*);
PassRefPtr<Image> GetImage(const LayoutObject&, const IntSize&, float zoom); PassRefPtr<Image> GetImage(const LayoutObject&, const IntSize&);
bool IsFixedSize() const; bool IsFixedSize() const;
IntSize FixedSize(const LayoutObject&, const FloatSize& default_object_size); IntSize FixedSize(const LayoutObject&, const FloatSize& default_object_size);
......
...@@ -49,7 +49,6 @@ class CORE_EXPORT CSSPaintImageGenerator ...@@ -49,7 +49,6 @@ class CORE_EXPORT CSSPaintImageGenerator
// representing an invalid image if an error occurred. // representing an invalid image if an error occurred.
virtual PassRefPtr<Image> Paint(const LayoutObject&, virtual PassRefPtr<Image> Paint(const LayoutObject&,
const IntSize&, const IntSize&,
float zoom,
const CSSStyleValueVector*) = 0; const CSSStyleValueVector*) = 0;
virtual const Vector<CSSPropertyID>& NativeInvalidationProperties() const = 0; virtual const Vector<CSSPropertyID>& NativeInvalidationProperties() const = 0;
......
...@@ -43,8 +43,7 @@ String CSSPaintValue::GetName() const { ...@@ -43,8 +43,7 @@ String CSSPaintValue::GetName() const {
} }
PassRefPtr<Image> CSSPaintValue::GetImage(const LayoutObject& layout_object, PassRefPtr<Image> CSSPaintValue::GetImage(const LayoutObject& layout_object,
const IntSize& size, const IntSize& size) {
float zoom) {
if (!generator_) if (!generator_)
generator_ = generator_ =
CSSPaintImageGenerator::Create(GetName(), layout_object.GetDocument(), CSSPaintImageGenerator::Create(GetName(), layout_object.GetDocument(),
...@@ -53,7 +52,7 @@ PassRefPtr<Image> CSSPaintValue::GetImage(const LayoutObject& layout_object, ...@@ -53,7 +52,7 @@ PassRefPtr<Image> CSSPaintValue::GetImage(const LayoutObject& layout_object,
if (!ParseInputArguments()) if (!ParseInputArguments())
return nullptr; return nullptr;
return generator_->Paint(layout_object, size, zoom, parsed_input_arguments_); return generator_->Paint(layout_object, size, parsed_input_arguments_);
} }
bool CSSPaintValue::ParseInputArguments() { bool CSSPaintValue::ParseInputArguments() {
......
...@@ -31,7 +31,7 @@ class CSSPaintValue : public CSSImageGeneratorValue { ...@@ -31,7 +31,7 @@ class CSSPaintValue : public CSSImageGeneratorValue {
String GetName() const; String GetName() const;
PassRefPtr<Image> GetImage(const LayoutObject&, const IntSize&, float zoom); PassRefPtr<Image> GetImage(const LayoutObject&, const IntSize&);
bool IsFixedSize() const { return false; } bool IsFixedSize() const { return false; }
IntSize FixedSize(const LayoutObject&) { return IntSize(); } IntSize FixedSize(const LayoutObject&) { return IntSize(); }
......
...@@ -94,8 +94,8 @@ LayoutSize LayoutImageResource::ImageSize(float multiplier) const { ...@@ -94,8 +94,8 @@ LayoutSize LayoutImageResource::ImageSize(float multiplier) const {
return size; return size;
} }
PassRefPtr<Image> LayoutImageResource::GetImage(const IntSize& container_size, PassRefPtr<Image> LayoutImageResource::GetImage(
float zoom) const { const IntSize& container_size) const {
if (!cached_image_) if (!cached_image_)
return Image::NullImage(); return Image::NullImage();
...@@ -109,7 +109,9 @@ PassRefPtr<Image> LayoutImageResource::GetImage(const IntSize& container_size, ...@@ -109,7 +109,9 @@ PassRefPtr<Image> LayoutImageResource::GetImage(const IntSize& container_size,
const AtomicString& url_string = ToElement(node)->ImageSourceURL(); const AtomicString& url_string = ToElement(node)->ImageSourceURL();
url = node->GetDocument().CompleteURL(url_string); url = node->GetDocument().CompleteURL(url_string);
} }
return SVGImageForContainer::Create(svg_image, container_size, zoom, url); return SVGImageForContainer::Create(
svg_image, container_size, layout_object_->StyleRef().EffectiveZoom(),
url);
} }
bool LayoutImageResource::MaybeAnimated() const { bool LayoutImageResource::MaybeAnimated() const {
......
...@@ -53,7 +53,7 @@ class LayoutImageResource ...@@ -53,7 +53,7 @@ class LayoutImageResource
void ResetAnimation(); void ResetAnimation();
bool MaybeAnimated() const; bool MaybeAnimated() const;
virtual PassRefPtr<Image> GetImage(const IntSize&, float) const; virtual PassRefPtr<Image> GetImage(const IntSize&) const;
virtual bool ErrorOccurred() const { virtual bool ErrorOccurred() const {
return cached_image_ && cached_image_->ErrorOccurred(); return cached_image_ && cached_image_->ErrorOccurred();
} }
......
...@@ -58,13 +58,13 @@ void LayoutImageResourceStyleImage::Shutdown() { ...@@ -58,13 +58,13 @@ void LayoutImageResourceStyleImage::Shutdown() {
cached_image_ = nullptr; cached_image_ = nullptr;
} }
PassRefPtr<Image> LayoutImageResourceStyleImage::GetImage(const IntSize& size, PassRefPtr<Image> LayoutImageResourceStyleImage::GetImage(
float zoom) const { const IntSize& size) const {
// Generated content may trigger calls to image() while we're still pending, // Generated content may trigger calls to image() while we're still pending,
// don't assert but gracefully exit. // don't assert but gracefully exit.
if (style_image_->IsPendingImage()) if (style_image_->IsPendingImage())
return nullptr; return nullptr;
return style_image_->GetImage(*layout_object_, size, zoom); return style_image_->GetImage(*layout_object_, size);
} }
LayoutSize LayoutImageResourceStyleImage::ImageSize(float multiplier) const { LayoutSize LayoutImageResourceStyleImage::ImageSize(float multiplier) const {
......
...@@ -46,7 +46,7 @@ class LayoutImageResourceStyleImage final : public LayoutImageResource { ...@@ -46,7 +46,7 @@ class LayoutImageResourceStyleImage final : public LayoutImageResource {
void Shutdown() override; void Shutdown() override;
bool HasImage() const override { return true; } bool HasImage() const override { return true; }
PassRefPtr<Image> GetImage(const IntSize&, float) const override; PassRefPtr<Image> GetImage(const IntSize&) const override;
bool ErrorOccurred() const override { return style_image_->ErrorOccurred(); } bool ErrorOccurred() const override { return style_image_->ErrorOccurred(); }
bool ImageHasRelativeSize() const override { bool ImageHasRelativeSize() const override {
......
...@@ -792,7 +792,7 @@ class CORE_EXPORT LayoutObject : public ImageResourceObserver, ...@@ -792,7 +792,7 @@ class CORE_EXPORT LayoutObject : public ImageResourceObserver,
bool HasLayer() const { return bitfields_.HasLayer(); } bool HasLayer() const { return bitfields_.HasLayer(); }
// This may be different from styleRef().hasBoxDecorationBackground() because // This may be different from StyleRef().hasBoxDecorationBackground() because
// some objects may have box decoration background other than from their own // some objects may have box decoration background other than from their own
// style. // style.
bool HasBoxDecorationBackground() const { bool HasBoxDecorationBackground() const {
...@@ -1341,8 +1341,8 @@ class CORE_EXPORT LayoutObject : public ImageResourceObserver, ...@@ -1341,8 +1341,8 @@ class CORE_EXPORT LayoutObject : public ImageResourceObserver,
const ComputedStyle* Style() const { return style_.Get(); } const ComputedStyle* Style() const { return style_.Get(); }
ComputedStyle* MutableStyle() const { return style_.Get(); } ComputedStyle* MutableStyle() const { return style_.Get(); }
// m_style can only be nullptr before the first style is set, thus most // style_ can only be nullptr before the first style is set, thus most
// callers will never see a nullptr style and should use styleRef(). // callers will never see a nullptr style and should use StyleRef().
// FIXME: It would be better if style() returned a const reference. // FIXME: It would be better if style() returned a const reference.
const ComputedStyle& StyleRef() const { return MutableStyleRef(); } const ComputedStyle& StyleRef() const { return MutableStyleRef(); }
ComputedStyle& MutableStyleRef() const { ComputedStyle& MutableStyleRef() const {
...@@ -2006,7 +2006,7 @@ class CORE_EXPORT LayoutObject : public ImageResourceObserver, ...@@ -2006,7 +2006,7 @@ class CORE_EXPORT LayoutObject : public ImageResourceObserver,
}; };
virtual bool IsOfType(LayoutObjectType type) const { return false; } virtual bool IsOfType(LayoutObjectType type) const { return false; }
// Overrides should call the superclass at the end. m_style will be 0 the // Overrides should call the superclass at the end. style_ will be 0 the
// first time this function will be called. // first time this function will be called.
virtual void StyleWillChange(StyleDifference, const ComputedStyle& new_style); virtual void StyleWillChange(StyleDifference, const ComputedStyle& new_style);
// Overrides should call the superclass at the start. |oldStyle| will be 0 the // Overrides should call the superclass at the start. |oldStyle| will be 0 the
......
...@@ -170,8 +170,7 @@ std::unique_ptr<Shape> ShapeOutsideInfo::CreateShapeForImage( ...@@ -170,8 +170,7 @@ std::unique_ptr<Shape> ShapeOutsideInfo::CreateShapeForImage(
DCHECK(!style_image->IsPendingImage()); DCHECK(!style_image->IsPendingImage());
RefPtr<Image> image = RefPtr<Image> image =
style_image->GetImage(layout_box_, FlooredIntSize(image_size), style_image->GetImage(layout_box_, FlooredIntSize(image_size));
layout_box_.Style()->EffectiveZoom());
return Shape::CreateRasterShape(image.Get(), shape_image_threshold, return Shape::CreateRasterShape(image.Get(), shape_image_threshold,
image_rect, margin_rect, writing_mode, image_rect, margin_rect, writing_mode,
......
...@@ -442,8 +442,7 @@ class ImagePaintContext { ...@@ -442,8 +442,7 @@ class ImagePaintContext {
const LayoutObject& image_client = const LayoutObject& image_client =
background_object ? *background_object : obj; background_object ? *background_object : obj;
image_ = style_image.GetImage(image_client, FlooredIntSize(container_size), image_ = style_image.GetImage(image_client, FlooredIntSize(container_size));
obj.Style()->EffectiveZoom());
interpolation_quality_ = BoxPainter::ChooseInterpolationQuality( interpolation_quality_ = BoxPainter::ChooseInterpolationQuality(
image_client, image_.Get(), &layer, container_size); image_client, image_.Get(), &layer, container_size);
......
...@@ -143,8 +143,8 @@ void ImagePainter::PaintIntoRect(GraphicsContext& context, ...@@ -143,8 +143,8 @@ void ImagePainter::PaintIntoRect(GraphicsContext& context,
if (pixel_snapped_dest_rect.IsEmpty()) if (pixel_snapped_dest_rect.IsEmpty())
return; return;
RefPtr<Image> image = layout_image_.ImageResource()->GetImage( RefPtr<Image> image =
pixel_snapped_dest_rect.Size(), layout_image_.Style()->EffectiveZoom()); layout_image_.ImageResource()->GetImage(pixel_snapped_dest_rect.Size());
if (!image || image->IsNull()) if (!image || image->IsNull())
return; return;
......
...@@ -72,10 +72,8 @@ void ListMarkerPainter::Paint(const PaintInfo& paint_info, ...@@ -72,10 +72,8 @@ void ListMarkerPainter::Paint(const PaintInfo& paint_info,
GraphicsContext& context = paint_info.context; GraphicsContext& context = paint_info.context;
if (layout_list_marker_.IsImage()) { if (layout_list_marker_.IsImage()) {
context.DrawImage( context.DrawImage(layout_list_marker_.GetImage()
layout_list_marker_.GetImage() ->GetImage(layout_list_marker_, marker.Size())
->GetImage(layout_list_marker_, marker.Size(),
layout_list_marker_.StyleRef().EffectiveZoom())
.Get(), .Get(),
marker); marker);
if (layout_list_marker_.GetSelectionState() != SelectionNone) { if (layout_list_marker_.GetSelectionState() != SelectionNone) {
......
...@@ -63,8 +63,7 @@ bool NinePieceImagePainter::Paint(GraphicsContext& graphics_context, ...@@ -63,8 +63,7 @@ bool NinePieceImagePainter::Paint(GraphicsContext& graphics_context,
PixelSnappedIntRect(border_image_rect), PixelSnappedIntRect(border_image_rect),
border_widths); border_widths);
RefPtr<Image> image = RefPtr<Image> image = style_image->GetImage(layout_object_, image_size);
style_image->GetImage(layout_object_, image_size, style.EffectiveZoom());
InterpolationQuality interpolation_quality = InterpolationQuality interpolation_quality =
BoxPainter::ChooseInterpolationQuality(layout_object_, image.Get(), 0, BoxPainter::ChooseInterpolationQuality(layout_object_, image.Get(), 0,
......
...@@ -62,8 +62,7 @@ void SVGImagePainter::PaintForeground(const PaintInfo& paint_info) { ...@@ -62,8 +62,7 @@ void SVGImagePainter::PaintForeground(const PaintInfo& paint_info) {
if (image_viewport_size.IsEmpty()) if (image_viewport_size.IsEmpty())
return; return;
RefPtr<Image> image = image_resource->GetImage( RefPtr<Image> image = image_resource->GetImage(image_viewport_size);
image_viewport_size, layout_svg_image_.Style()->EffectiveZoom());
FloatRect dest_rect = layout_svg_image_.ObjectBoundingBox(); FloatRect dest_rect = layout_svg_image_.ObjectBoundingBox();
FloatRect src_rect(0, 0, image->width(), image->height()); FloatRect src_rect(0, 0, image->width(), image->height());
......
...@@ -117,14 +117,15 @@ void StyleFetchedImage::ImageNotifyFinished(ImageResourceContent*) { ...@@ -117,14 +117,15 @@ void StyleFetchedImage::ImageNotifyFinished(ImageResourceContent*) {
document_.Clear(); document_.Clear();
} }
PassRefPtr<Image> StyleFetchedImage::GetImage(const LayoutObject&, PassRefPtr<Image> StyleFetchedImage::GetImage(
const IntSize& container_size, const LayoutObject& obj,
float zoom) const { const IntSize& container_size) const {
if (!image_->GetImage()->IsSVGImage()) if (!image_->GetImage()->IsSVGImage())
return image_->GetImage(); return image_->GetImage();
return SVGImageForContainer::Create(ToSVGImage(image_->GetImage()), return SVGImageForContainer::Create(ToSVGImage(image_->GetImage()),
container_size, zoom, url_); container_size,
obj.StyleRef().EffectiveZoom(), url_);
} }
bool StyleFetchedImage::KnownToBeOpaque( bool StyleFetchedImage::KnownToBeOpaque(
......
...@@ -62,8 +62,7 @@ class StyleFetchedImage final : public StyleImage, ...@@ -62,8 +62,7 @@ class StyleFetchedImage final : public StyleImage,
void ImageNotifyFinished(ImageResourceContent*) override; void ImageNotifyFinished(ImageResourceContent*) override;
String DebugName() const override { return "StyleFetchedImage"; } String DebugName() const override { return "StyleFetchedImage"; }
PassRefPtr<Image> GetImage(const LayoutObject&, PassRefPtr<Image> GetImage(const LayoutObject&,
const IntSize&, const IntSize&) const override;
float zoom) const override;
bool KnownToBeOpaque(const LayoutObject&) const override; bool KnownToBeOpaque(const LayoutObject&) const override;
ImageResourceContent* CachedImage() const override; ImageResourceContent* CachedImage() const override;
......
...@@ -115,14 +115,15 @@ void StyleFetchedImageSet::RemoveClient(LayoutObject* layout_object) { ...@@ -115,14 +115,15 @@ void StyleFetchedImageSet::RemoveClient(LayoutObject* layout_object) {
best_fit_image_->RemoveObserver(layout_object); best_fit_image_->RemoveObserver(layout_object);
} }
PassRefPtr<Image> StyleFetchedImageSet::GetImage(const LayoutObject&, PassRefPtr<Image> StyleFetchedImageSet::GetImage(
const IntSize& container_size, const LayoutObject& obj,
float zoom) const { const IntSize& container_size) const {
if (!best_fit_image_->GetImage()->IsSVGImage()) if (!best_fit_image_->GetImage()->IsSVGImage())
return best_fit_image_->GetImage(); return best_fit_image_->GetImage();
return SVGImageForContainer::Create(ToSVGImage(best_fit_image_->GetImage()), return SVGImageForContainer::Create(ToSVGImage(best_fit_image_->GetImage()),
container_size, zoom, url_); container_size,
obj.StyleRef().EffectiveZoom(), url_);
} }
bool StyleFetchedImageSet::KnownToBeOpaque( bool StyleFetchedImageSet::KnownToBeOpaque(
......
...@@ -69,8 +69,7 @@ class StyleFetchedImageSet final : public StyleImage, ...@@ -69,8 +69,7 @@ class StyleFetchedImageSet final : public StyleImage,
void AddClient(LayoutObject*) override; void AddClient(LayoutObject*) override;
void RemoveClient(LayoutObject*) override; void RemoveClient(LayoutObject*) override;
PassRefPtr<Image> GetImage(const LayoutObject&, PassRefPtr<Image> GetImage(const LayoutObject&,
const IntSize&, const IntSize&) const override;
float) const override;
float ImageScaleFactor() const override { return image_scale_factor_; } float ImageScaleFactor() const override { return image_scale_factor_; }
bool KnownToBeOpaque(const LayoutObject&) const override; bool KnownToBeOpaque(const LayoutObject&) const override;
ImageResourceContent* CachedImage() const override; ImageResourceContent* CachedImage() const override;
......
...@@ -69,9 +69,8 @@ void StyleGeneratedImage::RemoveClient(LayoutObject* layout_object) { ...@@ -69,9 +69,8 @@ void StyleGeneratedImage::RemoveClient(LayoutObject* layout_object) {
PassRefPtr<Image> StyleGeneratedImage::GetImage( PassRefPtr<Image> StyleGeneratedImage::GetImage(
const LayoutObject& layout_object, const LayoutObject& layout_object,
const IntSize& size, const IntSize& size) const {
float zoom) const { return image_generator_value_->GetImage(layout_object, size);
return image_generator_value_->GetImage(layout_object, size, zoom);
} }
bool StyleGeneratedImage::KnownToBeOpaque( bool StyleGeneratedImage::KnownToBeOpaque(
......
...@@ -51,8 +51,7 @@ class CORE_EXPORT StyleGeneratedImage final : public StyleImage { ...@@ -51,8 +51,7 @@ class CORE_EXPORT StyleGeneratedImage final : public StyleImage {
void AddClient(LayoutObject*) override; void AddClient(LayoutObject*) override;
void RemoveClient(LayoutObject*) override; void RemoveClient(LayoutObject*) override;
PassRefPtr<Image> GetImage(const LayoutObject&, PassRefPtr<Image> GetImage(const LayoutObject&,
const IntSize&, const IntSize&) const override;
float) const override;
bool KnownToBeOpaque(const LayoutObject&) const override; bool KnownToBeOpaque(const LayoutObject&) const override;
DECLARE_VIRTUAL_TRACE(); DECLARE_VIRTUAL_TRACE();
......
...@@ -63,12 +63,11 @@ class CORE_EXPORT StyleImage : public GarbageCollectedFinalized<StyleImage> { ...@@ -63,12 +63,11 @@ class CORE_EXPORT StyleImage : public GarbageCollectedFinalized<StyleImage> {
virtual bool UsesImageContainerSize() const = 0; virtual bool UsesImageContainerSize() const = 0;
virtual void AddClient(LayoutObject*) = 0; virtual void AddClient(LayoutObject*) = 0;
virtual void RemoveClient(LayoutObject*) = 0; virtual void RemoveClient(LayoutObject*) = 0;
// Note that the containerSize is assumed to be in the effective // Note that the container_size is in the effective zoom level of
// zoom level given by multiplier, i.e if the multiplier is the // the style that applies to the given LayoutObject, i.e if the zoom
// constant 1 the containerSize should be unzoomed. // level is 1.0 the container_size should be unzoomed.
virtual PassRefPtr<Image> GetImage(const LayoutObject&, virtual PassRefPtr<Image> GetImage(const LayoutObject&,
const IntSize& container_size, const IntSize& container_size) const = 0;
float multiplier) const = 0;
virtual WrappedImagePtr Data() const = 0; virtual WrappedImagePtr Data() const = 0;
virtual float ImageScaleFactor() const { return 1; } virtual float ImageScaleFactor() const { return 1; }
virtual bool KnownToBeOpaque(const LayoutObject&) const = 0; virtual bool KnownToBeOpaque(const LayoutObject&) const = 0;
......
...@@ -34,8 +34,7 @@ class StyleInvalidImage final : public StyleImage { ...@@ -34,8 +34,7 @@ class StyleInvalidImage final : public StyleImage {
void AddClient(LayoutObject*) override {} void AddClient(LayoutObject*) override {}
void RemoveClient(LayoutObject*) override {} void RemoveClient(LayoutObject*) override {}
PassRefPtr<Image> GetImage(const LayoutObject&, PassRefPtr<Image> GetImage(const LayoutObject&,
const IntSize&, const IntSize&) const override {
float) const override {
return nullptr; return nullptr;
} }
bool KnownToBeOpaque(const LayoutObject&) const override { return false; } bool KnownToBeOpaque(const LayoutObject&) const override { return false; }
......
...@@ -80,8 +80,7 @@ class StylePendingImage final : public StyleImage { ...@@ -80,8 +80,7 @@ class StylePendingImage final : public StyleImage {
void AddClient(LayoutObject*) override {} void AddClient(LayoutObject*) override {}
void RemoveClient(LayoutObject*) override {} void RemoveClient(LayoutObject*) override {}
PassRefPtr<Image> GetImage(const LayoutObject&, PassRefPtr<Image> GetImage(const LayoutObject&,
const IntSize&, const IntSize&) const override {
float) const override {
NOTREACHED(); NOTREACHED();
return nullptr; return nullptr;
} }
......
...@@ -69,10 +69,10 @@ CSSPaintDefinition::~CSSPaintDefinition() {} ...@@ -69,10 +69,10 @@ CSSPaintDefinition::~CSSPaintDefinition() {}
PassRefPtr<Image> CSSPaintDefinition::Paint( PassRefPtr<Image> CSSPaintDefinition::Paint(
const LayoutObject& layout_object, const LayoutObject& layout_object,
const IntSize& size, const IntSize& size,
float zoom,
const CSSStyleValueVector* paint_arguments) { const CSSStyleValueVector* paint_arguments) {
DCHECK(paint_arguments); DCHECK(paint_arguments);
float zoom = layout_object.StyleRef().EffectiveZoom();
const IntSize specified_size = GetSpecifiedSize(size, zoom); const IntSize specified_size = GetSpecifiedSize(size, zoom);
ScriptState::Scope scope(script_state_.Get()); ScriptState::Scope scope(script_state_.Get());
......
...@@ -43,7 +43,6 @@ class CSSPaintDefinition final ...@@ -43,7 +43,6 @@ class CSSPaintDefinition final
// throws an error. // throws an error.
PassRefPtr<Image> Paint(const LayoutObject&, PassRefPtr<Image> Paint(const LayoutObject&,
const IntSize&, const IntSize&,
float zoom,
const CSSStyleValueVector*); const CSSStyleValueVector*);
const Vector<CSSPropertyID>& NativeInvalidationProperties() const { const Vector<CSSPropertyID>& NativeInvalidationProperties() const {
return native_invalidation_properties_; return native_invalidation_properties_;
......
...@@ -52,10 +52,8 @@ void CSSPaintImageGeneratorImpl::SetDefinition(CSSPaintDefinition* definition) { ...@@ -52,10 +52,8 @@ void CSSPaintImageGeneratorImpl::SetDefinition(CSSPaintDefinition* definition) {
PassRefPtr<Image> CSSPaintImageGeneratorImpl::Paint( PassRefPtr<Image> CSSPaintImageGeneratorImpl::Paint(
const LayoutObject& layout_object, const LayoutObject& layout_object,
const IntSize& size, const IntSize& size,
float zoom,
const CSSStyleValueVector* data) { const CSSStyleValueVector* data) {
return definition_ ? definition_->Paint(layout_object, size, zoom, data) return definition_ ? definition_->Paint(layout_object, size, data) : nullptr;
: nullptr;
} }
const Vector<CSSPropertyID>& const Vector<CSSPropertyID>&
......
...@@ -28,7 +28,6 @@ class CSSPaintImageGeneratorImpl final : public CSSPaintImageGenerator { ...@@ -28,7 +28,6 @@ class CSSPaintImageGeneratorImpl final : public CSSPaintImageGenerator {
PassRefPtr<Image> Paint(const LayoutObject&, PassRefPtr<Image> Paint(const LayoutObject&,
const IntSize&, const IntSize&,
float zoom,
const CSSStyleValueVector*) final; const CSSStyleValueVector*) final;
const Vector<CSSPropertyID>& NativeInvalidationProperties() const final; const Vector<CSSPropertyID>& NativeInvalidationProperties() const final;
const Vector<AtomicString>& CustomInvalidationProperties() const final; const Vector<AtomicString>& CustomInvalidationProperties() const final;
......
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