mozilla/pdf.js — pull request #2240 by yurydelendik (2012-10-13 03:51:22+00:00)
Title: Fixes text clipping

Create text mask layer, temporary replaces current image with the empty canvas, let it draw stuff. And upon restore() applies mask, restores saved image and paints the result. Fixes #1125, #1227, #1687, #1931, #2165, #2201.

@brendandahl, can we use the similar technique for smask/blend?