Changeset 73183 in webkit


Ignore:
Timestamp:
Dec 2, 2010 12:36:04 PM (13 years ago)
Author:
Patrick Gansterer
Message:

2010-12-02 Patrick Gansterer <Patrick Gansterer>

Reviewed by Andreas Kling.

[WINCE] Remove "current path" of GraphicsContext
https://bugs.webkit.org/show_bug.cgi?id=50284

  • platform/graphics/GraphicsContext.h:
  • platform/graphics/wince/GraphicsContextWinCE.cpp: (WebCore::GraphicsContext::fillPath): (WebCore::GraphicsContext::strokePath):
Location:
trunk/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r73181 r73183  
     12010-12-02  Patrick Gansterer  <paroga@webkit.org>
     2
     3        Reviewed by Andreas Kling.
     4
     5        [WINCE] Remove "current path" of GraphicsContext
     6        https://bugs.webkit.org/show_bug.cgi?id=50284
     7
     8        * platform/graphics/GraphicsContext.h:
     9        * platform/graphics/wince/GraphicsContextWinCE.cpp:
     10        (WebCore::GraphicsContext::fillPath):
     11        (WebCore::GraphicsContext::strokePath):
     12
    1132010-12-02  Johnny Ding  <jnd@chromium.org>
    214
  • trunk/WebCore/platform/graphics/GraphicsContext.h

    r73129 r73183  
    302302        void setCompositeOperation(CompositeOperator);
    303303
    304 #if PLATFORM(SKIA) || PLATFORM(OPENVG) || OS(WINCE)
     304#if PLATFORM(SKIA) || PLATFORM(OPENVG)
    305305        void beginPath();
    306306        void addPath(const Path&);
  • trunk/WebCore/platform/graphics/wince/GraphicsContextWinCE.cpp

    r72926 r73183  
    174174    AffineTransform m_transform;
    175175    float m_opacity;
    176     Vector<Path> m_paths;
    177176};
    178177
     
    11831182}
    11841183
    1185 void GraphicsContext::beginPath()
    1186 {
    1187     m_data->m_paths.clear();
    1188 }
    1189 
    1190 void GraphicsContext::addPath(const Path& path)
    1191 {
    1192     m_data->m_paths.append(path);
    1193 }
    1194 
    11951184void GraphicsContext::clip(const Path& path)
    11961185{
     
    13281317void GraphicsContext::fillPath(const Path& path)
    13291318{
    1330     // FIXME: Be smarter about this.
    1331     beginPath();
    1332     addPath(path);
    1333 
    13341319    Color c = m_common->state.fillGradient
    13351320        ? gradientAverageColor(m_common->state.fillGradient.get())
     
    13461331
    13471332    if (m_data->m_opacity < 1.0f || m_data->hasAlpha()) {
    1348         for (Vector<Path>::const_iterator i = m_data->m_paths.begin(); i != m_data->m_paths.end(); ++i) {
    1349             IntRect trRect = enclosingIntRect(m_data->mapRect(i->boundingRect()));
    1350             trRect.inflate(1);
    1351             TransparentLayerDC transparentDC(m_data, trRect);
    1352             HDC dc = transparentDC.hdc();
    1353             if (!dc)
    1354                 continue;
    1355 
    1356             AffineTransform tr = m_data->m_transform;
    1357             tr.translate(transparentDC.toShift().width(), transparentDC.toShift().height());
    1358 
    1359             SelectObject(dc, GetStockObject(NULL_PEN));
    1360             HGDIOBJ oldBrush = SelectObject(dc, brush.get());
    1361             i->platformPath()->fillPath(dc, &tr);
    1362             SelectObject(dc, oldBrush);
    1363         }
     1333        IntRect trRect = enclosingIntRect(m_data->mapRect(path.boundingRect()));
     1334        trRect.inflate(1);
     1335        TransparentLayerDC transparentDC(m_data, trRect);
     1336        HDC dc = transparentDC.hdc();
     1337        if (!dc)
     1338            return;
     1339
     1340        AffineTransform tr = m_data->m_transform;
     1341        tr.translate(transparentDC.toShift().width(), transparentDC.toShift().height());
     1342
     1343        SelectObject(dc, GetStockObject(NULL_PEN));
     1344        HGDIOBJ oldBrush = SelectObject(dc, brush.get());
     1345        path.platformPath()->fillPath(dc, &tr);
     1346        SelectObject(dc, oldBrush);
    13641347    } else {
    13651348        SelectObject(m_data->m_dc, GetStockObject(NULL_PEN));
    13661349        HGDIOBJ oldBrush = SelectObject(m_data->m_dc, brush.get());
    1367         for (Vector<Path>::const_iterator i = m_data->m_paths.begin(); i != m_data->m_paths.end(); ++i)
    1368             i->platformPath()->fillPath(m_data->m_dc, &m_data->m_transform);
     1350        path.platformPath()->fillPath(m_data->m_dc, &m_data->m_transform);
    13691351        SelectObject(m_data->m_dc, oldBrush);
    13701352    }
     
    13721354
    13731355
    1374 void GraphicsContext::strokePath()
     1356void GraphicsContext::strokePath(const Path& path)
    13751357{
    13761358    if (!m_data->m_opacity)
     
    13811363        return;
    13821364
    1383     // FIXME: Be smarter about this.
    1384     beginPath();
    1385     addPath(path);
    1386 
    13871365    OwnPtr<HPEN> pen = createPen(strokeColor(), strokeThickness(), strokeStyle());
    13881366
    13891367    if (m_data->m_opacity < 1.0f || m_data->hasAlpha()) {
    1390         for (Vector<Path>::const_iterator i = m_data->m_paths.begin(); i != m_data->m_paths.end(); ++i) {
    1391             IntRect trRect = enclosingIntRect(m_data->mapRect(i->boundingRect()));
    1392             trRect.inflate(1);
    1393             TransparentLayerDC transparentDC(m_data, trRect);
    1394             HDC dc = transparentDC.hdc();
    1395             if (!dc)
    1396                 continue;
    1397 
    1398             AffineTransform tr = m_data->m_transform;
    1399             tr.translate(transparentDC.toShift().width(), transparentDC.toShift().height());
    1400 
    1401             SelectObject(dc, GetStockObject(NULL_BRUSH));
    1402             HGDIOBJ oldPen = SelectObject(dc, pen.get());
    1403             i->platformPath()->strokePath(dc, &tr);
    1404             SelectObject(dc, oldPen);
    1405         }
     1368        IntRect trRect = enclosingIntRect(m_data->mapRect(path.boundingRect()));
     1369        trRect.inflate(1);
     1370        TransparentLayerDC transparentDC(m_data, trRect);
     1371        HDC dc = transparentDC.hdc();
     1372        if (!dc)
     1373            return;
     1374
     1375        AffineTransform tr = m_data->m_transform;
     1376        tr.translate(transparentDC.toShift().width(), transparentDC.toShift().height());
     1377
     1378        SelectObject(dc, GetStockObject(NULL_BRUSH));
     1379        HGDIOBJ oldPen = SelectObject(dc, pen.get());
     1380        path.platformPath()->strokePath(dc, &tr);
     1381        SelectObject(dc, oldPen);
    14061382    } else {
    14071383        SelectObject(m_data->m_dc, GetStockObject(NULL_BRUSH));
    14081384        HGDIOBJ oldPen = SelectObject(m_data->m_dc, pen.get());
    1409         for (Vector<Path>::const_iterator i = m_data->m_paths.begin(); i != m_data->m_paths.end(); ++i)
    1410             i->platformPath()->strokePath(m_data->m_dc, &m_data->m_transform);
     1385        path.platformPath()->strokePath(m_data->m_dc, &m_data->m_transform);
    14111386        SelectObject(m_data->m_dc, oldPen);
    14121387    }
Note: See TracChangeset for help on using the changeset viewer.