Compact the clipstack for kReplace_Op'd geometry

When adding a clip rect or clip path to the stack with the
kReplace_Op operation, remove all previous elements within the
same save frame (elements with fSaveCount equal to the current
fSaveCount of the stack). This prevents unbounded growth of the
clipstack for long-lived instances that gets reused.

Addresses https://code.google.com/p/skia/issues/detail?id=748

R=robertphillips@google.com

Author: fs@opera.com

Review URL: https://chromiumcodereview.appspot.com/16160020

git-svn-id: http://skia.googlecode.com/svn/trunk@9502 2bbb7eff-a529-9590-31e7-b0007b416f81
3 files changed