renderer_alpha_blending_02.rml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <rml>
  2. <head>
  3. <title>Alpha blending 02</title>
  4. <link type="text/rcss" href="../style.rcss"/>
  5. <meta name="Description" content="Test alpha blending with partially transparent, overlapping circles. The wheel on the left side is drawn directly on top of the opaque background. On the other hand, the wheel on the right side is filtered. This results in it being rendered separately on a transparent background, before the finished wheel is blended back onto the opaque background. The end result should look the same if the renderer does alpha compositing correctly." />
  6. <meta name="Assert" content="The left and right wheels in each container should look equivalent. " />
  7. <meta name="Backend" content="Requires backend support for rendering with shaders and filters." />
  8. <style>
  9. body { width: 800dp; }
  10. .white { background: #fff; }
  11. .black { background: #000; }
  12. .container {
  13. padding: 15px;
  14. border: 1px #000;
  15. margin: 10px 15px 30px;
  16. height: 300px;
  17. }
  18. .wheel {
  19. position: relative;
  20. width: 49%;
  21. height: 300px;
  22. float: left;
  23. }
  24. .wheel > div {
  25. width: 200px;
  26. height: 200px;
  27. position: absolute;
  28. top: 0px;
  29. left: 0px;
  30. }
  31. .filter { filter: opacity(1); }
  32. .wheel > .rg { decorator: radial-gradient(#ff09 58%, transparent 60%); }
  33. .wheel > .rb { decorator: radial-gradient(#f0f9 58%, transparent 60%); left: 130px; }
  34. .wheel > .gb { decorator: radial-gradient(#0ff9 58%, transparent 60%); top: 100px; left: 75px; }
  35. </style>
  36. </head>
  37. <body>
  38. <div class="container white">
  39. <div class="wheel">
  40. <div class="rg"/>
  41. <div class="rb"/>
  42. <div class="gb"/>
  43. </div>
  44. <div class="wheel filter">
  45. <div class="rg"/>
  46. <div class="rb"/>
  47. <div class="gb"/>
  48. </div>
  49. </div>
  50. <div class="container black">
  51. <div class="wheel">
  52. <div class="rg"/>
  53. <div class="rb"/>
  54. <div class="gb"/>
  55. </div>
  56. <div class="wheel filter">
  57. <div class="rg"/>
  58. <div class="gb"/>
  59. <div class="rb"/>
  60. </div>
  61. </div>
  62. </body>
  63. </rml>