aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pdf
Commit message (Collapse)AuthorAge
* SkPDF: TextSize > 0;Gravatar Hal Canary2017-10-18
| | | | | | | | BUG=chromium:767343 Change-Id: Ide85e82bfc53ef8cf5fb59d9c7733436f83d7209 Reviewed-on: https://skia-review.googlesource.com/61580 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* SkPDF: consolidate two functions in SkPDFObjNumMapGravatar Hal Canary2017-10-10
| | | | | | | Change-Id: Id815920e664ba986258867b7c35a7618a6927b0f Reviewed-on: https://skia-review.googlesource.com/54360 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* make most of SkColorPriv.h privateGravatar Cary Clark2017-09-15
| | | | | | | | | | | | | created new file src/core/SkColorData.h for internal consumption. Note that many of the functions there are unused as well. Bug: skia: 6898 R: reed@google.com Change-Id: I25bfd5a9c21f53558c4ca65a77eb5d322d897c6d Reviewed-on: https://skia-review.googlesource.com/46848 Commit-Queue: Cary Clark <caryclark@google.com> Reviewed-by: Mike Reed <reed@google.com>
* Rename methods and enum on SkClipStack::Element to indicate "device space"Gravatar Brian Salomon2017-08-30
| | | | | | | Change-Id: I83056843b530f76590f755f97e3d0a5a58f371fa Reviewed-on: https://skia-review.googlesource.com/39402 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
* SkPDF: SkWStream::write -> SkWStream::writeTextGravatar Hal Canary2017-08-28
| | | | | | | | | | | Follow on to https://skia.googlesource.com/skia/+/cbc060a No change in output. Change-Id: I3c43cb0207e1e9311a13162f22f7a58d82d239d7 Reviewed-on: https://skia-review.googlesource.com/18075 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Hal Canary <halcanary@skia.org>
* SkPDF: Use DeviceGray for alpha masks.Gravatar Hal Canary2017-07-26
| | | | | | | | | | See https://groups.google.com/forum/#!topic/pdf-dev/qmdjg3w7D8E BUG=chromium:742058 Change-Id: Ia8c204a92cb2b9fc33fab60826a95e359db65f08 Reviewed-on: https://skia-review.googlesource.com/26822 Commit-Queue: Hal Canary <halcanary@google.com> Reviewed-by: Ben Wagner <bungeman@google.com>
* Automatically prepend "disabled-by-default-" to TRACE categoriesGravatar Brian Osman2017-07-26
| | | | | | | | | | | Ensures that all Skia events are disabled by default in Chrome, and eliminates redundant typing. Bug: skia: Change-Id: I289c5e5a01084fcf4cccf512da65a4727f4aeca2 Reviewed-on: https://skia-review.googlesource.com/26880 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Mike Klein <mtklein@chromium.org>
* Tracing macro cleanup continuedGravatar Brian Osman2017-07-26
| | | | | | | | | | | - Remove one especially chatty event, and one pointless test - Use TRACE_FUNC everywhere, rather than manual strings Bug: skia: Change-Id: Icb795294009150ca9a260436738d79546a733337 Reviewed-on: https://skia-review.googlesource.com/26701 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Brian Osman <brianosman@google.com>
* SkPDF: handle unsupported colortypes (e.g. F16) uniformlyGravatar Hal Canary2017-07-20
| | | | | | | Change-Id: I1a9e7a749b5be9dc552608493e23a03db9b2c5b1 Reviewed-on: https://skia-review.googlesource.com/25161 Commit-Queue: Hal Canary <halcanary@google.com> Reviewed-by: Ben Wagner <bungeman@google.com>
* SkPDF: Support alpha-only images with maskfiltersGravatar Hal Canary2017-07-20
| | | | | | | | | | | | | | | | | | - Handle alpha-only images with maskfilters - No longer apply color-filter to alpha-only images (it should apply to the paint color/shader composed with the alpha image instead). - Alpha-only images without maskfilters do sub-pixel clipping. - Non-alpha-only drawImages with maskfilters do sub-pixel clipping. * Fixes `alpha_image` GM (output now matches GPU backend). * Improves GMs `imagemasksubset` and `shadows`. BUG=skia:6735 Change-Id: I62a82b4133ae0eb42d6315785bc3d2cb834bd352 Reviewed-on: https://skia-review.googlesource.com/24820 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* SkPDF: minor cleanups of skpdfdeviceGravatar Hal Canary2017-07-20
| | | | | | | Change-Id: I2143daaa6061003d8631f38ea39724fb12d494db Reviewed-on: https://skia-review.googlesource.com/24747 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* SkPDF: SkPDFMakeShader takes the paint color.Gravatar Hal Canary2017-07-19
| | | | | | | | | | | This allows alpha blending and also alpha shaders with color blended in. fixes GMs: composeshader_alpha, composeshader_bitmap Change-Id: I3ab9cbef216f7733798d2e29541b4211c627dab2 Reviewed-on: https://skia-review.googlesource.com/24760 Commit-Queue: Hal Canary <halcanary@google.com> Reviewed-by: Ben Wagner <bungeman@google.com>
* SkPDF: more paths as rectsGravatar Hal Canary2017-07-19
| | | | | | | | | Motivation: Content streams are marginally smaller and easier to read (for debugging). Change-Id: Idb82276f512408c083a1001da217707fd2d48e49 Reviewed-on: https://skia-review.googlesource.com/24744 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* SkPDF: Fix color glyphs with absolute positioningGravatar Hal Canary2017-07-19
| | | | | | | | | | BUG=chromium:617403 BUG=chromium:717570 BUG=skia:3489 Change-Id: I6b336836359e2cdccf5712edce5efd89f682a74d Reviewed-on: https://skia-review.googlesource.com/24620 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* SkPDF: Re-use Jpeg Image ShadersGravatar Hal Canary2017-07-18
| | | | | | | | | | | | | | | Also, de-dup shader better. - SkBitmapKeyFromImage function factors out image de-dup code. - SkPDFUtils::ToBitmap funtion factors out to-bitmap code - make_image_shader function now takes Image rather than Bitmap. All tests render the same. Some are significantly smaller PDFs. Change-Id: Id8dd36b31c8e573f44a5e9f6058d5a1d622b6385 Reviewed-on: https://skia-review.googlesource.com/24081 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Hal Canary <halcanary@google.com>
* Revert "Revert "SkPDF: Non-outline glyphs as images""Gravatar Hal Canary2017-07-18
| | | | | | | | | | | | | | | | | | | This reverts commit 63b6f8b93209e593f60b235577f5b3d660396d5f. SkPDF: Non-outline glyphs as images - Cache images in PDF Canon for de-duping - For now, rasterize at text scale. In the future, look at CTM and fRasterScale. Original CL: https://skia-review.googlesource.com/24080 BUG=chromium:705480 BUG=skia:3489 Reviewed-by: Ben Wagner <bungeman@google.com> Change-Id: I99783df72c945cfb4b24b6d4db99418aa34e0897 Reviewed-on: https://skia-review.googlesource.com/24322 Reviewed-by: Hal Canary <halcanary@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* Revert "SkPDF: Non-outline glyphs as images"Gravatar Mike Reed2017-07-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 3cf6b79e50f148cae7ed8c6ec0cd79f1ede71c95. Reason for revert: breaking build ../../../../../work/skia/src/pdf/SkPDFDevice.cpp: In member function 'void SkPDFDevice::internalDrawText(const void*, size_t, const SkScalar*, SkTextBlob::GlyphPositioning, SkPoint, const SkPaint&, const uint32_t*, uint32_t, const char*)': ../../../../../work/skia/src/pdf/SkPDFDevice.cpp:1578:31: error: missing initializer for member 'SkPoint::fX' [-Werror=missing-field-initializers] SkPoint xy = {}; ^ Original change's description: > SkPDF: Non-outline glyphs as images > > - Cache images in PDF Canon for de-duping > - For now, rasterize at text scale. in the future, look at CTM and > fRasterScale. > - add a test that works on MacOS > > BUG=chromium:705480 > BUG=skia:3489 > Change-Id: I4fbc42f218e5b81ea15ea6cdccc61c91e532f6d0 > Reviewed-on: https://skia-review.googlesource.com/24080 > Commit-Queue: Hal Canary <halcanary@google.com> > Reviewed-by: Ben Wagner <bungeman@google.com> TBR=halcanary@google.com,bungeman@google.com Change-Id: I3d8800fcb33817c6065da0860a534eb14350d132 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: chromium:705480, skia:3489 Reviewed-on: https://skia-review.googlesource.com/24160 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* SkPDF: Non-outline glyphs as imagesGravatar Hal Canary2017-07-17
| | | | | | | | | | | | | | - Cache images in PDF Canon for de-duping - For now, rasterize at text scale. in the future, look at CTM and fRasterScale. - add a test that works on MacOS BUG=chromium:705480 BUG=skia:3489 Change-Id: I4fbc42f218e5b81ea15ea6cdccc61c91e532f6d0 Reviewed-on: https://skia-review.googlesource.com/24080 Commit-Queue: Hal Canary <halcanary@google.com> Reviewed-by: Ben Wagner <bungeman@google.com>
* Index8 is dead, remove guarded codeGravatar Mike Reed2017-07-17
| | | | | | | | | | Needs google3 to be updated before this can land. Bug: skia:6828 Change-Id: I2c16be13c6937ffa48768cc24f9f980171c824d6 Reviewed-on: https://skia-review.googlesource.com/23940 Reviewed-by: Leon Scroggins <scroggo@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Guard to remove kIndex_8_SkColorTypeGravatar Mike Reed2017-07-13
| | | | | | | | | Bug: skia:6828 Change-Id: Ia942a36abb18213184f8d436555a658270d97d47 Reviewed-on: https://skia-review.googlesource.com/22721 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org> Reviewed-by: Herb Derby <herb@google.com>
* SkPDF: start to support AlphaOnly Images as masks.Gravatar Hal Canary2017-07-12
| | | | | | | | | Does not work when img->isAlphaOnly() && pnt.getMaskFilter(). Change-Id: I60712d035e3a505799258e24660bba30f2c0ed53 Reviewed-on: https://skia-review.googlesource.com/22723 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* SkPDF: simplify drawImage/Bitmap/Sprite code.Gravatar Hal Canary2017-07-12
| | | | | | | | | | | | | | | - SkImageSubset becomes SkKeyedImage - SkPDFCanvas::onDraw{Bitmap, Image} go away - Remove SkPDFCanvas: base classes now do the right thing. - SkPDFDevice::draw{Bitmap,Image}{Rect,}() simplified - 244 fewer SLOC. All but a few PDFs are identical, those rasterize almost the same. Change-Id: I3ceb3b8935c689719cedf1ad544b0407b5c1733e Reviewed-on: https://skia-review.googlesource.com/22218 Commit-Queue: Hal Canary <halcanary@google.com> Reviewed-by: Ben Wagner <bungeman@google.com>
* Revert "Revert "Change image encode api to return sk_sp""Gravatar Mike Reed2017-07-12
| | | | | | | | | | This reverts commit 64778d9f275d8ce3df8f4ab39ff334b7ef5b70d3. Bug: skia: Change-Id: I779515ff1e16a40c33890a4bac7a8a07171aadfe Reviewed-on: https://skia-review.googlesource.com/22261 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Revert "Change image encode api to return sk_sp"Gravatar Mike Reed2017-07-11
| | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit dc799550e2d9965aa5b7cda496465b2a76b310a5. Reason for revert: need to fix sites in Document_none Original change's description: > Change image encode api to return sk_sp > > Bug: skia: > Change-Id: I238289bc630be27795cb1384955dd6e887597c05 > Reviewed-on: https://skia-review.googlesource.com/22208 > Commit-Queue: Mike Reed <reed@google.com> > Reviewed-by: Florin Malita <fmalita@chromium.org> TBR=scroggo@google.com,fmalita@chromium.org,reed@google.com Change-Id: Id7f67027e5f1405a60fdbde29863cdf8daef0cb7 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/22280 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Change image encode api to return sk_spGravatar Mike Reed2017-07-11
| | | | | | | | Bug: skia: Change-Id: I238289bc630be27795cb1384955dd6e887597c05 Reviewed-on: https://skia-review.googlesource.com/22208 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org>
* SkPDF: Change some identifiers.Gravatar Hal Canary2017-07-06
| | | | | | | | | | | s/SkPDFShader::GetPDFShader/SkPDFMakeShader/g s/SkPDFShader::State/SkPDFImageShaderKey/g s/state/key/g Change-Id: I86dc932c3407c73f387c972fb6674dc09ea0be3c Reviewed-on: https://skia-review.googlesource.com/21661 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* SkTypeface: fix non-determinism on AdvacedMetricsGravatar Hal Canary2017-07-06
| | | | | | | | | Calculate fStemV and fCapHeight using SkPaint in SkPDFFont if needed. Change-Id: Iaf762e6c44178fac659dfe9fa312d0caed9138ae Reviewed-on: https://skia-review.googlesource.com/21535 Commit-Queue: Hal Canary <halcanary@google.com> Reviewed-by: Ben Wagner <bungeman@google.com>
* SkDocument: consolidate trimBox codeGravatar Hal Canary2017-07-05
| | | | | | | | Change-Id: I56f651320964eb3bd33475d21e6977803c4ca140 Reviewed-on: https://skia-review.googlesource.com/21370 Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* SkPDF: GradientShaderPatterns use one hashmap not two.Gravatar Hal Canary2017-07-05
| | | | | | | Change-Id: Icdebaf891884aa06bdc36ed930d7bab5400bd04f Reviewed-on: https://skia-review.googlesource.com/21529 Commit-Queue: Hal Canary <halcanary@google.com> Reviewed-by: Ben Wagner <bungeman@google.com>
* SkPDF: Refactor PDFShader to use ShTHashMap<>Gravatar Hal Canary2017-07-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | my tests run ~14% faster. - Split out gradient shaders from image shaders. new compilation unit: SkPDFGradientShader - Common functions InverseTransformBBox and PopulateTilingPatternDict moved to SkPDFUtils - Split SkPDFShader::State into image and gradient structures. - SkPDFCanon is now a simpler structure, with no logic of its own. I am considering just moving all of its fields into SkPDFDocument - SkPDFShader::State (the image/fallback shader) now is POD, making the use of a hashmap for canonicalization straightforward. Formerly, we used a linear search. - Do not bother trying to canonicalize the falback image shader. - SkPDFGradientShader::Key is not POD; comparison of two objects requires looking at the contents of two variable-sized arrays. We now pre-calculate the hash of the arrays using SkOpts::hash and store a hash for the object in the fHash field. Using that hash, we can now canonicalize using a hashmap instead of a linar search! - several static functions renamed to follow style guidelines - stop using codeFunction function pointer; I find that less clear than it could be. - operator==() for SkPDFShader::State and SkPDFGradientShader::Key is now much simpler and can now be inlined. - SkArrayEqual template in SkPDFUtils.h No change to PDF output. BUG=skia:3585 Change-Id: I354ad1b600be6d6749abccb58d13db257370bc0b Reviewed-on: https://skia-review.googlesource.com/21376 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* SkPDF: simplify SkPDFGraphicStateGravatar Hal Canary2017-06-30
| | | | | | | | | | | | | | - Separate graphic state objects for Stroke and Fill. - SkPDFGraphicState::GetGraphicStateForPaint simplified. - No more SkPDFGraphicState objects.Simplify SkPDFCanon. All PDFs render the same. Most PDFs are slightly smaller, especially those from captured web pages. Change-Id: Id9605c1d7495645da558d5f378ba585cdc201bba Reviewed-on: https://skia-review.googlesource.com/21343 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* SkPDF: clean up fRasterDpiGravatar Hal Canary2017-06-30
| | | | | | | | | | | | - PDFDevice no longer has a fRasterDpi; simply queries document. - #define DPI_FOR_RASTER_SCALE_ONE becomes constexpr float. - PDFShader::GetPDFShader no longer takes rasterScale or dpi - Remove un-needed factory functions. We're all adults here. Change-Id: Id2ce75d4e61af385763ccfb1db210465a1600067 Reviewed-on: https://skia-review.googlesource.com/21348 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* SkPDF: Clean upGravatar Hal Canary2017-06-28
| | | | | | | | | | | - Use clearMaskOnGraphicState() - SkPDFGraphicState::MakeNoSmaskGraphicState now moved to only caller. - Get rid of clunky SkPDFUtils::GetCachedT Change-Id: If76a1e915fc31e3ce2654fbe620ff44c1820c0e7 Reviewed-on: https://skia-review.googlesource.com/21142 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* SkPDF: clean up PDFDevice.Gravatar Hal Canary2017-06-27
| | | | | | | | | | | | | | | Motivation: factor out some code for later re-use; clean up. - mask_to_greyscale_image() - addSMaskGraphicState() - clearMaskOnGraphicState() - stop using bare pointer to indicate ownership. - add ScopedContentEntry::stream() Change-Id: I7abe7ff9eab89e1002692017000cda2ca7642631 Reviewed-on: https://skia-review.googlesource.com/20978 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* SkDevice::drawBitmap takes x,y, not matrixGravatar Hal Canary2017-06-27
| | | | | | | | | Motivation: a simpler call should make it easier for SkPDF to learn how to do drawBitmap with A8 bitmap and a maskfilter. Change-Id: I1a5d190b40b0e9e08fa8876d265a9835a3e9987d Reviewed-on: https://skia-review.googlesource.com/20961 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* SkPDF: remove duplicate dict entryGravatar Hal Canary2017-06-23
| | | | | | | Change-Id: I550b4e50694b0cb3ba89c816dc54f3da9e8a9c53 Reviewed-on: https://skia-review.googlesource.com/20682 Reviewed-by: Hal Canary <halcanary@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* SkPDF: implement SkPDFArray::reserve.Gravatar Hal Canary2017-06-23
| | | | | | | | | | SkTArray::reserve() was implemented here: https://skia.googlesource.com/skia/+/06ca8ec%5E%21/#F28 Change-Id: Ibe78cd686506ccb424a827b37bca9c2904565f85 Reviewed-on: https://skia-review.googlesource.com/20518 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* SkPDF: add some TRACE_EVENTsGravatar Hal Canary2017-06-22
| | | | | | | Change-Id: I5f7e7ad57c1e585254378e3fdee4d33c3582d7c2 Reviewed-on: https://skia-review.googlesource.com/20517 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* factor out hexadecimal constants.Gravatar Hal Canary2017-06-19
| | | | | | | | | | Now we don't have to rely on the linker to de-duplicate so many gHex[] constants. Change-Id: Ia86d3a92648415afdb8d29499b4faded5ed05c7d Reviewed-on: https://skia-review.googlesource.com/20180 Commit-Queue: Hal Canary <halcanary@google.com> Reviewed-by: Ben Wagner <bungeman@google.com>
* SkPDF: Glyph-by-glyph bounds-reject.Gravatar Hal Canary2017-06-14
| | | | | | | | BUG=chromium:682644 Change-Id: I9d20dd81886d4de4e74ba043349d456230c89cb1 Reviewed-on: https://skia-review.googlesource.com/19706 Commit-Queue: Hal Canary <halcanary@google.com> Reviewed-by: Ben Wagner <bungeman@google.com>
* SkPDF: consolodate glyph runs on BUILD_FOR_WINGravatar Hal Canary2017-06-12
| | | | | | | Change-Id: I455ebe0bec52752ccbcaa5dc5891cbeb529cb8c0 Reviewed-on: https://skia-review.googlesource.com/16871 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* SkPDF: Do draw{Image,Bitmap} with maskfilter.Gravatar Hal Canary2017-06-07
| | | | | | | | | https://fiddle.skia.org/c/@skbug_237_drawImage_with_blur BUG=skia:237 Change-Id: I50f65d428f254e3965a448a110edd39c0f7a937f Reviewed-on: https://skia-review.googlesource.com/19027 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* SkPDF: Do draw{Image,Bitmap}Rect with maskfilter.Gravatar Hal Canary2017-06-07
| | | | | | | | | | https://fiddle.skia.org/c/@skbug_237_drawImageRect BUG=skia:237 Change-Id: I4d6d683fcbfd6dc86a27998e3d03534458952db0 Reviewed-on: https://skia-review.googlesource.com/19023 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* SkPDF: Draw paths with mask filters; color filter.Gravatar Hal Canary2017-06-05
| | | | | | | | | | | | | | | Also: - drawPaint, drawPath w/ perspective shaders - text with mask filters, stroking, path effect. - SkPDFUtils::GetShaderLocalMatrix BUG=skia:237 BUG=skia:238 BUG=skia:5607 Change-Id: Iffeaf2d7abbde13fd2577ce9feaa178657f48364 Reviewed-on: https://skia-review.googlesource.com/18200 Commit-Queue: Hal Canary <halcanary@google.com> Reviewed-by: Ben Wagner <bungeman@google.com>
* SkPDF: assert premultiplied bitmaps are valid in debug.Gravatar Hal Canary2017-05-25
| | | | | | | Change-Id: I5feeee9a02199c6f4aa91c67e19844e022175d23 Reviewed-on: https://skia-review.googlesource.com/17993 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* SkStream: DynamicMemoryWStream gets writeToAndResetGravatar Hal Canary2017-05-24
| | | | | | | | | | | | | This is similar to copyToAndReset(). Also use this in SkPDF, for minor memory savings: Single-threaded DM's peak RSS drops from 239MB to 228MB. Change-Id: I352a980e6dd54eb05d74cd057bd50e02312753b0 Reviewed-on: https://skia-review.googlesource.com/17714 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* SkPDF: eliminate unnecessary clip for each pageGravatar Hal Canary2017-05-22
| | | | | | | | | | | | Somehow this improves the imagefilterscropped gm. This also makes it easier for me to manually parse PDF output for debugging. Change-Id: I3af39f4b0ca3fc7fcdeec4825bf8649bd9544917 Reviewed-on: https://skia-review.googlesource.com/17413 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* add flag to hide deprecated clipopsGravatar Mike Reed2017-05-10
| | | | | | | | | | | | needs this to land first https://codereview.chromium.org/2877493002/# Bug: skia:3191 Change-Id: Iff5271064877c4e96353d3564464f513eaad0bb5 Reviewed-on: https://skia-review.googlesource.com/16365 Reviewed-by: Brian Salomon <bsalomon@google.com> Reviewed-by: Hal Canary <halcanary@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Revert "Revert "SkTypeface::getAdvancedMetrics(): cleanup""Gravatar Hal Canary2017-05-05
| | | | | | | | | | | | | | | | | | | This reverts commit 59ad782b2b05b07aa6eb961aa4d62e934093cbd1. - SkAdvancedTypefaceMetrics is a struct not a class - SkTypeface::PerGlyphInfo is gone - s/getAdvancedTypefaceMetrics/getAdvancedMetrics/g - s/onGetAdvancedTypefaceMetrics/onGetAdvancedMetrics/g - [on]getAdvancedMetrics now return unique_ptr rather than bare ptr. - [on]getAdvancedMetrics no longer has parameters. (Only caller always used same arguments.) - SkAdvancedTypefaceMetrics uses C++11 in-class member initializers. - SkAdvancedTypefaceMetrics no longer inherits from SkRefCnt Change-Id: I91b56e60f7d9de7d46c426c6bd34ce124e0cf00e Reviewed-on: https://skia-review.googlesource.com/15360 Reviewed-by: Hal Canary <halcanary@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* Revert "SkTypeface::getAdvancedMetrics(): cleanup"Gravatar Hal Canary2017-05-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit cef018896e5cad8eb46a536b60cdf79ebe2b0191. Reason for revert: broke chromium roll (windows). Original change's description: > SkTypeface::getAdvancedMetrics(): cleanup > > - SkAdvancedTypefaceMetrics is a struct not a class > - SkTypeface::PerGlyphInfo is gone > - s/getAdvancedTypefaceMetrics/getAdvancedMetrics/g > - s/onGetAdvancedTypefaceMetrics/onGetAdvancedMetrics/g > - [on]getAdvancedMetrics now return unique_ptr rather than bare ptr. > - [on]getAdvancedMetrics no longer has parameters. (Only caller always > used same arguments.) > - SkAdvancedTypefaceMetrics uses C++11 in-class member initializers. > - SkAdvancedTypefaceMetrics no longer inherits from SkRefCnt > > Change-Id: I37571ebcc383ba9eb21bc20c60c734e3ca317582 > Reviewed-on: https://skia-review.googlesource.com/15311 > Reviewed-by: Ben Wagner <bungeman@google.com> > Commit-Queue: Hal Canary <halcanary@google.com> > TBR=halcanary@google.com,bungeman@google.com,reed@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: I84c7d53df566aaf83427e3368edaa02b7b5a9cb8 Reviewed-on: https://skia-review.googlesource.com/15319 Reviewed-by: Hal Canary <halcanary@google.com> Commit-Queue: Hal Canary <halcanary@google.com>