Bug 133407 - Cleanup temporary setting of image interpolation quality in GraphicsContext::drawImage*
Summary: Cleanup temporary setting of image interpolation quality in GraphicsContext::...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: zalan
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-30 09:07 PDT by zalan
Modified: 2014-05-30 16:03 PDT (History)
1 user (show)

See Also:


Attachments
Patch (6.79 KB, patch)
2014-05-30 12:43 PDT, zalan
no flags Details | Formatted Diff | Diff
Patch (6.75 KB, patch)
2014-05-30 14:27 PDT, zalan
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description zalan 2014-05-30 09:07:01 PDT
This is highly error prone with all the copy-paste code in GraphicsContext::drawImage, GraphicsContext::drawTiledImage, GraphicsContext::drawImageBuffer.

if (useLowQualityScale) {
       InterpolationQuality previousInterpolationQuality = imageInterpolationQuality();
       setImageInterpolationQuality(InterpolationNone);
       image->draw(this, styleColorSpace, dest, src, op, blendMode, useLowQualityScale);
       setImageInterpolationQuality(previousInterpolationQuality);
   } else
       image->draw(this, styleColorSpace, dest, src, op, blendMode, useLowQualityScale);
Comment 1 zalan 2014-05-30 12:43:13 PDT
Created attachment 232301 [details]
Patch
Comment 2 Darin Adler 2014-05-30 13:33:29 PDT
Comment on attachment 232301 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=232301&action=review

OK

> Source/WebCore/platform/graphics/GraphicsContext.cpp:98
> +    GraphicsContext* m_graphicsContext;

Should use a reference instead of a pointer.

> Source/WebCore/platform/graphics/GraphicsContext.cpp:100
> +    InterpolationQuality m_newInterpolationQuality;

Could just store a m_currentInterpolationQuality != m_newInterpolationQuality boolean instead.
Comment 3 zalan 2014-05-30 13:35:24 PDT
(In reply to comment #2)
> (From update of attachment 232301 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=232301&action=review
> 
> OK
> 
> > Source/WebCore/platform/graphics/GraphicsContext.cpp:98
> > +    GraphicsContext* m_graphicsContext;
> 
> Should use a reference instead of a pointer.
> 
> > Source/WebCore/platform/graphics/GraphicsContext.cpp:100
> > +    InterpolationQuality m_newInterpolationQuality;
> 
> Could just store a m_currentInterpolationQuality != m_newInterpolationQuality boolean instead.
Good point! I'll do that.
Comment 4 zalan 2014-05-30 14:27:55 PDT
Created attachment 232303 [details]
Patch
Comment 5 zalan 2014-05-30 14:28:09 PDT
Comment on attachment 232303 [details]
Patch

EWSing
Comment 6 WebKit Commit Bot 2014-05-30 16:03:42 PDT
Comment on attachment 232303 [details]
Patch

Clearing flags on attachment: 232303

Committed r169498: <http://trac.webkit.org/changeset/169498>
Comment 7 WebKit Commit Bot 2014-05-30 16:03:45 PDT
All reviewed patches have been landed.  Closing bug.