OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #ifndef SkPDFDevice_DEFINED | 10 #ifndef SkPDFDevice_DEFINED |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 return SkNEW_ARGS(SkPDFDevice, (pageSize, rasterDpi, canon, false)); | 77 return SkNEW_ARGS(SkPDFDevice, (pageSize, rasterDpi, canon, false)); |
78 } | 78 } |
79 | 79 |
80 virtual ~SkPDFDevice(); | 80 virtual ~SkPDFDevice(); |
81 | 81 |
82 /** These are called inside the per-device-layer loop for each draw call. | 82 /** These are called inside the per-device-layer loop for each draw call. |
83 When these are called, we have already applied any saveLayer operations, | 83 When these are called, we have already applied any saveLayer operations, |
84 and are handling any looping from the paint, and any effects from the | 84 and are handling any looping from the paint, and any effects from the |
85 DrawFilter. | 85 DrawFilter. |
86 */ | 86 */ |
87 void drawPaint(const SkDraw&, const SkPaint& paint) SK_OVERRIDE; | 87 void drawPaint(const SkDraw&, const SkPaint& paint) override; |
88 void drawPoints(const SkDraw&, SkCanvas::PointMode mode, | 88 void drawPoints(const SkDraw&, SkCanvas::PointMode mode, |
89 size_t count, const SkPoint[], | 89 size_t count, const SkPoint[], |
90 const SkPaint& paint) SK_OVERRIDE; | 90 const SkPaint& paint) override; |
91 void drawRect(const SkDraw&, const SkRect& r, const SkPaint& paint) SK_OVERR
IDE; | 91 void drawRect(const SkDraw&, const SkRect& r, const SkPaint& paint) override
; |
92 void drawOval(const SkDraw&, const SkRect& oval, const SkPaint& paint) SK_OV
ERRIDE; | 92 void drawOval(const SkDraw&, const SkRect& oval, const SkPaint& paint) overr
ide; |
93 void drawRRect(const SkDraw&, const SkRRect& rr, const SkPaint& paint) SK_OV
ERRIDE; | 93 void drawRRect(const SkDraw&, const SkRRect& rr, const SkPaint& paint) overr
ide; |
94 void drawPath(const SkDraw&, const SkPath& origpath, | 94 void drawPath(const SkDraw&, const SkPath& origpath, |
95 const SkPaint& paint, const SkMatrix* prePathMatrix, | 95 const SkPaint& paint, const SkMatrix* prePathMatrix, |
96 bool pathIsMutable) SK_OVERRIDE; | 96 bool pathIsMutable) override; |
97 void drawBitmapRect(const SkDraw& draw, const SkBitmap& bitmap, | 97 void drawBitmapRect(const SkDraw& draw, const SkBitmap& bitmap, |
98 const SkRect* src, const SkRect& dst, | 98 const SkRect* src, const SkRect& dst, |
99 const SkPaint& paint, | 99 const SkPaint& paint, |
100 SkCanvas::DrawBitmapRectFlags flags) SK_OVERRIDE; | 100 SkCanvas::DrawBitmapRectFlags flags) override; |
101 void drawBitmap(const SkDraw&, const SkBitmap& bitmap, | 101 void drawBitmap(const SkDraw&, const SkBitmap& bitmap, |
102 const SkMatrix& matrix, const SkPaint&) SK_OVERRIDE; | 102 const SkMatrix& matrix, const SkPaint&) override; |
103 void drawSprite(const SkDraw&, const SkBitmap& bitmap, int x, int y, | 103 void drawSprite(const SkDraw&, const SkBitmap& bitmap, int x, int y, |
104 const SkPaint& paint) SK_OVERRIDE; | 104 const SkPaint& paint) override; |
105 void drawText(const SkDraw&, const void* text, size_t len, | 105 void drawText(const SkDraw&, const void* text, size_t len, |
106 SkScalar x, SkScalar y, const SkPaint&) SK_OVERRIDE; | 106 SkScalar x, SkScalar y, const SkPaint&) override; |
107 void drawPosText(const SkDraw&, const void* text, size_t len, | 107 void drawPosText(const SkDraw&, const void* text, size_t len, |
108 const SkScalar pos[], int scalarsPerPos, | 108 const SkScalar pos[], int scalarsPerPos, |
109 const SkPoint& offset, const SkPaint&) SK_OVERRIDE; | 109 const SkPoint& offset, const SkPaint&) override; |
110 void drawVertices(const SkDraw&, SkCanvas::VertexMode, | 110 void drawVertices(const SkDraw&, SkCanvas::VertexMode, |
111 int vertexCount, const SkPoint verts[], | 111 int vertexCount, const SkPoint verts[], |
112 const SkPoint texs[], const SkColor colors[], | 112 const SkPoint texs[], const SkColor colors[], |
113 SkXfermode* xmode, const uint16_t indices[], | 113 SkXfermode* xmode, const uint16_t indices[], |
114 int indexCount, const SkPaint& paint) SK_OVERRIDE; | 114 int indexCount, const SkPaint& paint) override; |
115 void drawDevice(const SkDraw&, SkBaseDevice*, int x, int y, | 115 void drawDevice(const SkDraw&, SkBaseDevice*, int x, int y, |
116 const SkPaint&) SK_OVERRIDE; | 116 const SkPaint&) override; |
117 | 117 |
118 void onAttachToCanvas(SkCanvas* canvas) SK_OVERRIDE; | 118 void onAttachToCanvas(SkCanvas* canvas) override; |
119 void onDetachFromCanvas() SK_OVERRIDE; | 119 void onDetachFromCanvas() override; |
120 SkImageInfo imageInfo() const SK_OVERRIDE; | 120 SkImageInfo imageInfo() const override; |
121 | 121 |
122 enum DrawingArea { | 122 enum DrawingArea { |
123 kContent_DrawingArea, // Drawing area for the page content. | 123 kContent_DrawingArea, // Drawing area for the page content. |
124 kMargin_DrawingArea, // Drawing area for the margin content. | 124 kMargin_DrawingArea, // Drawing area for the margin content. |
125 }; | 125 }; |
126 | 126 |
127 /** Sets the drawing area for the device. Subsequent draw calls are directed | 127 /** Sets the drawing area for the device. Subsequent draw calls are directed |
128 * to the specific drawing area (margin or content). The default drawing | 128 * to the specific drawing area (margin or content). The default drawing |
129 * area is the content drawing area. | 129 * area is the content drawing area. |
130 * | 130 * |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 */ | 177 */ |
178 const SkPDFGlyphSetMap& getFontGlyphUsage() const { | 178 const SkPDFGlyphSetMap& getFontGlyphUsage() const { |
179 return *(fFontGlyphUsage.get()); | 179 return *(fFontGlyphUsage.get()); |
180 } | 180 } |
181 | 181 |
182 #ifdef SK_DEBUG | 182 #ifdef SK_DEBUG |
183 SkPDFCanon* getCanon() const { return fCanon; } | 183 SkPDFCanon* getCanon() const { return fCanon; } |
184 #endif // SK_DEBUG | 184 #endif // SK_DEBUG |
185 | 185 |
186 protected: | 186 protected: |
187 const SkBitmap& onAccessBitmap() SK_OVERRIDE { | 187 const SkBitmap& onAccessBitmap() override { |
188 return fLegacyBitmap; | 188 return fLegacyBitmap; |
189 } | 189 } |
190 | 190 |
191 SkSurface* newSurface(const SkImageInfo&, const SkSurfaceProps&) SK_OVERRIDE
; | 191 SkSurface* newSurface(const SkImageInfo&, const SkSurfaceProps&) override; |
192 | 192 |
193 private: | 193 private: |
194 // TODO(vandebo): push most of SkPDFDevice's state into a core object in | 194 // TODO(vandebo): push most of SkPDFDevice's state into a core object in |
195 // order to get the right access levels without using friend. | 195 // order to get the right access levels without using friend. |
196 friend class ScopedContentEntry; | 196 friend class ScopedContentEntry; |
197 | 197 |
198 SkISize fPageSize; | 198 SkISize fPageSize; |
199 SkISize fContentSize; | 199 SkISize fContentSize; |
200 SkMatrix fInitialTransform; | 200 SkMatrix fInitialTransform; |
201 SkClipStack fExistingClipStack; | 201 SkClipStack fExistingClipStack; |
(...skipping 28 matching lines...) Expand all Loading... |
230 //////////////////////////////////////////////////////////////////////////// | 230 //////////////////////////////////////////////////////////////////////////// |
231 | 231 |
232 SkPDFDevice(SkISize pageSize, | 232 SkPDFDevice(SkISize pageSize, |
233 SkScalar rasterDpi, | 233 SkScalar rasterDpi, |
234 SkPDFCanon* canon, | 234 SkPDFCanon* canon, |
235 bool flip); | 235 bool flip); |
236 | 236 |
237 ContentEntry* getLastContentEntry(); | 237 ContentEntry* getLastContentEntry(); |
238 void setLastContentEntry(ContentEntry* contentEntry); | 238 void setLastContentEntry(ContentEntry* contentEntry); |
239 | 239 |
240 SkBaseDevice* onCreateDevice(const CreateInfo&, const SkPaint*) SK_OVERRIDE; | 240 SkBaseDevice* onCreateDevice(const CreateInfo&, const SkPaint*) override; |
241 | 241 |
242 void init(); | 242 void init(); |
243 void cleanUp(bool clearFontUsage); | 243 void cleanUp(bool clearFontUsage); |
244 SkPDFFormXObject* createFormXObjectFromDevice(); | 244 SkPDFFormXObject* createFormXObjectFromDevice(); |
245 | 245 |
246 void drawFormXObjectWithMask(int xObjectIndex, | 246 void drawFormXObjectWithMask(int xObjectIndex, |
247 SkPDFFormXObject* mask, | 247 SkPDFFormXObject* mask, |
248 const SkClipStack* clipStack, | 248 const SkClipStack* clipStack, |
249 const SkRegion& clipRegion, | 249 const SkRegion& clipRegion, |
250 SkXfermode::Mode mode, | 250 SkXfermode::Mode mode, |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 | 310 |
311 typedef SkBaseDevice INHERITED; | 311 typedef SkBaseDevice INHERITED; |
312 | 312 |
313 // TODO(edisonn): Only SkDocument_PDF and SkPDFImageShader should be able to
create | 313 // TODO(edisonn): Only SkDocument_PDF and SkPDFImageShader should be able to
create |
314 // an SkPDFDevice | 314 // an SkPDFDevice |
315 //friend class SkDocument_PDF; | 315 //friend class SkDocument_PDF; |
316 //friend class SkPDFImageShader; | 316 //friend class SkPDFImageShader; |
317 }; | 317 }; |
318 | 318 |
319 #endif | 319 #endif |
OLD | NEW |