Changeset 73183 in webkit
- Timestamp:
- Dec 2, 2010 12:36:04 PM (13 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r73181 r73183 1 2010-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 1 13 2010-12-02 Johnny Ding <jnd@chromium.org> 2 14 -
trunk/WebCore/platform/graphics/GraphicsContext.h
r73129 r73183 302 302 void setCompositeOperation(CompositeOperator); 303 303 304 #if PLATFORM(SKIA) || PLATFORM(OPENVG) || OS(WINCE)304 #if PLATFORM(SKIA) || PLATFORM(OPENVG) 305 305 void beginPath(); 306 306 void addPath(const Path&); -
trunk/WebCore/platform/graphics/wince/GraphicsContextWinCE.cpp
r72926 r73183 174 174 AffineTransform m_transform; 175 175 float m_opacity; 176 Vector<Path> m_paths;177 176 }; 178 177 … … 1183 1182 } 1184 1183 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 1195 1184 void GraphicsContext::clip(const Path& path) 1196 1185 { … … 1328 1317 void GraphicsContext::fillPath(const Path& path) 1329 1318 { 1330 // FIXME: Be smarter about this.1331 beginPath();1332 addPath(path);1333 1334 1319 Color c = m_common->state.fillGradient 1335 1320 ? gradientAverageColor(m_common->state.fillGradient.get()) … … 1346 1331 1347 1332 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); 1364 1347 } else { 1365 1348 SelectObject(m_data->m_dc, GetStockObject(NULL_PEN)); 1366 1349 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); 1369 1351 SelectObject(m_data->m_dc, oldBrush); 1370 1352 } … … 1372 1354 1373 1355 1374 void GraphicsContext::strokePath( )1356 void GraphicsContext::strokePath(const Path& path) 1375 1357 { 1376 1358 if (!m_data->m_opacity) … … 1381 1363 return; 1382 1364 1383 // FIXME: Be smarter about this.1384 beginPath();1385 addPath(path);1386 1387 1365 OwnPtr<HPEN> pen = createPen(strokeColor(), strokeThickness(), strokeStyle()); 1388 1366 1389 1367 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); 1406 1382 } else { 1407 1383 SelectObject(m_data->m_dc, GetStockObject(NULL_BRUSH)); 1408 1384 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); 1411 1386 SelectObject(m_data->m_dc, oldPen); 1412 1387 }
Note: See TracChangeset
for help on using the changeset viewer.