Changeset 150503 in webkit


Ignore:
Timestamp:
May 21, 2013 11:26:11 PM (11 years ago)
Author:
commit-queue@webkit.org
Message:

Source/WebCore: Update the background blending implementation to match the changes done
in the spec. This implies that background color blending is removed and
the background layers won't blend with the content behind the element
any more.
https://bugs.webkit.org/show_bug.cgi?id=116212

Patch by Mihai Tica <mitica@adobe.com> on 2013-05-21
Reviewed by Dean Jackson.

  • rendering/RenderBox.cpp:

(WebCore::RenderBox::paintFillLayers):

  • rendering/RenderBoxModelObject.cpp:

(WebCore::RenderBoxModelObject::paintFillLayerExtended):

LayoutTests: Updating element background blending to conform to the changes in the spec.
This implies that the background layers won't longer blend with the content
behind the element.
Removing the background color tests, as background color blending is no longer
a valid use case, also modified the current background image tests.
https://bugs.webkit.org/show_bug.cgi?id=116212

Patch by Mihai Tica <mitica@adobe.com> on 2013-05-21
Reviewed by Dean Jackson.

  • css3/compositing/effect-background-blend-mode-color-expected.txt: Removed.
  • css3/compositing/effect-background-blend-mode-color.html: Removed.
  • css3/compositing/effect-background-blend-mode-color2-expected.txt: Removed.
  • css3/compositing/effect-background-blend-mode-color2.html: Removed.
  • css3/compositing/effect-background-blend-mode-stacking-expected.png: Removed.
  • css3/compositing/effect-background-blend-mode-stacking.html:
  • platform/mac/css3/compositing/effect-background-blend-mode-color-expected.png: Removed.
  • platform/mac/css3/compositing/effect-background-blend-mode-color2-expected.png: Removed.
  • platform/mac/css3/compositing/effect-background-blend-mode-expected.png:
  • platform/mac/css3/compositing/effect-background-blend-mode-stacking-expected.png:
