WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
90755
Remove down-casting to BitmapImage in GraphicsContext::drawImage.
https://bugs.webkit.org/show_bug.cgi?id=90755
Summary
Remove down-casting to BitmapImage in GraphicsContext::drawImage.
Dongseong Hwang
Reported
2012-07-08 23:56:43 PDT
Add a BitmapImage draw method which takes RespectImageOrientationEnum enum as the last argument for CG. Then we can remove the conditional down-casting in GraphicsContext::drawImage. This change is needed for parallel image decoders. Because parallel image decoders use a Bitmap image wrapper class which extends Image (not Bitmap), the down-casting above causes the loss of RespectImageOrientationEnum which must be passed to BitmapImage.
Attachments
Patch
(6.40 KB, patch)
2012-07-09 01:24 PDT
,
Dongseong Hwang
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Dongseong Hwang
Comment 1
2012-07-09 01:24:59 PDT
Created
attachment 151211
[details]
Patch
Kwang Yul Seo
Comment 2
2012-07-12 18:27:10 PDT
Simon, this is a simple refactoring patch which removes a CG-specific conditional down-casting in GraphicsContext::drawImage. Because GraphicsContext already has a draw method with RespectImageOrientationEnum, there is no reason not to put the corresponding Image::draw method with RespectImageOrientationEnum in Image.
Kwang Yul Seo
Comment 3
2012-07-13 10:19:37 PDT
Comment on
attachment 151211
[details]
Patch Clearing flags on attachment: 151211 Committed
r122598
: <
http://trac.webkit.org/changeset/122598
>
Kwang Yul Seo
Comment 4
2012-07-13 10:19:42 PDT
All reviewed patches have been landed. Closing bug.
Nico Weber
Comment 5
2012-10-22 15:50:55 PDT
How does this patch work? Before this patch, BitmapImage::draw would be called from GraphicsContext.cpp, which had an implementation that honored the image orientation in ImageCG.cpp (BitmapImage::draw()). Now GraphicsContext calls Image::draw() on all platforms, which always throws away the orientation parameter. How does this patch not break image orientation on mac?
Dongseong Hwang
Comment 6
2012-10-22 19:35:54 PDT
(In reply to
comment #5
)
> How does this patch work? Before this patch, BitmapImage::draw would be called from GraphicsContext.cpp, which had an implementation that honored the image orientation in ImageCG.cpp (BitmapImage::draw()). > > Now GraphicsContext calls Image::draw() on all platforms, which always throws away the orientation parameter. How does this patch not break image orientation on mac?
That's good question. BitmapImage of mac only overrides Image::draw(). BitmapImage of other ports does not overrides Image::draw(). #if USE(CG) virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, RespectImageOrientationEnum); #endif It means in mac if you call draw() of BitmapImage, Image::draw() is not called and BitmapImage::draw() of mac is called, which does not throw away the orientation parameter. Please let me know if you have questions anymore :)
Nico Weber
Comment 7
2012-10-22 20:52:29 PDT
Thanks for explaining! I missed the inheritance relationship.
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