aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pdf/SkPDFFont.h
Commit message (Collapse)AuthorAge
* SkPDF: refactor & code cleanup ahead of https://crrev.com/2322403002Gravatar halcanary2016-09-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | SkPDFDevice::GraphicStateEntry: remove unnecessary fFont and fTextSize. SkPDFDevice::updateFont(): replace with update_font() and inlined code. De-duplicate this block of code. SkPDFResourceDict::GetResourceTypePrefix function made public: removes need for temporary SkString returned by SkPDFResourceDict::getResourceName() GlyphPositioner: delay writing intial matrix until first glyph. Assert that widechars is a constant. SkPDFFont::FontType(): make public so that PDFDevice can know about multibyte status. SkPDFFont::countStretch() removed, and the stretch loop flattened. *no changes in PDF output* BUG=skia:5434 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2327953002 Review-Url: https://codereview.chromium.org/2327953002
* SkPDF: Glyph validation changeGravatar halcanary2016-08-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of mapping invaid glyphIDs to zero or maxGlyphID, don't draw them at all. Validate glyphs when glyph is written, not ahead of time. Don't allocate array to copy user-provided glyphs. Easy early exit from SkPDFDevice::internalDrawText() GlyphPositioner::flush() called ~GlyphPositioner() SkScopeExit class now exists. Assume SkTypeface* pointers are now never null in more places. precalculate alignmentFactor to clean up code. SkPDFDevice::updateFont must be called with validated glyphID. Skip bad glyphs to make this true. SkPDFDevice::updateFont always succeeds. SkPDFFont::GetFontResource always succeeds (preconditions are asserted). If GetMetrics fails, don't call GetFontResource. SkPDFFont::glyphsToPDFFontEncodingCount() becomes SkPDFFont::countStretch() and is inlined. SkPDFFont::glyphsToPDFFontEncoding now works one Glyph at a time and is inlined. SkPDFFont::noteGlyphUsage() operates one glyph at a time. Add SkScopeExit.h; also a unit test for it. SkPostConfig: Fix SK_UNUSED for Win32. No public API changes. TBR=reed@google.com BUG=625995 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2278703002 Review-Url: https://codereview.chromium.org/2278703002
* SkPDF: in-place font subsettingGravatar halcanary2016-08-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Motivation: gross code simplification, also no bitset lookups at draw time. SkPDFFont owns its glyph useage bitset. SkPDFSubstituteMap goes away. SkPDFObject interface is simplified. SkPDFDocument tracks font usage (as hash set), not glyph usage. SkPDFFont gets a simpler constructor. SkPDFFont has first and last glyph set in constructor, not adjusted later. SkPDFFont implementations are simplified. SkPDFGlyphSet is replaced with simple SkBitSet. SkPDFFont sizes its SkBitSets based on glyph count. SkPDFGlyphSetMap goes away. SkBitSet is now non-copyable. SkBitSet now how utility methods to match old SkPDFGlyphSet. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2253283004 CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Win-MSVC-GCE-CPU-AVX2-x86_64-Release-GDI-Trybot,Test-Win-MSVC-GCE-CPU-AVX2-x86_64-Debug-GDI-Trybot Review-Url: https://codereview.chromium.org/2253283004
* SkPDF: cache metrics once.Gravatar halcanary2016-08-18
| | | | | | | | | | | | | | | | | | | | | | | | | | Motivation: drawText can look up unicode mapping at draw time to see if ActualText should be used after crrev.com/2084533004 lands. For each SkTypeface, only call getAdvancedTypefaceMetrics() once per document. Cache the result in the SkPDFCanon, indexed by SkFontID. Also cache PDF FontDescriptors in the canon, also indexed by SkFontID (Type1 fonts only). Simplify PDF font lookup, map SkFontID+SkGlyphID into a uint64_t. Map that uint64_t to SkPDFFonts. Remove SkPDFCanon::findFont(), SkPDFCanon::addFont(), SkPDFFont::IsMatch(), and enum SkPDFFont::Match. SkPDFFont no longer holds on to ref of SkAdvancedTypefaceMetrics. Instead, SkPDFFont::GetFontResource() and SkPDFFont::getFontSubset() get metrics from canon. SkPDFFont multybite bool is now a function of type. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2253993002 CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Win-MSVC-GCE-CPU-AVX2-x86_64-Release-GDI-Trybot,Test-Win-MSVC-GCE-CPU-AVX2-x86_64-Debug-GDI-Trybot Review-Url: https://codereview.chromium.org/2253993002
* Revert of SkPDF: cache metrics once. (patchset #4 id:60001 of ↵Gravatar robertphillips2016-08-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/2253993002/ ) Reason for revert: because Original issue's description: > SkPDF: cache metrics once. > > Motivation: drawText can look up unicode mapping at draw time to see > if ActualText should be used after crrev.com/2084533004 lands. > > For each SkTypeface, only call getAdvancedTypefaceMetrics() once per > document. Cache the result in the SkPDFCanon, indexed by SkFontID. > Also cache PDF FontDescriptors in the canon, also indexed by SkFontID > (Type1 fonts only). > > Simplify PDF font lookup, map SkFontID+SkGlyphID into a uint64_t. Map > that uint64_t to SkPDFFonts. Remove SkPDFCanon::findFont(), > SkPDFCanon::addFont(), SkPDFFont::IsMatch(), and enum SkPDFFont::Match. > > SkPDFFont no longer holds on to ref of SkAdvancedTypefaceMetrics. > Instead, SkPDFFont::GetFontResource() and SkPDFFont::getFontSubset() > get metrics from canon. > > SkPDFFont multybite bool is now a function of type. > GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2253993002 > > Committed: https://skia.googlesource.com/skia/+/0a61270f4ba85d10659fb63a86817b435ec04c94 TBR=bungeman@google.com,halcanary@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review-Url: https://codereview.chromium.org/2251813006
* SkPDF: cache metrics once.Gravatar halcanary2016-08-17
| | | | | | | | | | | | | | | | | | | | | | | Motivation: drawText can look up unicode mapping at draw time to see if ActualText should be used after crrev.com/2084533004 lands. For each SkTypeface, only call getAdvancedTypefaceMetrics() once per document. Cache the result in the SkPDFCanon, indexed by SkFontID. Also cache PDF FontDescriptors in the canon, also indexed by SkFontID (Type1 fonts only). Simplify PDF font lookup, map SkFontID+SkGlyphID into a uint64_t. Map that uint64_t to SkPDFFonts. Remove SkPDFCanon::findFont(), SkPDFCanon::addFont(), SkPDFFont::IsMatch(), and enum SkPDFFont::Match. SkPDFFont no longer holds on to ref of SkAdvancedTypefaceMetrics. Instead, SkPDFFont::GetFontResource() and SkPDFFont::getFontSubset() get metrics from canon. SkPDFFont multybite bool is now a function of type. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2253993002 Review-Url: https://codereview.chromium.org/2253993002
* SkPDF: pull out SkPDFMakeCIDGlyphWidthsArray.cppGravatar halcanary2016-08-17
| | | | | | | Extract from inside SkPDFFont.cpp GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2251803002 Review-Url: https://codereview.chromium.org/2251803002
* SkPDF: eliminate SkPDFCIDfont classGravatar halcanary2016-08-16
| | | | | | | | | get_glyph_widths() and set_glyph_widths() combined. set_glyph_widths() now takes a SkPDFGlyphSet*. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2244173005 Review-Url: https://codereview.chromium.org/2244173005
* SkPDF: SkPDFFont class changesGravatar halcanary2016-08-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SkPDFFont: * inline some one-line methdods. - SkPDFFont::typeface() - SkPDFFont::fontInfo() - SkPDFFont::firstGlyphID() - SkPDFFont::lastGlyphID() - SkPDFFont::getFontDescriptor() * de-virtualize some methods: - SkPDFFont::getType() - SkPDFFont::multiByteGlyphs() * Constructor takes more arguments: fontType, multiByteGlyphs * re-order fields (pointers before shorts) * use sk_sp<T> more, T* less SkAdvancedTypefaceMetrics: * SkAdvancedTypefaceMetrics::fFont now a uint8_t * other enumes are sized. * SkAdvancedTypefaceMetrics::fStyle now big enough. * remove use of SkTBitOr, replaced with fancy templates No public API changes. TBR=reed@google.com GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2246903002 Review-Url: https://codereview.chromium.org/2246903002
* SkPDF: unify drawText and drawPosTextGravatar halcanary2016-08-15
| | | | | | | | | | | | | Motivation: a later CL will add drawTextBlob() (after https://crrev.com/2084533004 lands). This CL is designed with that change in mind. Also fewer redundant lines of code. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2241683005 Committed: https://skia.googlesource.com/skia/+/6059dc32fe36358175cb81541c91e74a2a7e771a Review-Url: https://codereview.chromium.org/2241683005
* Revert of SkPDF: unify drawText and drawPosText (patchset #2 id:40001 of ↵Gravatar robertphillips2016-08-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/2241683005/ ) Reason for revert: I believe this is breaking the Google3 roll Original issue's description: > SkPDF: unify drawText and drawPosText > > Motivation: a later CL will add drawTextBlob() (after > https://crrev.com/2084533004 lands). This CL is designed > with that change in mind. Also fewer redundant lines of > code. > > BUG=skia: > GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2241683005 > > Committed: https://skia.googlesource.com/skia/+/6059dc32fe36358175cb81541c91e74a2a7e771a TBR=bungeman@google.com,halcanary@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review-Url: https://codereview.chromium.org/2248923002
* SkPDF: unify drawText and drawPosTextGravatar halcanary2016-08-15
| | | | | | | | | | | | Motivation: a later CL will add drawTextBlob() (after https://crrev.com/2084533004 lands). This CL is designed with that change in mind. Also fewer redundant lines of code. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2241683005 Review-Url: https://codereview.chromium.org/2241683005
* SkPDF: Subset Type3 (fallback) fontGravatar halcanary2016-08-12
| | | | | | | | | | | | | | | | | | | Motivation: significant file-size reduction. Also: SkPDFFont::subsetFont() returns a sk_sp<SkPDFObject> rather than a SkPDFFont*. SkPDFType3Font constructor no longer populates font info; relies on subsetting. SkPDFFont::Create is easier to read Also: SkPDFType3Font are scaled by emSize rather than 1000. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2231483002 Committed: https://skia.googlesource.com/skia/+/88b138da99328b04cae9a8ee19c3882b8847a550 Review-Url: https://codereview.chromium.org/2231483002
* Revert of SkPDF: Subset Type3 (fallback) font (patchset #8 id:200001 of ↵Gravatar halcanary2016-08-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/2231483002/ ) Reason for revert: internal failing Original issue's description: > SkPDF: Subset Type3 (fallback) font > > Motivation: significant file-size reduction. > > Also: SkPDFFont::subsetFont() returns a sk_sp<SkPDFObject> > rather than a SkPDFFont*. > > SkPDFType3Font constructor no longer populates font info; > relies on subsetting. > > SkPDFFont::Create is easier to read > > Also: SkPDFType3Font are scaled by emSize rather than 1000. > > GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2231483002 > > Committed: https://skia.googlesource.com/skia/+/88b138da99328b04cae9a8ee19c3882b8847a550 TBR=bungeman@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review-Url: https://codereview.chromium.org/2232283003
* SkPDF: Subset Type3 (fallback) fontGravatar halcanary2016-08-11
| | | | | | | | | | | | | | | | | | Motivation: significant file-size reduction. Also: SkPDFFont::subsetFont() returns a sk_sp<SkPDFObject> rather than a SkPDFFont*. SkPDFType3Font constructor no longer populates font info; relies on subsetting. SkPDFFont::Create is easier to read Also: SkPDFType3Font are scaled by emSize rather than 1000. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2231483002 Review-Url: https://codereview.chromium.org/2231483002
* SkPDF: SkPDFFont organization changes.Gravatar halcanary2016-08-09
| | | | | | | | | | | | | | | | | | | | | | | | | | SkPDFFont: - SkPDFType1Font::populate() encode advances correctly. - break out logically independent code into new files: * SkPDFConvertType1FontStream * SkPDFMakeToUnicodeCmap SkPDFFont.cpp is now 380 lines smaller. Expose `SkPDFAppendCmapSections()` for testing. SkPDFFontImpl.h - Fold into SkPDFFont. SkPDFConvertType1FontStream: - Now assume given a SkStreamAsset SkPDFFont: - AdvanceMetric now hidden in a anonymous namespace. No public API changes. TBR=reed@google.com GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2221163002 Review-Url: https://codereview.chromium.org/2221163002
* SkPDF: Glyph Useage Map improvementsGravatar halcanary2016-06-30
| | | | | | | | | | | | | | | | | | | | Instead of having a fFontGlyphUsage on each device and one on each document, just have the one on the document, and never merge. Make fGlyphUsage accesible on SkPDFDocument. Remove SkPDFGlyphSetMap::merge, ::reset, and SkPDFGlyphSet::merge. SkPDFGlyphSetMap has an TArray of SkPDFGlyphSet, not TDArray of SkPDFGlyphSet pointers. SkPDFGlyphSet and SkPDFBitset get move constructors. All tests produce exactly identical output PDFs. BUG=skia:5434 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2112943002 Review-Url: https://codereview.chromium.org/2112943002
* Remove unnecessary includes in src/pdf/Gravatar martina.kollarova2016-06-29
| | | | | | | | | Use forward declaration more. BUG=None GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2110033002 Review-Url: https://codereview.chromium.org/2110033002
* Style bikeshed - remove extraneous whitespaceGravatar halcanary2016-03-29
| | | | | | GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1842753002 Review URL: https://codereview.chromium.org/1842753002
* SkPDF: Hold page objects, not SkPDFDevices.Gravatar halcanary2016-03-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Page Contents: serialize early, at endPage() SkPDFDocument: Rather than holding all SkPDFDevices until onClose(), store fGlyphUseage and array of pages objects. perform_font_subsetting function removed: First half moved to onEndPage. Second half moved to onClose. create_pdf_page function removed: Merged into onEndPage. generate_page_tree: Refactored to use SkTArray<sk_sp<T>> over SkTDArray<T*>. (the former is explicit about ownership, the latter is unclear.) No longer populates a structure of objects to be dumped, unnecessary since dump is always called after serialization. Takes ownership of fPages and returns root of tree-ified version. Less reference churn. SkPDFGlyphSetMap: use new-style iterator. BUG=skia:5087 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1823683005 Review URL: https://codereview.chromium.org/1823683005
* SkPDF: add drop() virtual to release resources early.Gravatar halcanary2016-03-21
| | | | | | | | | | | | | | | | | | | Call drop() after calling emitObject() on top-level objects. In Debug mode, assert that each object is emited exactly once by asserting that emitObject is never called after drop(). Same for addResources(). To make sure that top level objects don't get deleted prematurely, SkPDFObjNumMap takes a reference. Motivation: save RAM. Allow even earlier serialization with later changes. Also: Switch some SkTDArrays to SkTArrays. BUG=skia:5087 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1790023003 Review URL: https://codereview.chromium.org/1790023003
* SkPDF: s/SkAutoTUnref/sk_sp/gGravatar halcanary2016-03-07
| | | | Review URL: https://codereview.chromium.org/1771073002
* SkPDF: fall back on paths for unembeddable fonts.Gravatar halcanary2015-10-12
| | | | | | | | Add GM, SkPDFFont::CanEmbedTypeface BUG=skia:3866 Review URL: https://codereview.chromium.org/1401763002
* Style Change: NULL->nullptrGravatar halcanary2015-08-27
| | | | | | DOCS_PREVIEW= https://skia.org/?cl=1316233002 Review URL: https://codereview.chromium.org/1316233002
* remove SkInstCntGravatar mtklein2015-06-26
| | | | | | | | | | | | | | It's been outclassed by Valgrind and leak sanitizer, and it seems to be causing problems for external folks building Skia. I'm not sure why our own builds seem unaffected. Latest thread: https://groups.google.com/forum/#!topic/skia-discuss/oj9FsQwwSF0 BUG=skia: Review URL: https://codereview.chromium.org/1217573002
* SkPDF: Factor SkPDFCatalog into SkPDFObjNumMap and SkPDFSubstituteMapGravatar halcanary2015-03-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | Motivation: Keep separate features separate. Also, future linearization work will need to have several objNumMap objects share a substituteMap. Also "catalog" has a specific meaning in PDF. This catalog did not map to that catalog. - Modify SkPDFObject::emitObject and SkPDFObject::addResources interface to requiore SkPDFObjNumMap and SkPDFSubstituteMap. - SkPDFObjNumMap const in SkPDFObject::emitObject. - Remove SkPDFCatalog.cpp/.h - Modify SkDocument_PDF.cpp to use new functions - Fold in SkPDFStream::populate - Fold in SkPDFBitmap::emitDict - Move SkPDFObjNumMap and SkPDFSubstituteMap to SkPDFTypes.h - Note (via assert) that SkPDFArray & SkPDFDict don't need to check substitutes. - Remove extra space from SkPDFDict serialization. - SkPDFBitmap SkPDFType0Font SkPDFGraphicState SkPDFStream updated to new interface. - PDFPrimitivesTest updated for new interface. BUG=skia:3585 Review URL: https://codereview.chromium.org/1049753002
* PDF: Canon now owns a reference to all interned objectsGravatar halcanary2015-02-27
| | | | | | | | | | | | | Add SkPDFCanon::reset function to unref all objects. No longer possible to remove object from canon Motivation: this doesn't change these object's lifetime, (they will still be fully unrefed when SkDocument::close() is called, but we no longer have to remove them from the array when their destructor is called. Review URL: https://codereview.chromium.org/966863002
* PDF: remove unnecessary mutexes.Gravatar halcanary2015-02-20
| | | | | | | | We now force all SkPDFObjects to stay on one thread. TBR=mtklein@google.com Review URL: https://codereview.chromium.org/942153002
* PDF: Now threadsafe!Gravatar halcanary2015-02-20
| | | | | | | | | | | | | The PDF canvas is now just as threadsafe as any other Skia canvas. DM updated to thread PDF tests. SkDocument_PDF now owns SkPDFCanon, and pointers to that canon are passed around to all classes that need access to the canon. BUG=skia:2683 Review URL: https://codereview.chromium.org/944643002
* Simplify reference management in SkPDFGravatar halcanary2015-02-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prior to this change, SkPDFObject subclasses were required to track their resources separately from the document structure. (An object has a resource if it depends, via an indirect reference, on another object). This led to a lot of extra code to duplicate effort. I replace the getResources() function with the much simpler addResources() function. I only define a non-trivial addResources() method on arrays, dictionaries, and indirect object references. All other specialized classes simply rely on their parent class's implementation. SkPDFObject::addResources() works by recursively walking the directed graph of object (direct and indirect) references and adding resources to a set. It doesn't matter that there are closed loops in the graph, since we check the set before walking down a branch. - Add SkPDFObject::addResources() virtual function, with four implementations - Remove SkPDFObject::getResources() virtual function and all implementations. - Remove SkPDFObject::GetResourcesHelper() - Remove SkPDFObject::AddResourceHelper() - In SkPDFCatalog::findObjectIndex(), add an object to the catalog if it doesn't exist yet. - SkPDFCatalog::setSubstitute() no longer sets up resources - SkPDFDocument.cpp no longer needs the Streamer object - SkPDFDocument.cpp calls fDocCatalog->addResources to build the resource list. - SkPDFFont::addResource() removed - All SkPDF-::fResource sets removed (they are redundant). - removed SkPDFImage::addSMask() function - SkPDFResourceDict::getReferencedResources() removed. Motivation: this removes quite a bit of code and makes the objects slightly slimmer in memory. Most importantly, this will lead the way towards removing SkPDFObject's inheritance from SkRefCnt, which will greatly simplify everything. Testing: I usually test changes to the PDF backend by comparing checksums of PDF files rendered from GMs and SKPs before and after the change. This change both re-orders and re-numbers the indirect PDF objects. I used the qpdf program to normalize the PDFs and then compared the normalized outputs from before and after the change; they matched. Review URL: https://codereview.chromium.org/870333002
* SkPDFCanonGravatar halcanary2015-01-21
| | | | | | | | | | | | | | | | | SkPDFCanon's fields and methods will eventually become part of SkPDFDocument/SkDocument_PDF. For now, it exists as a singleton to preflight that transition. This replaces three global arrays in SkPDFFont, SkPDFShader, and SkPDFGraphicsContext. This code is still thread-unsafe (http://skbug.com/2683), but moving this functionality into SkPDFDocument will fix that. This CL does not change pdf output from either GMs or SKPs. This change also simplifies some code around the SkPDFCanon methods. BUG=skia:2683 Review URL: https://codereview.chromium.org/842253003
* Fix int16_t for glyphs, const glyphs, and clarify glyph loop.Gravatar bungeman2014-10-03
| | | | | | | | | | | | | | | | | | Several places in the PDF code are using int16_t for glyphs. With newer NotoSans fonts, all possible glyph ids are being used, so this can lead to problems. The PDF glyphs from text code returns the text for the glyphs if the encoding is for glyphs. However, it returns this using an unsafe const cast which is hiding possible bugs and preventing correct use of const in other places. The way the glyph loop in SkPDFDevice::drawPosText is written uses a '--i' in the loop, which makes it appear this can loop forever. I don't believe it can, but it is an unecessary code folding. We should also at least assert the forward progress correctness here. Review URL: https://codereview.chromium.org/626613002
* Make SkPDFFont::fFontInfo a const pointer.Gravatar halcanary2014-07-11
| | | | | | | | | BUG=skia:2742 R=djsollen@google.com, scroggo@google.com Author: halcanary@google.com Review URL: https://codereview.chromium.org/383063007
* [PDF] Fix font embedding restrictions.Gravatar vandebo2014-06-19
| | | | | | | | | | | | Stop using restricted font outlines and honor don't subset restriction. Resubmit of r12600. R=halcanary@google.com, bungeman@google.com, reed@google.com Author: vandebo@chromium.org Review URL: https://codereview.chromium.org/334443002
* fix int/size_t warningsGravatar reed@google.com2014-04-18
| | | | | | | | | | | patch from issue 239933002 BUG=skia: R=bungeman@google.com Review URL: https://codereview.chromium.org/242113010 git-svn-id: http://skia.googlecode.com/svn/trunk@14259 2bbb7eff-a529-9590-31e7-b0007b416f81
* SkNonCopyable should be used with private inheritance.Gravatar commit-bot@chromium.org2014-04-07
| | | | | | | | | | | | | | | This is mostly s/public SkNoncopyable/SkNoncopyable/g. Two classes (SkDrawLooper::Context and SkPicture::OperationList) don't actually work with SkNoncopyable because they introduce a virtual destructor. I added SkNoncopyableVirtual to make them work as intended. Sort of questionable whether they really need to be noncopyable in the first place, but I guess it doesn't hurt to keep the behavior the same. BUG=skia: R=reed@google.com, mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/226183018 git-svn-id: http://skia.googlecode.com/svn/trunk@14081 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert "[PDF] Fix font embedding restrictions."Gravatar vandebo@chromium.org2013-12-10
| | | | | | | | This reverts r12600 and r12601, likely causing crash on Mac. Review URL: https://codereview.chromium.org/111893002 git-svn-id: http://skia.googlecode.com/svn/trunk@12604 2bbb7eff-a529-9590-31e7-b0007b416f81
* [PDF] Fix font embedding restrictions.Gravatar commit-bot@chromium.org2013-12-10
| | | | | | | | | | | | Stop using restricted font outlines and honor don't subset restriction. R=reed@google.com, bungeman@google.com Author: vandebo@chromium.org Review URL: https://codereview.chromium.org/107863002 git-svn-id: http://skia.googlecode.com/svn/trunk@12600 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix compilation with SK_ENABLE_INST_COUNT=1Gravatar commit-bot@chromium.org2013-12-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add INHERITED declarations to class declarations that prevent compilation with the flag. Remove SK_DEFINE_INST_COUNT from all class implementations. Instead, use function-local static variables in the reference count helper classes to create the global instances to store the needed info. The accessor functions are defined inline in the helper classes, so definitions are not needed. The initialization point of the variables should be as well defined as previously. Remove SK_DECLARE_INST_COUNT_TEMPLATE and use SK_DECLARE_INST_COUNT instead. This avoids possible future compilation errors further. For SK_ENABLE_INST_COUNT=0 compilation, add an empty static member function to all classes that use SK_DECLARE_INST_COUNT and SK_DECLARE_INST_COUNT_ROOT macros. The function ensures that classes contain public INHERITED typedef. This member function seems to be compiled away. This shouĺd ensure that part of the compilation errors are caught earlier. Also adds DSK_DECLARE_INST_COUNT to few SkPDFDict subclasses. R=robertphillips@google.com, richardlin@chromium.org, bsalomon@google.com Author: kkinnunen@nvidia.com Review URL: https://codereview.chromium.org/98703002 git-svn-id: http://skia.googlecode.com/svn/trunk@12501 2bbb7eff-a529-9590-31e7-b0007b416f81
* resubmit https://code.google.com/p/skia/source/detail?r=7883 (in the meantime weGravatar edisonn@google.com2013-04-02
| | | | | | | added capability to collect minidump and callstack if buildbot fails with heap coruption in windows, and a NPE bug was fixed in SkPDFDocument, when document was destroyed without ever beeing used and a field was NULL + a few minor conflicts have been resolved) git-svn-id: http://skia.googlecode.com/svn/trunk@8487 2bbb7eff-a529-9590-31e7-b0007b416f81
* Reverting r8233 (Use SkSet in PDF)Gravatar robertphillips@google.com2013-03-20
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@8255 2bbb7eff-a529-9590-31e7-b0007b416f81
* resubmit https://code.google.com/p/skia/source/detail?r=7883 (in the ↵Gravatar edisonn@google.com2013-03-19
| | | | | | | | meantime we added capability to collect minidump and callstack if buildbot fails with heap coruption in windows. a few minor conflicts have been resolved) Review URL: https://codereview.chromium.org/12840004 git-svn-id: http://skia.googlecode.com/svn/trunk@8233 2bbb7eff-a529-9590-31e7-b0007b416f81
* PDF : Unused parameters cleanupGravatar sugoi@google.com2013-03-05
| | | | | | | I removed unused parameters in the PDFs wherever it was trivial to do so. A few constructors had to change signature in the process to reflect the changes. Review URL: https://codereview.appspot.com/7390056 git-svn-id: http://skia.googlecode.com/svn/trunk@7987 2bbb7eff-a529-9590-31e7-b0007b416f81
* Make SkTDArray accessors const-friendly.Gravatar commit-bot@chromium.org2013-02-28
| | | | | | | | This change creates const and non-const versions of SkTDArray::begin(), end(), operator[]() and getAt(). This will keep us from inadvertently changing a const SkTDArray, which the previous signatures allowed. Review URL: https://chromiumcodereview.appspot.com/12315131 git-svn-id: http://skia.googlecode.com/svn/trunk@7902 2bbb7eff-a529-9590-31e7-b0007b416f81
* revert r7892Gravatar edisonn@google.com2013-02-28
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@7896 2bbb7eff-a529-9590-31e7-b0007b416f81
* resubmit after fixing assert issue: https://codereview.appspot.com/6744050Gravatar edisonn@google.com2013-02-27
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@7892 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert r7883Gravatar edisonn@google.com2013-02-27
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@7884 2bbb7eff-a529-9590-31e7-b0007b416f81
* Use SkSet to fix issue when pdf generates an exp number of resources.Gravatar edisonn@google.com2013-02-27
| | | | | | | | | | | | | | | The problem fixed - http://code.google.com/p/skia/issues/detail?id=940 - is that getResources will recursively obtain all child resource recursively without checking for duplicates. If we have lots of duplicates, then we try to build a very large vector (exponential with the number of nodes usually) and sooner or later we end up using too much memory and crash. A possible solution could have been to make sure resources do not have duplicates, but that requirement is impractical, and it this leaves the solution fragile, if there is any issue in the tree, we crash. When we emit the pdf, the large number of duplicates is not an issue, because SkPDFCatalog::addObject will deal with duplicates. I have run the gm with --config pdf, and the images are 100% same bits, while the pdfs have the same size but some very small changes, the order of some objects. Review URL: https://codereview.appspot.com/6744050 git-svn-id: http://skia.googlecode.com/svn/trunk@7883 2bbb7eff-a529-9590-31e7-b0007b416f81
* Remove SkRefPtrGravatar vandebo@chromium.org2013-01-04
| | | | | | | | | (resubmit of https://codereview.appspot.com/7030059/) TBR=junov@google.com Review URL: https://codereview.appspot.com/7030065 git-svn-id: http://skia.googlecode.com/svn/trunk@7030 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert "Remove SkRefPtr" - r7021Gravatar vandebo@chromium.org2013-01-04
| | | | | | | | samplecode/ still needs to be updated. Review URL: https://codereview.appspot.com/7032048 git-svn-id: http://skia.googlecode.com/svn/trunk@7022 2bbb7eff-a529-9590-31e7-b0007b416f81