Summary: | Remove down-casting to BitmapImage in GraphicsContext::drawImage. | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Dongseong Hwang <dongseong.hwang> | ||||
Component: | Images | Assignee: | Nobody <webkit-unassigned> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | gram, koivisto, simon.fraser, skyul, thakis | ||||
Priority: | P2 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Bug Depends on: | |||||||
Bug Blocks: | 90375, 90935 | ||||||
Attachments: |
|
Description
Dongseong Hwang
2012-07-08 23:56:43 PDT
Created attachment 151211 [details]
Patch
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. Comment on attachment 151211 [details] Patch Clearing flags on attachment: 151211 Committed r122598: <http://trac.webkit.org/changeset/122598> All reviewed patches have been landed. Closing bug. 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? (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 :) Thanks for explaining! I missed the inheritance relationship. |