[webkit-reviews] review granted: [Bug 33022] [Windows] WebKit Plugins Are Not Rendered During Printing : [Attachment 46095] Patch to properly flush cairo state when drawing plugins

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jan 8 07:48:45 PST 2010


Adam Roben (aroben) <aroben at apple.com> has granted Brent Fulgham
<bfulgham at webkit.org>'s request for review:
Bug 33022: [Windows] WebKit Plugins Are Not Rendered During Printing
https://bugs.webkit.org/show_bug.cgi?id=33022

Attachment 46095: Patch to properly flush cairo state when drawing plugins
https://bugs.webkit.org/attachment.cgi?id=46095&action=review

------- Additional Comments from Adam Roben (aroben) <aroben at apple.com>
> +#if PLATFORM(CAIRO)
> +    // Must flush drawings up to this point to the backing metafile,
otherwise the
> +    // plugin region will be 

.......don't leave me hanging!

>  static HDC hdcFromContext(PlatformGraphicsContext* pctx)
>  {
>      cairo_surface_t* surface = cairo_get_target(pctx);
> -    return cairo_win32_surface_get_dc(surface);
> +    HDC hdc = cairo_win32_surface_get_dc(surface);
> +
> +    SetGraphicsMode(hdc, GM_ADVANCED);
> +
> +    return hdc;
>  }

This change isn't mentioned in your ChangeLog.

It seems strange that this "getter"-style function would modify the HDC that
it's returning. Do we really need to do this every time we retrieve the HDC?
Can we just do it once when the HDC is created?

> -    float scale = static_cast<float>(printRect.width()) /
static_cast<float>(pageRect.width());
> +    const float scale = scaleFactor(printDC, pageRect);

We don't normally mark non-reference local variables "const".

r=me


More information about the webkit-reviews mailing list