[PDF] Refactor content stream creation in SkPDFDevice to support more xfermodes.
authorvandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Mon, 9 May 2011 07:55:58 +0000 (07:55 +0000)
committervandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Mon, 9 May 2011 07:55:58 +0000 (07:55 +0000)
commit9fbdf875183f5142b8e0ba46ab430cc46ad701bf
treeed1e33ecd601100a41657012aa66e9e6b5966301
parent7744c205f20b5617e83d4af8f97b5771bfa8d671
[PDF] Refactor content stream creation in SkPDFDevice to support more xfermodes.

Instead of writing all drawing and state updates into the final content stream immediately, this change creates a new ContentEntry each time the transform, clip, or paint changes.  Drawing is done into a stream in the ContentEntry.  When the consumer asks for the content, we combine all the ContentEntries with appropriate updates to the state (clip, transform, paint) in between.  This allows us to modify the clip even after a drawing has completed.  It also lets us remove ContentEntries with no drawing.  Further optimization can be done to better use the stack features of PDF, for now we follow the previous model of having a single clip followed by a single transform on the graphic state stack.

Push rectangle logic into SkPDFUtil::AppendRectangle.
Change private functions to adhere to coding standards.

Review URL: http://codereview.appspot.com/4459041

git-svn-id: http://skia.googlecode.com/svn/trunk@1269 2bbb7eff-a529-9590-31e7-b0007b416f81
include/core/SkClipStack.h
include/pdf/SkPDFDevice.h
include/pdf/SkPDFUtils.h
src/core/SkClipStack.cpp
src/pdf/SkPDFDevice.cpp
src/pdf/SkPDFUtils.cpp