Changeset 139738 in webkit
- Timestamp:
- Jan 15, 2013 7:41:34 AM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r139735 r139738 1 2013-01-15 Zeno Albisser <zeno@webkit.org> 2 3 GraphicsSurface: Canvas with WebGL content is painted off by one pixel 4 https://bugs.webkit.org/show_bug.cgi?id=106446 5 6 When painting to TextureMapper the provided targetRect is in contents 7 coordinate system. This leads to an off by one pixel error when painting 8 outlines of 1px. 9 This needs to be taken into account in the transformation matrix 10 and in the TextureMapperGL::drawTexture call. 11 12 Test: fast/canvas/webgl/webgl-composite-modes.html 13 14 Reviewed by Noam Rosenthal. 15 16 * platform/graphics/surfaces/glx/GraphicsSurfaceGLX.cpp: 17 (WebCore::GraphicsSurface::platformPaintToTextureMapper): 18 * platform/graphics/surfaces/mac/GraphicsSurfaceMac.cpp: 19 (WebCore::GraphicsSurface::platformPaintToTextureMapper): 20 * platform/graphics/surfaces/win/GraphicsSurfaceWin.cpp: 21 (WebCore::GraphicsSurface::platformPaintToTextureMapper): 22 1 23 2013-01-14 Kentaro Hara <haraken@chromium.org> 2 24 -
trunk/Source/WebCore/platform/graphics/surfaces/glx/GraphicsSurfaceGLX.cpp
r139725 r139738 516 516 void GraphicsSurface::platformPaintToTextureMapper(TextureMapper* textureMapper, const FloatRect& targetRect, const TransformationMatrix& transform, float opacity, BitmapTexture* mask) 517 517 { 518 TextureMapperGL* texMapGL = static_cast<TextureMapperGL*>(textureMapper);519 518 IntSize size = m_private->size(); 520 519 if (size.isEmpty()) … … 523 522 if (!texture) 524 523 return; 525 TransformationMatrix adjustedTransform = transform; 526 adjustedTransform.multiply(TransformationMatrix::rectToRect(FloatRect(FloatPoint::zero(), size), targetRect)); 524 527 525 TextureMapperGL::Flags flags = m_private->textureIsYInverted() ? TextureMapperGL::ShouldFlipTexture : 0; 528 526 flags |= TextureMapperGL::ShouldBlend; 529 texMapGL->drawTexture(texture, flags, size, targetRect, adjustedTransform, opacity, mask); 527 528 FloatRect rectOnContents(FloatPoint::zero(), size); 529 TransformationMatrix adjustedTransform = transform; 530 adjustedTransform.multiply(TransformationMatrix::rectToRect(rectOnContents, targetRect)); 531 static_cast<TextureMapperGL*>(textureMapper)->drawTexture(texture, flags, size, rectOnContents, adjustedTransform, opacity, mask); 530 532 } 531 533 -
trunk/Source/WebCore/platform/graphics/surfaces/mac/GraphicsSurfaceMac.cpp
r139182 r139738 336 336 void GraphicsSurface::platformPaintToTextureMapper(TextureMapper* textureMapper, const FloatRect& targetRect, const TransformationMatrix& transform, float opacity, BitmapTexture* mask) 337 337 { 338 IntSize size = m_private->size(); 339 FloatRect rectOnContents(FloatPoint::zero(), size); 338 340 TransformationMatrix adjustedTransform = transform; 339 adjustedTransform.multiply(TransformationMatrix::rectToRect( FloatRect(FloatPoint::zero(), m_private->size()), targetRect));340 static_cast<TextureMapperGL*>(textureMapper)->drawTexture(m_private->frontBufferTextureID(), TextureMapperGL::ShouldBlend | TextureMapperGL::ShouldUseARBTextureRect, m_private->size(), targetRect, adjustedTransform, opacity, mask);341 adjustedTransform.multiply(TransformationMatrix::rectToRect(rectOnContents, targetRect)); 342 static_cast<TextureMapperGL*>(textureMapper)->drawTexture(m_private->frontBufferTextureID(), TextureMapperGL::ShouldBlend | TextureMapperGL::ShouldUseARBTextureRect, size, rectOnContents, adjustedTransform, opacity, mask); 341 343 } 342 344 -
trunk/Source/WebCore/platform/graphics/surfaces/win/GraphicsSurfaceWin.cpp
r135715 r139738 424 424 void GraphicsSurface::platformPaintToTextureMapper(TextureMapper* textureMapper, const FloatRect& targetRect, const TransformationMatrix& transform, float opacity, BitmapTexture* mask) 425 425 { 426 GLuint frontBufferTexture = platformGetTextureID();427 426 IntSize size = m_private->size(); 427 FloatRect rectOnContents(FloatPoint::zero(), size); 428 428 TransformationMatrix adjustedTransform = transform; 429 adjustedTransform.multiply(TransformationMatrix::rectToRect( FloatRect(FloatPoint::zero(), m_private->size()), targetRect));430 static_cast<TextureMapperGL*>(textureMapper)->drawTexture( frontBufferTexture, 0, m_private->size(), targetRect, adjustedTransform, opacity, mask);429 adjustedTransform.multiply(TransformationMatrix::rectToRect(rectOnContents, targetRect)); 430 static_cast<TextureMapperGL*>(textureMapper)->drawTexture(platformGetTextureID(), 0, size, rectOnContents, adjustedTransform, opacity, mask); 431 431 } 432 432
Note: See TracChangeset
for help on using the changeset viewer.