chromium/third_party/blink/web_tests/svg/filters/color-interpolation-filters.svg

<?xml version="1.0" standalone="yes"?>
<svg xmlns = "http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
  <!-- Test for https://bugs.webkit.org/show_bug.cgi?id=6033 -->
  <defs>
    <filter id="default">
      <feColorMatrix type="matrix" in="SourceGraphic" values=".5 0 0 0 0  0 .5 0 0 0  0 0 .5 0 0  0 0 0 1 0"/>
    </filter>
    <filter id="fe-lrgb">
      <feColorMatrix type="matrix" in="SourceGraphic" values=".5 0 0 0 0  0 .5 0 0 0  0 0 .5 0 0  0 0 0 1 0" color-interpolation-filters="linearRGB"/>
    </filter>
    <filter id="fe-srgb">
      <feColorMatrix type="matrix" in="SourceGraphic" values=".5 0 0 0 0  0 .5 0 0 0  0 0 .5 0 0  0 0 0 1 0" color-interpolation-filters="sRGB"/>
    </filter>
    <filter id="f-lrgb" color-interpolation-filters="linearRGB">
      <feColorMatrix type="matrix" in="SourceGraphic" values=".5 0 0 0 0  0 .5 0 0 0  0 0 .5 0 0  0 0 0 1 0"/>
    </filter>
    <filter id="f-srgb" color-interpolation-filters="sRGB">
      <feColorMatrix type="matrix" in="SourceGraphic" values=".5 0 0 0 0  0 .5 0 0 0  0 0 .5 0 0  0 0 0 1 0"/>
    </filter>
    <filter id="f-lrgb-fe-srgb" color-interpolation-filters="linearRGB">
      <feColorMatrix type="matrix" in="SourceGraphic" values=".5 0 0 0 0  0 .5 0 0 0  0 0 .5 0 0  0 0 0 1 0" color-interpolation-filters="sRGB"/>
    </filter>
    <filter id="f-srgb-fe-lrgb" color-interpolation-filters="sRGB">
      <feColorMatrix type="matrix" in="SourceGraphic" values=".5 0 0 0 0  0 .5 0 0 0  0 0 .5 0 0  0 0 0 1 0" color-interpolation-filters="linearRGB"/>
    </filter>

   <filter id="f-multi-lrgb-srgb">
       <feColorMatrix type="matrix" in="SourceGraphic" result="out1" values="0.5 0 0 0 0  0 1 0 0 0  0 0 1 0 0  0 0 0 1 0" color-interpolation-filters="linearRGB"/>
       <feColorMatrix type="matrix" in="out1" values=".5 0 0 0 0  0 .5 0 0 0  0 0 .5 0 0  0 0 0 1 0" color-interpolation-filters="sRGB"/>
   </filter>

   <filter id="f-multi-srgb-lrgb">
       <feColorMatrix type="matrix" in="SourceGraphic" result="out1" values="0.5 0 0 0 0  0 1 0 0 0  0 0 1 0 0  0 0 0 1 0" color-interpolation-filters="sRGB"/>
       <feColorMatrix type="matrix" in="out1" values=".5 0 0 0 0  0 .5 0 0 0  0 0 .5 0 0  0 0 0 1 0" color-interpolation-filters="linearRGB"/>
   </filter>

    <g id="box">
      <rect width="100" height="100" fill="red"/>
      <rect y="100" width="100" height="100" fill="green"/>
      <rect y="200" width="100" height="100" fill="blue"/>
    </g>
    <g id="bar">
      <rect width="800" height="100" fill="purple"/>
    </g>
  </defs>

  <use xlink:href="#box"/>
  <use xlink:href="#box" transform="translate(100,0)" filter="url(#default)"/>
  <use xlink:href="#box" transform="translate(200,0)" filter="url(#fe-lrgb)"/>
  <use xlink:href="#box" transform="translate(300,0)" filter="url(#fe-srgb)"/>
  <use xlink:href="#box" transform="translate(400,0)" filter="url(#f-lrgb)"/>
  <use xlink:href="#box" transform="translate(500,0)" filter="url(#f-srgb)"/>
  <use xlink:href="#box" transform="translate(600,0)" filter="url(#f-lrgb-fe-srgb)"/>
  <use xlink:href="#box" transform="translate(700,0)" filter="url(#f-srgb-fe-lrgb)"/>

  <use xlink:href="#bar" transform="translate(0,300)"/>
  <use xlink:href="#bar" transform="translate(0,400)" filter="url(#f-multi-lrgb-srgb)"/>
  <use xlink:href="#bar" transform="translate(0,500)" filter="url(#f-multi-srgb-lrgb)"/>
</svg>