Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Side by Side Diff: src/pdf/SkPDFDevice.h

Issue 935843007: Remove unused parameters to SkDocument::CreatePDF (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove SkPicture::EncodeBitmap Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/doc/SkDocument_PDF.cpp ('k') | src/pdf/SkPDFImage.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 * @param encoder The encoder to encode a bitmap as JPEG (DCT). 130 * @param encoder The encoder to encode a bitmap as JPEG (DCT).
131 * Result of encodings are cached, if the encoder changes the 131 * Result of encodings are cached, if the encoder changes the
132 * behaivor dynamically and an image is added to a second catalog, 132 * behaivor dynamically and an image is added to a second catalog,
133 * we will likely use the result of the first encoding call. 133 * we will likely use the result of the first encoding call.
134 * By returning false from the encoder function, the encoder result 134 * By returning false from the encoder function, the encoder result
135 * is not used. 135 * is not used.
136 * Callers might not want to encode small images, as the time spent 136 * Callers might not want to encode small images, as the time spent
137 * encoding and decoding might not be worth the space savings, 137 * encoding and decoding might not be worth the space savings,
138 * if any at all. 138 * if any at all.
139 */ 139 */
140 void setDCTEncoder(SkPicture::EncodeBitmap encoder) { 140 void setDCTEncoder(SkData* (*encoder)(size_t*, const SkBitmap&)) {
141 fEncoder = encoder; 141 fEncoder = encoder;
142 } 142 }
143 143
144 // PDF specific methods. 144 // PDF specific methods.
145 145
146 /** Returns the resource dictionary for this device. 146 /** Returns the resource dictionary for this device.
147 */ 147 */
148 SK_API SkPDFResourceDict* getResourceDict(); 148 SK_API SkPDFResourceDict* getResourceDict();
149 149
150 /** Get the fonts used on this device. 150 /** Get the fonts used on this device.
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 const SkClipStack* fClipStack; 238 const SkClipStack* fClipStack;
239 239
240 // Accessor and setter functions based on the current DrawingArea. 240 // Accessor and setter functions based on the current DrawingArea.
241 SkAutoTDelete<ContentEntry>* getContentEntries(); 241 SkAutoTDelete<ContentEntry>* getContentEntries();
242 ContentEntry* getLastContentEntry(); 242 ContentEntry* getLastContentEntry();
243 void setLastContentEntry(ContentEntry* contentEntry); 243 void setLastContentEntry(ContentEntry* contentEntry);
244 244
245 // Glyph ids used for each font on this device. 245 // Glyph ids used for each font on this device.
246 SkAutoTDelete<SkPDFGlyphSetMap> fFontGlyphUsage; 246 SkAutoTDelete<SkPDFGlyphSetMap> fFontGlyphUsage;
247 247
248 SkPicture::EncodeBitmap fEncoder; 248 SkData* (*fEncoder)(size_t*, const SkBitmap&);
249 SkScalar fRasterDpi; 249 SkScalar fRasterDpi;
250 250
251 SkBitmap fLegacyBitmap; 251 SkBitmap fLegacyBitmap;
252 252
253 SkPDFDevice(const SkISize& layerSize, const SkClipStack& existingClipStack, 253 SkPDFDevice(const SkISize& layerSize, const SkClipStack& existingClipStack,
254 const SkRegion& existingClipRegion); 254 const SkRegion& existingClipRegion);
255 255
256 // override from SkBaseDevice 256 // override from SkBaseDevice
257 SkBaseDevice* onCreateCompatibleDevice(const CreateInfo&) SK_OVERRIDE; 257 SkBaseDevice* onCreateCompatibleDevice(const CreateInfo&) SK_OVERRIDE;
258 258
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 327
328 typedef SkBaseDevice INHERITED; 328 typedef SkBaseDevice INHERITED;
329 329
330 // TODO(edisonn): Only SkDocument_PDF and SkPDFImageShader should be able to create 330 // TODO(edisonn): Only SkDocument_PDF and SkPDFImageShader should be able to create
331 // an SkPDFDevice 331 // an SkPDFDevice
332 //friend class SkDocument_PDF; 332 //friend class SkDocument_PDF;
333 //friend class SkPDFImageShader; 333 //friend class SkPDFImageShader;
334 }; 334 };
335 335
336 #endif 336 #endif
OLDNEW
« no previous file with comments | « src/doc/SkDocument_PDF.cpp ('k') | src/pdf/SkPDFImage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698