WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
108108
SVGImage::drawSVGToImageBuffer can combine zoom and scale.
https://bugs.webkit.org/show_bug.cgi?id=108108
Summary
SVGImage::drawSVGToImageBuffer can combine zoom and scale.
Philip Rogers
Reported
2013-01-28 13:28:52 PST
At the moment SVGImage::drawSVGToImageBuffer handles zoom and scale separately which is unnecessary. We still need to track zoom and scale separately as a key in our image cache (for the moment), but we can combine these for drawing.
Attachments
First pass at a single zoomAndScale parameter
(14.34 KB, patch)
2013-01-28 14:16 PST
,
Philip Rogers
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Philip Rogers
Comment 1
2013-01-28 14:16:14 PST
Created
attachment 185061
[details]
First pass at a single zoomAndScale parameter
Tim Horton
Comment 2
2013-01-30 11:40:26 PST
Comment on
attachment 185061
[details]
First pass at a single zoomAndScale parameter View in context:
https://bugs.webkit.org/attachment.cgi?id=185061&action=review
Seems reasonable to me!
> Source/WebCore/svg/graphics/SVGImageCache.cpp:107 > + imageSize.setWidth(scale * sizeAndScales.size.width()); > + imageSize.setHeight(scale * sizeAndScales.size.height());
imageSize = sizeAndScales.size; imageSize.scale(scale); Maybe?
Philip Rogers
Comment 3
2013-01-30 13:02:40 PST
(In reply to
comment #2
)
> (From update of
attachment 185061
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=185061&action=review
> > Seems reasonable to me!
Thank you for the review!
> > > Source/WebCore/svg/graphics/SVGImageCache.cpp:107 > > + imageSize.setWidth(scale * sizeAndScales.size.width()); > > + imageSize.setHeight(scale * sizeAndScales.size.height()); > > imageSize = sizeAndScales.size; > imageSize.scale(scale); > > Maybe?
This is a good idea but unfortunately we risk losing precision. The container size is stored as a FloatSize whereas imageSize is stored as IntSize, so it's best to multiply the floats together before doing the conversion.
WebKit Review Bot
Comment 4
2013-01-30 13:11:25 PST
Comment on
attachment 185061
[details]
First pass at a single zoomAndScale parameter Clearing flags on attachment: 185061 Committed
r141303
: <
http://trac.webkit.org/changeset/141303
>
WebKit Review Bot
Comment 5
2013-01-30 13:11:29 PST
All reviewed patches have been landed. Closing bug.
Philip Rogers
Comment 6
2013-01-30 15:19:33 PST
(In reply to
comment #5
)
> All reviewed patches have been landed. Closing bug.
Rebaselines landed:
http://trac.webkit.org/changeset/141326
http://trac.webkit.org/changeset/141324
http://trac.webkit.org/changeset/141311
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug