Changeset 208019 in webkit


Ignore:
Timestamp:
Oct 27, 2016 5:21:31 PM (7 years ago)
Author:
Brent Fulgham
Message:

[Win][Direct2D] Create a RAII Helper Class for the Render Target
https://bugs.webkit.org/show_bug.cgi?id=164005

Reviewed by Alex Christensen.

Source/WebCore:

Tested by existing SVG, image, and Canvas layout tests.

  • platform/graphics/GraphicsContext.h:
  • platform/graphics/win/GradientDirect2D.cpp:

(WebCore::Gradient::fill): Use new convenience helper class.

  • platform/graphics/win/GraphicsContextDirect2D.cpp:

(WebCore::GraphicsContext::didBeginDraw):
(WebCore::GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate):
(WebCore::GraphicsContextPlatformPrivate::~GraphicsContextPlatformPrivate): Add an
assertion that we are in a valid state when cleaning up the graphics context.
(WebCore::GraphicsContextPlatformPrivate::clip): Clipping can only happen in a Draw operation.
Open a new BeginDraw if asked to Clip. The Begin must stay active when this method returns,
as the Clip layer is only valid during a Draw operation.
(WebCore::GraphicsContextPlatformPrivate::beginDraw): Added.
(WebCore::GraphicsContextPlatformPrivate::endDraw): Added.
(WebCore::GraphicsContext::beginDrawIfNeeded): Added.
(WebCore::GraphicsContext::endDraw): Added.
(WebCore::GraphicsContext::drawWithoutShadow): Revise to use new RenderTargetHelper class.
(WebCore::GraphicsContext::drawWithShadow): Ditto.
(WebCore::GraphicsContext::platformFillRoundedRect): Ditto.
(WebCore::GraphicsContext::fillRectWithRoundedHole): Ditto.
(WebCore::GraphicsContext::setDidBeginDraw): Deleted.

  • platform/graphics/win/GraphicsContextPlatformPrivateDirect2D.h:

(WebCore::GraphicsContextPlatformPrivate::didBeginDraw): Revise to use count instead of
a separate boolean.

  • platform/graphics/win/ImageBufferDataDirect2D.cpp:

(WebCore::ImageBufferData::getData): Revise to use new RenderTargetHelper class.

  • platform/graphics/win/NativeImageDirect2D.cpp:

(WebCore::drawNativeImage): Ditto.

  • platform/graphics/win/RenderTargetHelper.h: Added.

(WebCore::RenderTargetHelper::RenderTargetHelper):
(WebCore::RenderTargetHelper::~RenderTargetHelper):
(WebCore::RenderTargetHelper::endDraw):

  • svg/graphics/SVGImage.cpp:

(WebCore::SVGImage::nativeImage): Revise to use new RenderTargetHelper class.

Source/WebKit/win:

  • WebView.cpp:

(WebView::sizeChanged): Construct RenderTarget with higher-resolution display timer.
(WebView::paintWithDirect2D): Revise to use new RenderTargetHelper class.

Location:
trunk
Files:
1 added
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r208014 r208019  
     12016-10-25  Brent Fulgham  <bfulgham@apple.com>
     2
     3        [Win][Direct2D] Create a RAII Helper Class for the Render Target
     4        https://bugs.webkit.org/show_bug.cgi?id=164005
     5
     6        Reviewed by Alex Christensen.
     7
     8        Tested by existing SVG, image, and Canvas layout tests.
     9
     10        * platform/graphics/GraphicsContext.h:
     11        * platform/graphics/win/GradientDirect2D.cpp:
     12        (WebCore::Gradient::fill): Use new convenience helper class.
     13        * platform/graphics/win/GraphicsContextDirect2D.cpp:
     14        (WebCore::GraphicsContext::didBeginDraw):
     15        (WebCore::GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate):
     16        (WebCore::GraphicsContextPlatformPrivate::~GraphicsContextPlatformPrivate): Add an
     17        assertion that we are in a valid state when cleaning up the graphics context.
     18        (WebCore::GraphicsContextPlatformPrivate::clip): Clipping can only happen in a Draw operation.
     19        Open a new BeginDraw if asked to Clip. The Begin must stay active when this method returns,
     20        as the Clip layer is only valid during a Draw operation.
     21        (WebCore::GraphicsContextPlatformPrivate::beginDraw): Added.
     22        (WebCore::GraphicsContextPlatformPrivate::endDraw): Added.
     23        (WebCore::GraphicsContext::beginDrawIfNeeded): Added.
     24        (WebCore::GraphicsContext::endDraw): Added.
     25        (WebCore::GraphicsContext::drawWithoutShadow): Revise to use new RenderTargetHelper class.
     26        (WebCore::GraphicsContext::drawWithShadow): Ditto.
     27        (WebCore::GraphicsContext::platformFillRoundedRect): Ditto.
     28        (WebCore::GraphicsContext::fillRectWithRoundedHole): Ditto.
     29        (WebCore::GraphicsContext::setDidBeginDraw): Deleted.
     30        * platform/graphics/win/GraphicsContextPlatformPrivateDirect2D.h:
     31        (WebCore::GraphicsContextPlatformPrivate::didBeginDraw): Revise to use count instead of
     32        a separate boolean.
     33        * platform/graphics/win/ImageBufferDataDirect2D.cpp:
     34        (WebCore::ImageBufferData::getData): Revise to use new RenderTargetHelper class.
     35        * platform/graphics/win/NativeImageDirect2D.cpp:
     36        (WebCore::drawNativeImage): Ditto.
     37        * platform/graphics/win/RenderTargetHelper.h: Added.
     38        (WebCore::RenderTargetHelper::RenderTargetHelper):
     39        (WebCore::RenderTargetHelper::~RenderTargetHelper):
     40        (WebCore::RenderTargetHelper::endDraw):
     41        * svg/graphics/SVGImage.cpp:
     42        (WebCore::SVGImage::nativeImage): Revise to use new RenderTargetHelper class.
     43
    1442016-10-27  Wenson Hsieh  <wenson_hsieh@apple.com>
    245
  • trunk/Source/WebCore/platform/graphics/GraphicsContext.h

    r207868 r208019  
    553553    WEBCORE_EXPORT static ID2D1RenderTarget* defaultRenderTarget();
    554554
    555     WEBCORE_EXPORT void setDidBeginDraw(bool);
     555    WEBCORE_EXPORT bool beginDrawIfNeeded();
    556556    WEBCORE_EXPORT bool didBeginDraw() const;
    557557    D2D1_COLOR_F colorWithGlobalAlpha(const Color&) const;
     558    WEBCORE_EXPORT void endDraw();
    558559
    559560    ID2D1Brush* solidStrokeBrush() const;
  • trunk/Source/WebCore/platform/graphics/win/GradientDirect2D.cpp

    r207681 r208019  
    2929#include "FloatPoint.h"
    3030#include "GraphicsContext.h"
     31#include "RenderTargetScopedDrawing.h"
    3132#include <d2d1.h>
    3233#include <wtf/RetainPtr.h>
     
    121122        generateGradient(d2dContext);
    122123
    123     if (!context->didBeginDraw())
    124         d2dContext->BeginDraw();
     124    RenderTargetScopedDrawing scopedDraw(*context);
    125125
    126126    d2dContext->SetTags(GRADIENT_DRAWING, __LINE__);
     
    129129    d2dContext->FillRectangle(&d2dRect, m_gradient);
    130130
    131     if (!context->didBeginDraw()) {
    132         D2D1_TAG first, second;
    133         HRESULT hr = d2dContext->EndDraw(&first, &second);
    134         RELEASE_ASSERT(SUCCEEDED(hr));
    135     }
    136 
    137131    if (needScaling)
    138132        context->restore();
  • trunk/Source/WebCore/platform/graphics/win/GraphicsContextDirect2D.cpp

    r208013 r208019  
    3535#include "Logging.h"
    3636#include "NotImplemented.h"
     37#include "RenderTargetScopedDrawing.h"
    3738#include "URL.h"
    3839#include <d2d1.h>
     
    99100}
    100101
    101 void GraphicsContext::setDidBeginDraw(bool didBeginDraw)
    102 {
    103     RELEASE_ASSERT(m_data);
    104     m_data->m_didBeginDraw = didBeginDraw;
    105 }
    106 
    107102bool GraphicsContext::didBeginDraw() const
    108103{
    109     return m_data->m_didBeginDraw;
     104    return m_data->didBeginDraw();
    110105}
    111106
     
    278273    ASSERT(SUCCEEDED(hr));
    279274
    280     if (!didBeginDraw())
    281         platformContext()->BeginDraw();
    282 
     275    RenderTargetScopedDrawing scopedDraw(*this);
    283276    platformContext()->DrawBitmap(bitmap.get(), dstRect);
    284277
    285     if (!didBeginDraw())
    286         hr = platformContext()->EndDraw();
    287 
    288278    ::DeleteDC(hdc);
    289279}
     
    307297void GraphicsContext::drawLineForDocumentMarker(const FloatPoint& point, float width, DocumentMarkerLineStyle style)
    308298{
     299}
     300
     301GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate(ID2D1RenderTarget* renderTarget)
     302    : m_renderTarget(renderTarget)
     303{
     304}
     305
     306GraphicsContextPlatformPrivate::~GraphicsContextPlatformPrivate()
     307{
     308    if (!m_renderTarget)
     309        return;
     310
     311    ASSERT(!m_beginDrawCount.unsafeGet());
    309312}
    310313
     
    341344void GraphicsContextPlatformPrivate::clip(const FloatRect& rect)
    342345{
     346    // In D2D, we can only clip in the context of a 'BeginDraw', and the clip can
     347    // only live as long as the draw is happening.
     348    beginDrawIfNeeded();
     349
    343350    if (m_renderStates.isEmpty())
    344351        save();
     
    355362void GraphicsContextPlatformPrivate::clip(ID2D1Geometry* path)
    356363{
     364    // In D2D, we can only clip in the context of a 'BeginDraw', and the clip can
     365    // only live as long as the draw is happening.
     366    beginDrawIfNeeded();
     367
    357368    ASSERT(m_renderStates.size());
    358369    if (!m_renderStates.size())
     
    390401}
    391402
     403void GraphicsContextPlatformPrivate::beginDrawIfNeeded()
     404{
     405    ASSERT(m_renderTarget.get());
     406    if (didBeginDraw())
     407        return;
     408
     409    m_renderTarget->BeginDraw();
     410
     411    ++m_beginDrawCount;
     412}
     413
    392414void GraphicsContextPlatformPrivate::endDraw()
    393415{
     
    398420    if (!SUCCEEDED(hr))
    399421        WTFLogAlways("Failed in GraphicsContextPlatformPrivate::endDraw: hr=%ld, first=%ld, second=%ld", hr, first, second);
     422
     423    --m_beginDrawCount;
    400424}
    401425
     
    492516{
    493517    return m_data->m_patternFillBrush.get();
     518}
     519
     520bool GraphicsContext::beginDrawIfNeeded()
     521{
     522    bool neededToBeginDraw = !m_data->didBeginDraw();
     523
     524    m_data->beginDrawIfNeeded();
     525    return neededToBeginDraw;
     526}
     527
     528void GraphicsContext::endDraw()
     529{
     530    m_data->endDraw();
    494531}
    495532
     
    878915void GraphicsContext::drawWithoutShadow(const FloatRect& /*boundingRect*/, const std::function<void(ID2D1RenderTarget*)>& drawCommands)
    879916{
    880     auto context = platformContext();
    881 
    882     if (!didBeginDraw())
    883         context->BeginDraw();
    884 
    885     drawCommands(context);
    886 
    887     if (!didBeginDraw())
    888         m_data->endDraw();
     917    RenderTargetScopedDrawing scopedDraw(*this);
     918    drawCommands(platformContext());
    889919}
    890920
    891921void GraphicsContext::drawWithShadow(const FloatRect& boundingRect, const std::function<void(ID2D1RenderTarget*)>& drawCommands)
    892922{
     923    RenderTargetScopedDrawing scopedDraw(*this);
     924
    893925    auto context = platformContext();
    894926
     
    943975    deviceContext->SetTransform(ctm * flip * translate);
    944976
    945     deviceContext->BeginDraw();
    946977    deviceContext->DrawImage(compositor.get(), D2D1_INTERPOLATION_MODE_LINEAR);
    947     hr = deviceContext->EndDraw();
    948     ASSERT(SUCCEEDED(hr));
    949978}
    950979
     
    11371166    }
    11381167
    1139     if (!didBeginDraw())
    1140         context->BeginDraw();
    1141    
     1168    RenderTargetScopedDrawing scopedDraw(*this);
     1169
    11421170    context->SetTags(1, __LINE__);
    11431171
     
    11591187    }
    11601188
    1161     if (!didBeginDraw())
    1162         m_data->endDraw();
    1163 
    11641189    if (drawOwnShadow)
    11651190        stateSaver.restore();
     
    11781203    auto context = platformContext();
    11791204
    1180     if (!didBeginDraw())
    1181         context->BeginDraw();
     1205    RenderTargetScopedDrawing scopedDraw(*this);
    11821206
    11831207    context->SetTags(1, __LINE__);
     
    12081232
    12091233    fillPath(path);
    1210 
    1211     if (!didBeginDraw())
    1212         m_data->endDraw();
    12131234
    12141235    if (drawOwnShadow)
  • trunk/Source/WebCore/platform/graphics/win/GraphicsContextPlatformPrivateDirect2D.h

    r207140 r208019  
    3333#include <d2d1helper.h>
    3434#include <windows.h>
     35#include <wtf/CheckedArithmetic.h>
    3536#include <wtf/TinyLRUCache.h>
    3637
     
    4041    WTF_MAKE_FAST_ALLOCATED;
    4142public:
    42     GraphicsContextPlatformPrivate(ID2D1RenderTarget* renderTarget)
    43         : m_renderTarget(renderTarget)
    44     {
    45     }
     43    GraphicsContextPlatformPrivate(ID2D1RenderTarget*);
     44    ~GraphicsContextPlatformPrivate();
    4645
    4746    enum Direct2DLayerType { AxisAlignedClip, LayerClip };
     
    5049    void clip(const Path&);
    5150    void clip(ID2D1Geometry*);
     51    void beginDrawIfNeeded();
    5252    void endDraw();
    5353    void flush();
     
    7676    COMPtr<ID2D1SolidColorBrush> brushWithColor(const D2D1_COLOR_F&);
    7777
     78    bool didBeginDraw() const { return m_beginDrawCount.unsafeGet(); }
     79
    7880    HDC m_hdc { nullptr };
    7981    D2D1_BLEND_MODE m_blendMode { D2D1_BLEND_MODE_MULTIPLY };
    8082    D2D1_COMPOSITE_MODE m_compositeMode { D2D1_COMPOSITE_MODE_SOURCE_OVER };
     83    Checked<unsigned> m_beginDrawCount { 0 };
    8184    bool m_shouldIncludeChildWindows { false };
    82     bool m_didBeginDraw { false };
    8385    bool m_strokeSyleIsDirty { false };
    8486
  • trunk/Source/WebCore/platform/graphics/win/ImageBufferDataDirect2D.cpp

    r207708 r208019  
    3434#include "IntRect.h"
    3535#include "NotImplemented.h"
     36#include "RenderTargetScopedDrawing.h"
    3637#include <d2d1.h>
    3738#include <runtime/JSCInlines.h>
     
    6465    HGDIOBJ oldBitmap = ::SelectObject(bitmapDC.get(), bitmap.get());
    6566
    66     HRESULT hr;
     67    BOOL ok = TRUE;
    6768
    68     COMPtr<ID2D1GdiInteropRenderTarget> gdiRenderTarget;
    69     hr = platformContext->QueryInterface(__uuidof(ID2D1GdiInteropRenderTarget), (void**)&gdiRenderTarget);
    70     if (FAILED(hr))
    71         return nullptr;
     69    {
     70        RenderTargetScopedDrawing scopedDraw(*context);
    7271
    73     platformContext->BeginDraw();
     72        COMPtr<ID2D1GdiInteropRenderTarget> gdiRenderTarget;
     73        HRESULT hr = platformContext->QueryInterface(__uuidof(ID2D1GdiInteropRenderTarget), (void**)&gdiRenderTarget);
     74        if (FAILED(hr))
     75            return nullptr;
    7476
    75     HDC hdc = nullptr;
    76     hr = gdiRenderTarget->GetDC(D2D1_DC_INITIALIZE_MODE_COPY, &hdc);
     77        HDC hdc = nullptr;
     78        hr = gdiRenderTarget->GetDC(D2D1_DC_INITIALIZE_MODE_COPY, &hdc);
    7779
    78     BOOL ok = ::BitBlt(bitmapDC.get(), 0, 0, rect.width(), rect.height(), hdc, rect.x(), rect.y(), SRCCOPY);
     80        ok = ::BitBlt(bitmapDC.get(), 0, 0, rect.width(), rect.height(), hdc, rect.x(), rect.y(), SRCCOPY);
    7981
    80     hr = gdiRenderTarget->ReleaseDC(nullptr);
    81 
    82     hr = platformContext->EndDraw();
     82        hr = gdiRenderTarget->ReleaseDC(nullptr);
     83    }
    8384
    8485    if (!ok)
  • trunk/Source/WebCore/platform/graphics/win/NativeImageDirect2D.cpp

    r207357 r208019  
    3333#include "IntSize.h"
    3434#include "NotImplemented.h"
     35#include "RenderTargetScopedDrawing.h"
    3536#include <d2d1.h>
    3637
     
    8687    float opacity = 1.0f;
    8788
    88     if (!context.didBeginDraw())
    89         platformContext->BeginDraw();
     89    bool temporaryDraw = context.beginDrawIfNeeded();
    9090
    9191    platformContext->DrawBitmap(image.get(), destRect, opacity, D2D1_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR, adjustedSrcRect);
    9292
    9393    HRESULT hr = S_OK;
    94     if (!context.didBeginDraw())
    95         hr = platformContext->EndDraw();
     94    if (temporaryDraw)
     95        context.endDraw();
    9696    else
    9797        hr = platformContext->Flush();
  • trunk/Source/WebCore/svg/graphics/SVGImage.cpp

    r207386 r208019  
    11/*
    22 * Copyright (C) 2006 Eric Seidel <eric@webkit.org>
    3  * Copyright (C) 2008, 2009, 2015 Apple Inc. All rights reserved.
     3 * Copyright (C) 2008-2009, 2015-2016 Apple Inc. All rights reserved.
    44 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
    55 *
     
    5757#if USE(DIRECT2D)
    5858#include "COMPtr.h"
     59#include "RenderTargetScopedDrawing.h"
    5960#include <d2d1.h>
    6061#endif
     
    225226    ASSERT(SUCCEEDED(hr));
    226227
    227     nativeImageTarget->BeginDraw();
    228228    GraphicsContext localContext(nativeImageTarget.get());
    229     localContext.setDidBeginDraw(true);
    230 
    231     draw(localContext, rect(), rect(), CompositeSourceOver, BlendModeNormal, ImageOrientationDescription());
    232 
    233     hr = nativeImageTarget->Flush();
    234     ASSERT(SUCCEEDED(hr));
     229
     230    {
     231        RenderTargetScopedDrawing scopedDraw(localContext);
     232        draw(localContext, rect(), rect(), CompositeSourceOver, BlendModeNormal, ImageOrientationDescription());
     233    }
    235234
    236235    COMPtr<ID2D1Bitmap> nativeImage;
  • trunk/Source/WebKit/win/ChangeLog

    r208014 r208019  
     12016-10-25  Brent Fulgham  <bfulgham@apple.com>
     2
     3        [Win][Direct2D] Create a RAII Helper Class for the Render Target
     4        https://bugs.webkit.org/show_bug.cgi?id=164005
     5
     6        Reviewed by Alex Christensen.
     7
     8        * WebView.cpp:
     9        (WebView::sizeChanged): Construct RenderTarget with higher-resolution display timer.
     10        (WebView::paintWithDirect2D): Revise to use new RenderTargetHelper class.
     11
    1122016-10-27  Wenson Hsieh  <wenson_hsieh@apple.com>
    213
  • trunk/Source/WebKit/win/WebView.cpp

    r207585 r208019  
    165165#include <WebCore/WindowsTouch.h>
    166166#include <bindings/ScriptValue.h>
     167#include <comdef.h>
    167168#include <d2d1.h>
    168169#include <wtf/MainThread.h>
     
    195196#if ENABLE(FULLSCREEN_API)
    196197#include <WebCore/FullScreenController.h>
     198#endif
     199
     200#if USE(DIRECT2D)
     201#include <WebCore/RenderTargetScopedDrawing.h>
    197202#endif
    198203
     
    10641069    auto renderTargetProperties = D2D1::RenderTargetProperties();
    10651070    renderTargetProperties.usage = D2D1_RENDER_TARGET_USAGE_GDI_COMPATIBLE;
    1066     auto hwndRenderTargetProperties = D2D1::HwndRenderTargetProperties(m_viewWindow, newSize);
     1071    auto hwndRenderTargetProperties = D2D1::HwndRenderTargetProperties(m_viewWindow, newSize, D2D1_PRESENT_OPTIONS_IMMEDIATELY);
    10671072    HRESULT hr = GraphicsContext::systemFactory()->CreateHwndRenderTarget(&renderTargetProperties, &hwndRenderTargetProperties, &m_renderTarget);
    10681073    ASSERT(SUCCEEDED(hr));
     
    12181223void WebView::paintWithDirect2D()
    12191224{
    1220 #if USE(DIRECT2D)
    12211225    Frame* coreFrame = core(m_mainFrame);
    12221226    if (!coreFrame)
     
    12371241        auto pixelSize = D2D1::SizeU(clientRect.width(), clientRect.height());
    12381242
    1239         auto hwndRenderTargetProperties = D2D1::HwndRenderTargetProperties(m_viewWindow, pixelSize);
     1243        auto hwndRenderTargetProperties = D2D1::HwndRenderTargetProperties(m_viewWindow, pixelSize, D2D1_PRESENT_OPTIONS_IMMEDIATELY);
    12401244        HRESULT hr = GraphicsContext::systemFactory()->CreateHwndRenderTarget(&renderTargetProperties, &hwndRenderTargetProperties, &m_renderTarget);
    12411245        if (!SUCCEEDED(hr))
     
    12431247    }
    12441248
    1245     m_renderTarget->BeginDraw();
    1246 
    1247     m_renderTarget->SetTags(WEBKIT_DRAWING, __LINE__);
    1248     m_renderTarget->Clear();
    1249 
    1250     // Direct2D honors the scale factor natively.
    1251     float scaleFactor = 1.0f;
    1252     float inverseScaleFactor = 1.0f / scaleFactor;
    1253 
    1254     RECT clientRect;
    1255     GetClientRect(m_viewWindow, &clientRect);
    1256 
    1257     IntRect dirtyRectPixels(0, 0, clientRect.right, clientRect.bottom);
    1258     FloatRect logicalDirtyRectFloat = dirtyRectPixels;
    1259     logicalDirtyRectFloat.scale(inverseScaleFactor);
    1260     IntRect logicalDirtyRect(enclosingIntRect(logicalDirtyRectFloat));
    1261 
     1249    RECT clientRect = {};
    12621250    GraphicsContext gc(m_renderTarget.get());
    1263     gc.setDidBeginDraw(true);
    1264 
    1265     if (frameView && frameView->frame().contentRenderer()) {
    1266         gc.save();
    1267         gc.scale(FloatSize(scaleFactor, scaleFactor));
    1268         gc.clip(logicalDirtyRect);
    1269         frameView->paint(gc, logicalDirtyRect);
    1270         gc.restore();
    1271         if (m_shouldInvertColors)
    1272             gc.fillRect(logicalDirtyRect, Color::white, CompositeDifference);
    1273     }
    1274 
    1275     HRESULT hr = m_renderTarget->EndDraw();
    1276     // FIXME: Recognize and recover from error state:
    1277     UNUSED_PARAM(hr);
     1251
     1252    {
     1253        WebCore::RenderTargetScopedDrawing scopedDraw(gc);
     1254
     1255        m_renderTarget->SetTags(WEBKIT_DRAWING, __LINE__);
     1256        m_renderTarget->Clear();
     1257
     1258        // Direct2D honors the scale factor natively.
     1259        float scaleFactor = 1.0f;
     1260        float inverseScaleFactor = 1.0f / scaleFactor;
     1261
     1262        GetClientRect(m_viewWindow, &clientRect);
     1263
     1264        IntRect dirtyRectPixels(0, 0, clientRect.right, clientRect.bottom);
     1265        FloatRect logicalDirtyRectFloat = dirtyRectPixels;
     1266        logicalDirtyRectFloat.scale(inverseScaleFactor);
     1267        IntRect logicalDirtyRect(enclosingIntRect(logicalDirtyRectFloat));
     1268
     1269        if (frameView && frameView->frame().contentRenderer()) {
     1270            gc.save();
     1271            gc.scale(FloatSize(scaleFactor, scaleFactor));
     1272            gc.clip(logicalDirtyRect);
     1273            frameView->paint(gc, logicalDirtyRect);
     1274            gc.restore();
     1275            if (m_shouldInvertColors)
     1276                gc.fillRect(logicalDirtyRect, Color::white, CompositeDifference);
     1277        }
     1278    }
    12781279
    12791280    ::ValidateRect(m_viewWindow, &clientRect);
     
    31523153
    31533154    setSmartInsertDeleteEnabled(TRUE);
     3155
    31543156    return hr;
    31553157}
  • trunk/Tools/TestWebKitAPI/PlatformWin.cmake

    r206153 r208019  
    2929    Crypt32
    3030    D2d1
     31    Dwrite
     32    dxguid
    3133    Iphlpapi
    3234    Psapi
     
    3638    WebCoreDerivedSources${DEBUG_SUFFIX}
    3739    WebKit${DEBUG_SUFFIX}
     40    WindowsCodecs
    3841    gtest
    3942)
Note: See TracChangeset for help on using the changeset viewer.