Location:
trunk
Files:
7 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r150502 r150503  
     12013-05-21  Mihai Tica  <mitica@adobe.com>
     2
     3        Updating element background blending to conform to the changes in the spec.
     4        This implies that the background layers won't longer blend with the content
     5        behind the element.
     6        Removing the background color tests, as background color blending is no longer
     7        a valid use case, also modified the current background image tests.
     8        https://bugs.webkit.org/show_bug.cgi?id=116212
     9
     10        Reviewed by Dean Jackson.
     11
     12        * css3/compositing/effect-background-blend-mode-color-expected.txt: Removed.
     13        * css3/compositing/effect-background-blend-mode-color.html: Removed.
     14        * css3/compositing/effect-background-blend-mode-color2-expected.txt: Removed.
     15        * css3/compositing/effect-background-blend-mode-color2.html: Removed.
     16        * css3/compositing/effect-background-blend-mode-stacking-expected.png: Removed.
     17        * css3/compositing/effect-background-blend-mode-stacking.html:
     18        * platform/mac/css3/compositing/effect-background-blend-mode-color-expected.png: Removed.
     19        * platform/mac/css3/compositing/effect-background-blend-mode-color2-expected.png: Removed.
     20        * platform/mac/css3/compositing/effect-background-blend-mode-expected.png:
     21        * platform/mac/css3/compositing/effect-background-blend-mode-stacking-expected.png:
     22
    1232013-05-21  Seokju Kwon  <seokju.kwon@gmail.com>
    224
  • trunk/LayoutTests/css3/compositing/effect-background-blend-mode-stacking.html

    r143046 r150503  
    11<!DOCTYPE HTML>
    22<script>
     3
    34    if (window.testRunner) {
    45        window.testRunner.overridePreference("WebKitAcceleratedCompositingEnabled", "1");
     6        window.testRunner.dumpAsText(true);
    57    }
    6     if (window.testRunner)
    7       window.testRunner.dumpAsText(true);
     8
    89</script>
    910<style>
     
    2021}
    2122</style>
    22 <!-- this file should contain a duck on top of a gradient with every type of blending -->
    2323<body style="background-color: red">
    24 <ul>
    25 <li style=""></li>
    26 <li style="opacity: .9"></li>
    27 <li style="-webkit-transform: scale(1.01, 1.01)"></li>
    28 <li style="-webkit-transform: translate3d(.01px,.01px, 01px)"></li>
    29 <li style="-webkit-box-reflect:below 5px linear-gradient(to bottom, transparent 0%, transparent 50%, white 100%);"></li>
    30 <li style="position: fixed; top: 160px;"></li>
    31 </ul>
     24    <ul>
     25        <li></li>
     26        <li style="opacity: .9"></li>
     27        <li style="-webkit-transform: scale(1.01, 1.01)"></li>
     28        <li style="-webkit-transform: translate3d(.01px,.01px, 01px)"></li>
     29        <li style="-webkit-box-reflect: below 5px linear-gradient(to bottom, transparent 0%, transparent 50%, white 100%);"></li>
     30        <li style="position: fixed; top: 160px;"></li>
     31    </ul>
    3232</body>
    3333
  • trunk/Source/WebCore/ChangeLog

    r150498 r150503  
     12013-05-21  Mihai Tica  <mitica@adobe.com>
     2       
     3        Update the background blending implementation to match the changes done
     4        in the spec. This implies that background color blending is removed and
     5        the background layers won't blend with the content behind the element
     6        any more.
     7        https://bugs.webkit.org/show_bug.cgi?id=116212
     8
     9        Reviewed by Dean Jackson.
     10
     11        * rendering/RenderBox.cpp:
     12        (WebCore::RenderBox::paintFillLayers):
     13        * rendering/RenderBoxModelObject.cpp:
     14        (WebCore::RenderBoxModelObject::paintFillLayerExtended):
     15
    1162013-05-21  Ryosuke Niwa  <rniwa@webkit.org>
    217
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r150355 r150503  
    13651365    Vector<const FillLayer*, 8> layers;
    13661366    const FillLayer* curLayer = fillLayer;
     1367    bool shouldDrawBackgroundInSeparateBuffer = false;
    13671368    while (curLayer) {
    13681369        layers.append(curLayer);
     
    13741375        // the layer recursion into paintFillLayerExtended, or to compute the layer geometry here
    13751376        // and pass it down.
    1376        
     1377
     1378        if (!shouldDrawBackgroundInSeparateBuffer && curLayer->blendMode() != BlendModeNormal)
     1379            shouldDrawBackgroundInSeparateBuffer = true;
     1380
    13771381        // The clipOccludesNextLayers condition must be evaluated first to avoid short-circuiting.
    13781382        if (curLayer->clipOccludesNextLayers(curLayer == fillLayer) && curLayer->hasOpaqueImage(this) && curLayer->image()->canRender(this, style()->effectiveZoom()) && curLayer->hasRepeatXY())
     
    13811385    }
    13821386
     1387    GraphicsContext* context = paintInfo.context;
     1388    if (!context)
     1389        shouldDrawBackgroundInSeparateBuffer = false;
     1390    if (shouldDrawBackgroundInSeparateBuffer)
     1391        context->beginTransparencyLayer(1);
     1392
    13831393    Vector<const FillLayer*>::const_reverse_iterator topLayer = layers.rend();
    13841394    for (Vector<const FillLayer*>::const_reverse_iterator it = layers.rbegin(); it != topLayer; ++it)
    13851395        paintFillLayer(paintInfo, c, *it, rect, bleedAvoidance, op, backgroundObject);
     1396
     1397    if (shouldDrawBackgroundInSeparateBuffer)
     1398        context->endTransparencyLayer();
    13861399}
    13871400
  • trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp

    r150395 r150503  
    813813            RoundedRect border = backgroundRoundedRectAdjustedForBleedAvoidance(context, rect, bleedAvoidance, box, boxSize, includeLeftEdge, includeRightEdge);
    814814            if (border.isRenderable())
    815                 context->fillRoundedRect(border, bgColor, style()->colorSpace(), bgLayer->blendMode());
     815                context->fillRoundedRect(border, bgColor, style()->colorSpace());
    816816            else {
    817817                context->save();
    818818                clipRoundedInnerRect(context, rect, border);
    819                 context->fillRect(border.rect(), bgColor, style()->colorSpace(), context->compositeOperation(), bgLayer->blendMode());
     819                context->fillRect(border.rect(), bgColor, style()->colorSpace());
    820820                context->restore();
    821821            }
    822822        } else
    823             context->fillRect(pixelSnappedIntRect(rect), bgColor, style()->colorSpace(), context->compositeOperation(), bgLayer->blendMode());
     823            context->fillRect(pixelSnappedIntRect(rect), bgColor, style()->colorSpace());
    824824
    825825        return;
     
    966966                    baseColor = baseColor.blend(bgColor);
    967967
    968                 context->fillRect(backgroundRect, baseColor, style()->colorSpace(), CompositeCopy, bgLayer->blendMode());
     968                context->fillRect(backgroundRect, baseColor, style()->colorSpace(), CompositeCopy);
    969969            } else if (bgColor.alpha()) {
    970970                CompositeOperator operation = shouldClearBackground ? CompositeCopy : context->compositeOperation();
    971                 context->fillRect(backgroundRect, bgColor, style()->colorSpace(), operation, bgLayer->blendMode());
     971                context->fillRect(backgroundRect, bgColor, style()->colorSpace(), operation);
    972972            } else if (shouldClearBackground)
    973973                context->clearRect(backgroundRect);
Note: See TracChangeset for help on using the changeset viewer.