aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/pdf/SkPDFDevice.h
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 /include/pdf/SkPDFDevice.h
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 'include/pdf/SkPDFDevice.h')
-rw-r--r--include/pdf/SkPDFDevice.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/pdf/SkPDFDevice.h b/include/pdf/SkPDFDevice.h
index 38797069c4..0efaafddac 100644
--- a/include/pdf/SkPDFDevice.h
+++ b/include/pdf/SkPDFDevice.h
@@ -29,6 +29,7 @@ class SkPDFDict;
class SkPDFFont;
class SkPDFGraphicState;
class SkPDFObject;
+class SkPDFShader;
class SkPDFStream;
class SkPDFDeviceFactory : public SkDeviceFactory {
@@ -146,6 +147,7 @@ private:
SkTDArray<SkPDFGraphicState*> fGraphicStateResources;
SkTDArray<SkPDFObject*> fXObjectResources;
SkTDArray<SkPDFFont*> fFontResources;
+ SkTDArray<SkPDFShader*> fShaderResources;
// In PDF, transforms and clips can only be undone by popping the graphic
// state to before the transform or clip was applied. Because it can be
@@ -165,6 +167,7 @@ private:
SkScalar fTextScaleX;
SkPaint::Style fTextFill;
SkPDFFont* fFont;
+ SkPDFShader* fShader;
SkPDFGraphicState* fGraphicState;
SkRegion fClip;
SkMatrix fTransform;