Changeset 149010 in webkit
- Timestamp:
- Apr 23, 2013 5:53:42 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 6 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r149001 r149010 1 2013-04-23 Mihai Tica <mitica@adobe.com> 2 3 Add platform support for -webkit-background-blend-mode to CG context with background color 4 https://bugs.webkit.org/show_bug.cgi?id=114412 5 6 Reviewed by Darin Adler. 7 8 Adding pixel tests for -webkit-background-blend-mode with bg-color 9 effect-background-blend-mode-color.html uses accelerated compositing 10 effect-background-blend-mode-color2.html uses software rendering 11 12 * css3/compositing/effect-background-blend-mode-color-expected.txt: Added. 13 * css3/compositing/effect-background-blend-mode-color.html: Added. 14 * platform/mac/css3/compositing/effect-background-blend-mode-color-expected.png: Added. 15 * css3/compositing/effect-background-blend-mode-color2-expected.txt: Added. 16 * css3/compositing/effect-background-blend-mode-color2.html: Added. 17 * platform/mac/css3/compositing/effect-background-blend-mode-color2-expected.png: Added. 18 1 19 2013-04-23 Christophe Dumez <ch.dumez@sisa.samsung.com> 2 20 -
trunk/Source/WebCore/ChangeLog
r149009 r149010 1 2013-04-23 Mihai Tica <mitica@adobe.com> 2 3 Add platform support for -webkit-background-blend-mode to CG context with background color 4 https://bugs.webkit.org/show_bug.cgi?id=114412 5 6 Reviewed by Darin Adler. 7 8 Tests: css3/compositing/effect-background-blend-mode-color.html, css3/compositing/effect-background-blend-mode-color2.html 9 10 This patch adds support for blending on background colors to the Core Graphics port of WebKit. 11 12 * platform/graphics/GraphicsContext.cpp: 13 (WebCore::GraphicsContext::fillRect): 14 (WebCore::GraphicsContext::fillRoundedRect): 15 * platform/graphics/GraphicsContext.h: 16 * rendering/RenderBoxModelObject.cpp: 17 (WebCore::RenderBoxModelObject::paintFillLayerExtended): 18 1 19 2013-04-23 Ryosuke Niwa <rniwa@webkit.org> 2 20 -
trunk/Source/WebCore/platform/graphics/GraphicsContext.cpp
r148757 r149010 674 674 } 675 675 676 void GraphicsContext::fillRect(const FloatRect& rect, const Color& color, ColorSpace styleColorSpace, CompositeOperator op )676 void GraphicsContext::fillRect(const FloatRect& rect, const Color& color, ColorSpace styleColorSpace, CompositeOperator op, BlendMode blendMode) 677 677 { 678 678 if (paintingDisabled()) … … 680 680 681 681 CompositeOperator previousOperator = compositeOperation(); 682 setCompositeOperation(op );682 setCompositeOperation(op, blendMode); 683 683 fillRect(rect, color, styleColorSpace); 684 684 setCompositeOperation(previousOperator); 685 685 } 686 686 687 void GraphicsContext::fillRoundedRect(const RoundedRect& rect, const Color& color, ColorSpace colorSpace) 688 { 689 if (rect.isRounded()) 687 void GraphicsContext::fillRoundedRect(const RoundedRect& rect, const Color& color, ColorSpace colorSpace, BlendMode blendMode) 688 { 689 690 if (rect.isRounded()) { 691 setCompositeOperation(compositeOperation(), blendMode); 690 692 fillRoundedRect(rect.rect(), rect.radii().topLeft(), rect.radii().topRight(), rect.radii().bottomLeft(), rect.radii().bottomRight(), color, colorSpace); 691 else 692 fillRect(rect.rect(), color, colorSpace); 693 setCompositeOperation(compositeOperation()); 694 } else 695 fillRect(rect.rect(), color, colorSpace, compositeOperation(), blendMode); 693 696 } 694 697 -
trunk/Source/WebCore/platform/graphics/GraphicsContext.h
r148757 r149010 302 302 void fillRect(const FloatRect&, const Color&, ColorSpace); 303 303 void fillRect(const FloatRect&, Generator&); 304 void fillRect(const FloatRect&, const Color&, ColorSpace, CompositeOperator );304 void fillRect(const FloatRect&, const Color&, ColorSpace, CompositeOperator, BlendMode = BlendModeNormal); 305 305 void fillRoundedRect(const IntRect&, const IntSize& topLeft, const IntSize& topRight, const IntSize& bottomLeft, const IntSize& bottomRight, const Color&, ColorSpace); 306 void fillRoundedRect(const RoundedRect&, const Color&, ColorSpace );306 void fillRoundedRect(const RoundedRect&, const Color&, ColorSpace, BlendMode = BlendModeNormal); 307 307 void fillRectWithRoundedHole(const IntRect&, const RoundedRect& roundedHoleRect, const Color&, ColorSpace); 308 308 -
trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp
r148949 r149010 788 788 RoundedRect border = backgroundRoundedRectAdjustedForBleedAvoidance(context, rect, bleedAvoidance, box, boxSize, includeLeftEdge, includeRightEdge); 789 789 if (border.isRenderable()) 790 context->fillRoundedRect(border, bgColor, style()->colorSpace() );790 context->fillRoundedRect(border, bgColor, style()->colorSpace(), bgLayer->blendMode()); 791 791 else { 792 792 context->save(); 793 793 clipRoundedInnerRect(context, rect, border); 794 context->fillRect(border.rect(), bgColor, style()->colorSpace() );794 context->fillRect(border.rect(), bgColor, style()->colorSpace(), context->compositeOperation(), bgLayer->blendMode()); 795 795 context->restore(); 796 796 } 797 797 } else 798 context->fillRect(pixelSnappedIntRect(rect), bgColor, style()->colorSpace() );799 798 context->fillRect(pixelSnappedIntRect(rect), bgColor, style()->colorSpace(), context->compositeOperation(), bgLayer->blendMode()); 799 800 800 return; 801 801 } … … 941 941 baseColor = baseColor.blend(bgColor); 942 942 943 context->fillRect(backgroundRect, baseColor, style()->colorSpace(), CompositeCopy );943 context->fillRect(backgroundRect, baseColor, style()->colorSpace(), CompositeCopy, bgLayer->blendMode()); 944 944 } else if (bgColor.alpha()) { 945 945 CompositeOperator operation = shouldClearBackground ? CompositeCopy : context->compositeOperation(); 946 context->fillRect(backgroundRect, bgColor, style()->colorSpace(), operation );946 context->fillRect(backgroundRect, bgColor, style()->colorSpace(), operation, bgLayer->blendMode()); 947 947 } else if (shouldClearBackground) 948 948 context->clearRect(backgroundRect);
Note: See TracChangeset
for help on using the changeset viewer.