Changeset 139804 in webkit
- Timestamp:
- Jan 15, 2013 3:58:42 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r139803 r139804 1 2013-01-15 Arnaud Renevier <a.renevier@sisa.samsung.com> 2 3 Add Canvas blend modes to Cairo 4 https://bugs.webkit.org/show_bug.cgi?id=105074 5 6 Reviewed by Martin Robinson. 7 8 Unskip fast/canvas/canvas-blend-image.html and 9 fast/canvas/canvas-blend-solid.html 10 11 Add platform specific expected files because currently, expected 12 results are not correct. 13 14 * platform/gtk/TestExpectations: 15 * platform/gtk/fast/canvas/canvas-blend-image-expected.txt: Added. 16 * platform/gtk/fast/canvas/canvas-blend-solid-expected.txt: Added. 17 1 18 2013-01-15 Dima Gorbik <dgorbik@apple.com> 2 19 -
trunk/LayoutTests/platform/gtk/TestExpectations
r139768 r139804 322 322 webkit.org/b/71849 inspector-protocol/layer-tree.html [ Failure ] 323 323 webkit.org/b/71849 transforms/3d [ Skip ] 324 325 # The following test fail because blending is not yet implemented326 webkit.org/b/105543 fast/canvas/canvas-blend-image.html [ Skip ]327 webkit.org/b/105543 fast/canvas/canvas-blend-solid.html [ Skip ]328 324 329 325 # LAYER_TREE_INCLUDES_VISIBLE_RECTS option to layerTreeAsText is only applicable to Mac. -
trunk/Source/WebCore/ChangeLog
r139803 r139804 1 2013-01-15 Arnaud Renevier <a.renevier@sisa.samsung.com> 2 3 Add Canvas blend modes to Cairo 4 https://bugs.webkit.org/show_bug.cgi?id=105074 5 6 Reviewed by Martin Robinson. 7 8 Blend mode implementation for cairo. If BlendMode is normal, use 9 CompositeOperator; otherwise, consider CompositeOperator is 10 source-over. 11 12 Add toCairoOperator(BlendMode) to translate BlendMode to matching 13 cairo_operator_t. 14 15 * platform/graphics/cairo/BitmapImageCairo.cpp: 16 (WebCore::BitmapImage::draw): 17 * platform/graphics/cairo/CairoUtilities.cpp: 18 (WebCore::toCairoOperator): 19 * platform/graphics/cairo/CairoUtilities.h: 20 (WebCore): 21 * platform/graphics/cairo/GraphicsContextCairo.cpp: 22 (WebCore::GraphicsContext::setPlatformCompositeOperation): 23 1 24 2013-01-15 Dima Gorbik <dgorbik@apple.com> 2 25 Implement matching by the voice attribute for WebVTT ::cue pseudo element -
trunk/Source/WebCore/platform/graphics/cairo/BitmapImageCairo.cpp
r137011 r139804 78 78 79 79 void BitmapImage::draw(GraphicsContext* context, const FloatRect& dst, const FloatRect& src, ColorSpace styleColorSpace, CompositeOperator op, 80 BlendMode , RespectImageOrientationEnum shouldRespectImageOrientation)80 BlendMode blendMode, RespectImageOrientationEnum shouldRespectImageOrientation) 81 81 { 82 82 if (!dst.width() || !dst.height() || !src.width() || !src.height()) … … 97 97 98 98 // Set the compositing operation. 99 if (op == CompositeSourceOver && !frameHasAlphaAtIndex(m_currentFrame))99 if (op == CompositeSourceOver && blendMode == BlendModeNormal && !frameHasAlphaAtIndex(m_currentFrame)) 100 100 context->setCompositeOperation(CompositeCopy); 101 101 else 102 context->setCompositeOperation(op );102 context->setCompositeOperation(op, blendMode); 103 103 104 104 #if ENABLE(IMAGE_DECODER_DOWN_SAMPLING) -
trunk/Source/WebCore/platform/graphics/cairo/CairoUtilities.cpp
r124135 r139804 132 132 } 133 133 } 134 cairo_operator_t toCairoOperator(BlendMode blendOp) 135 { 136 switch (blendOp) { 137 case BlendModeNormal: 138 return CAIRO_OPERATOR_OVER; 139 case BlendModeMultiply: 140 return CAIRO_OPERATOR_MULTIPLY; 141 case BlendModeScreen: 142 return CAIRO_OPERATOR_SCREEN; 143 case BlendModeOverlay: 144 return CAIRO_OPERATOR_OVERLAY; 145 case BlendModeDarken: 146 return CAIRO_OPERATOR_DARKEN; 147 case BlendModeLighten: 148 return CAIRO_OPERATOR_LIGHTEN; 149 case BlendModeColorDodge: 150 return CAIRO_OPERATOR_COLOR_DODGE; 151 case BlendModeColorBurn: 152 return CAIRO_OPERATOR_COLOR_BURN; 153 case BlendModeHardLight: 154 return CAIRO_OPERATOR_HARD_LIGHT; 155 case BlendModeSoftLight: 156 return CAIRO_OPERATOR_SOFT_LIGHT; 157 case BlendModeDifference: 158 return CAIRO_OPERATOR_DIFFERENCE; 159 case BlendModeExclusion: 160 return CAIRO_OPERATOR_EXCLUSION; 161 case BlendModeHue: 162 return CAIRO_OPERATOR_HSL_HUE; 163 case BlendModeSaturation: 164 return CAIRO_OPERATOR_HSL_SATURATION; 165 case BlendModeColor: 166 return CAIRO_OPERATOR_HSL_COLOR; 167 case BlendModeLuminosity: 168 return CAIRO_OPERATOR_HSL_LUMINOSITY; 169 default: 170 return CAIRO_OPERATOR_OVER; 171 } 172 } 134 173 135 174 void drawPatternToCairoContext(cairo_t* cr, cairo_surface_t* image, const IntSize& imageSize, const FloatRect& tileRect, -
trunk/Source/WebCore/platform/graphics/cairo/CairoUtilities.h
r98827 r139804 47 47 void appendRegionToCairoContext(cairo_t*, const cairo_region_t*); 48 48 cairo_operator_t toCairoOperator(CompositeOperator op); 49 cairo_operator_t toCairoOperator(BlendMode blendOp); 49 50 void drawPatternToCairoContext(cairo_t* cr, cairo_surface_t* image, const IntSize& imageSize, const FloatRect& tileRect, 50 51 const AffineTransform& patternTransform, const FloatPoint& phase, cairo_operator_t op, const FloatRect& destRect); -
trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
r139138 r139804 984 984 } 985 985 986 void GraphicsContext::setPlatformCompositeOperation(CompositeOperator op, BlendMode) 987 { 988 if (paintingDisabled()) 989 return; 990 991 cairo_set_operator(platformContext()->cr(), toCairoOperator(op)); 986 void GraphicsContext::setPlatformCompositeOperation(CompositeOperator op, BlendMode blendOp) 987 { 988 if (paintingDisabled()) 989 return; 990 991 cairo_operator_t cairo_op; 992 if (blendOp == BlendModeNormal) 993 cairo_op = toCairoOperator(op); 994 else 995 cairo_op = toCairoOperator(blendOp); 996 997 cairo_set_operator(platformContext()->cr(), cairo_op); 992 998 } 993 999
Note: See TracChangeset
for help on using the changeset viewer.