aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pdf/SkPDFCatalog.cpp
diff options
context:
space:
mode:
authorGravatar vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-03-08 18:31:02 +0000
committerGravatar vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-03-08 18:31:02 +0000
commitda912d61ede86dd3dfa8f645c6f3977f2183812b (patch)
tree593e6cb838888c9cf6c7700e7ca2f65d322320d8 /src/pdf/SkPDFCatalog.cpp
parente8c701cbf5f8749415d4411173234aebb1add740 (diff)
[PDF] Add support for Shaders.
- Shaders, or as they are referred to in PDF, patterns, are drawn in the coordinate system of the initial page, so when we canonicalize them, we have to consider the current transform and where they are constructed. - Image shaders are tiled by default, this makes repeat and mirror modes easy, but means we have to draw a pattern as large as the current clip to support clamp mode. - Gradient shaders are implemented with type 4 functions, which are basically small snippets of post script code. I've tried to make the code generation modular and heavily commented to make it easy to understand or expand. Review URL: http://codereview.appspot.com/4239061 git-svn-id: http://skia.googlecode.com/svn/trunk@905 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/pdf/SkPDFCatalog.cpp')
-rw-r--r--src/pdf/SkPDFCatalog.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/pdf/SkPDFCatalog.cpp b/src/pdf/SkPDFCatalog.cpp
index 493cbbeff5..afa9d9a1c9 100644
--- a/src/pdf/SkPDFCatalog.cpp
+++ b/src/pdf/SkPDFCatalog.cpp
@@ -68,6 +68,8 @@ int SkPDFCatalog::findObjectIndex(SkPDFObject* obj) const {
int SkPDFCatalog::assignObjNum(SkPDFObject* obj) {
int pos = findObjectIndex(obj);
+ // If this assert fails, it means you probably forgot to add an object
+ // to the resource list.
SkASSERT(pos >= 0);
uint32_t currentIndex = pos;
if (fCatalog[currentIndex].fObjNumAssigned)