aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkPixmap.cpp
Commit message (Collapse)AuthorAge
* Remove SkTransferFunctionBehaviorGravatar Brian Osman2018-07-17
| | | | | | | | Bug: skia: Change-Id: Iccbe609b2a8d4c9098ef36aa6530dbc3771e0c11 Reviewed-on: https://skia-review.googlesource.com/141055 Reviewed-by: Leon Scroggins <scroggo@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Replace nearly all kRespect with kIgnoreGravatar Brian Osman2018-07-12
| | | | | | | | | | | | | | | | | | | | | | | | | | - Encoders and decoders always assume kIgnore. - They are less opinionated about F16 and color space, we just trust the color space that's passed in, and put that directly in the image (no sRGB encoding). - SkBitmap and SkPixmap read/write pixels functions were defaulting to kResepct, those are now always kIgnore. - Many other bits of plumbing are simplified, and I added a default of kIgnore to SkImage::makeColorSpace, so we can phase out that argument entirely. - Still need to add defaults to other public APIs that take SkTransferFunctionBehavior. - This makes gold think that we've dramatically changed the contents of all F16 images, but that's because it doesn't understand the (now linear) color space that's embedded. Once we triage them all once, they will work fine (and they'll look perfect in the browser). Bug: skia: Change-Id: I62fa090f96cae1b67d181ce14bd91f34ff2ed747 Reviewed-on: https://skia-review.googlesource.com/140570 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Mike Klein <mtklein@google.com>
* basic first pass at RGBA F32 supportGravatar Mike Klein2018-06-26
| | | | | | | | | | | | | Draws basically the same as f16. The existing load_f32, load_f32_dst, and store_f32 stages all had the same bug that we'd never noticed because dy was always 0 until now. Change-Id: Ibbd393fa1acc5df414be4cdef0f5a9d11dcccdb3 Reviewed-on: https://skia-review.googlesource.com/137585 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Brian Osman <brianosman@google.com> Reviewed-by: Mike Reed <reed@google.com>
* Stop using SkTSwap.Gravatar Ben Wagner2018-06-19
| | | | | | | | | | | | | Use std::swap instead. It does not appear that any external user specializes SkTSwap, but some may still use it. This removes all use in Skia so that SkTSwap can later be removed in a smaller CL. After that the <utility> include can be removed from SkTypes.h. Change-Id: If03d4ee07dbecda961aa9f0dc34d171ef5168753 Reviewed-on: https://skia-review.googlesource.com/135578 Reviewed-by: Hal Canary <halcanary@google.com> Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
* Revert "Revert "SkTypes: extract SkTo""Gravatar Hal Canary2018-06-14
| | | | | | | | | | | | | | | | This reverts commit fdcfb8b7c23fbf18f872d2c31d27978235033876. > Original change's description: > > SkTypes: extract SkTo > > > > Change-Id: I8de790d5013db2105ad885fa2683303d7c250b09 > > Reviewed-on: https://skia-review.googlesource.com/133620 > > Reviewed-by: Mike Klein <mtklein@google.com> Change-Id: Ida74fbc5c21248a724a5edbf9fae18a33bcb23aa Reviewed-on: https://skia-review.googlesource.com/134506 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* Revert "SkTypes: extract SkTo"Gravatar Hal Canary2018-06-13
| | | | | | | | | | | | | | | | | | | | | | | This reverts commit 2a2f67592602b18527bc3fd449132d420cd5b62e. Reason for revert: this appears to be what is holding up the Chrome roll. Original change's description: > SkTypes: extract SkTo > > Change-Id: I8de790d5013db2105ad885fa2683303d7c250b09 > Reviewed-on: https://skia-review.googlesource.com/133620 > Reviewed-by: Mike Klein <mtklein@google.com> TBR=mtklein@google.com,halcanary@google.com No-Presubmit: true No-Tree-Checks: true No-Try: true Change-Id: Iafd738aedfb679a23c061a51afe4b98a8d4cdfae Reviewed-on: https://skia-review.googlesource.com/134504 Reviewed-by: Hal Canary <halcanary@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* SkTypes: extract SkToGravatar Hal Canary2018-06-12
| | | | | | Change-Id: I8de790d5013db2105ad885fa2683303d7c250b09 Reviewed-on: https://skia-review.googlesource.com/133620 Reviewed-by: Mike Klein <mtklein@google.com>
* Move SkColorTable to src/codecGravatar Leon Scroggins III2018-06-01
| | | | | | | | | | | | | | | It is no longer needed anywhere else, and simply happens to be an implementation detail of SkCodec (at least for now). Remove references to SkColorTable in other classes, and clean up some includes of SkConvertPixels I found along the way. Remove unused includes/methods on SkColorTable Change-Id: I46c8e46f5b77c37710b6cf595d48107d55871d52 Reviewed-on: https://skia-review.googlesource.com/130845 Commit-Queue: Leon Scroggins <scroggo@google.com> Reviewed-by: Mike Klein <mtklein@google.com>
* support 888x, 1010102, and 101010x in SkPixmap::erase()Gravatar Mike Klein2018-03-06
| | | | | | | | | | | ... and a few more methods to make it possible to write the new test. Bug: oss-fuzz:6606 Change-Id: Ie8dd221059579248405f165a93c324c8ba518fd4 Reviewed-on: https://skia-review.googlesource.com/112400 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Fix overflow in number of bytes to erase.Gravatar Herb Derby2018-02-26
| | | | | | | | | | | | The width and the height were multiplied as int * int. Now it is int64_t * int64_t. BUG=chromium:812519 Change-Id: If60bbdd8ee92748559b2e4f3ab57e4463a8006e8 Reviewed-on: https://skia-review.googlesource.com/109781 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Herb Derby <herb@google.com>
* yet another approach to unpremul scale pixelsGravatar Mike Klein2018-02-09
| | | | | | | | | | | This keeps punning things to premul (in anticipation of pulling back on any unpremul support outside read/write/scalePixels), and yet still clamps correctly for scalePixels() + unpremul + HQ and/or gamut transform. Change-Id: I75977cfdb94ffbe62c538ddee39f1abd2cc01935 Reviewed-on: https://skia-review.googlesource.com/106265 Reviewed-by: Brian Osman <brianosman@google.com>
* Revert "alternate approach to unpremul scalePixels()"Gravatar Mike Klein2018-02-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit c4616804bb407506c6ac1046c7e25e2016911449. Reason for revert: screwed up the guard I think Original change's description: > alternate approach to unpremul scalePixels() > > We want to keep the clamps in SkImageShader, and keep unpremul > scalePixels() happy too. > > So we extend SkImageShader's internal API to allow specifying an output > alpha type, which controls whether we premul or unpremul and how we > clamp. scalePixels() uses this to draw instead of a drawBitmap() call. > > Sort of backwards of usual, we opt our local builds into > SK_LEGACY_HIGH_QUALITY_SCALING_CLAMP (and Google3 is already defining > this). Then to rebase Chromium we will _define_ this in Chromium's user > config, fold it through as if always defined in Skia, then finally > remove the definition from Chromium's user config. > > Change-Id: I38035f0886f79700e7301c3c6042ce362c771d96 > Reviewed-on: https://skia-review.googlesource.com/90480 > Reviewed-by: Brian Osman <brianosman@google.com> > Commit-Queue: Mike Klein <mtklein@chromium.org> TBR=mtklein@chromium.org,mtklein@google.com,brianosman@google.com,reed@google.com Change-Id: Ib53a7f29c25310b667f9a61f67f8638403ec9da3 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/106220 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* alternate approach to unpremul scalePixels()Gravatar Mike Klein2018-02-09
| | | | | | | | | | | | | | | | | | | | We want to keep the clamps in SkImageShader, and keep unpremul scalePixels() happy too. So we extend SkImageShader's internal API to allow specifying an output alpha type, which controls whether we premul or unpremul and how we clamp. scalePixels() uses this to draw instead of a drawBitmap() call. Sort of backwards of usual, we opt our local builds into SK_LEGACY_HIGH_QUALITY_SCALING_CLAMP (and Google3 is already defining this). Then to rebase Chromium we will _define_ this in Chromium's user config, fold it through as if always defined in Skia, then finally remove the definition from Chromium's user config. Change-Id: I38035f0886f79700e7301c3c6042ce362c771d96 Reviewed-on: https://skia-review.googlesource.com/90480 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Revert "Revert "move GrColor.h to private, IWYU""Gravatar Mike Reed2018-02-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 63cc29304a65039feaf27842d587ed16de010b0d. Reason for revert: pdfium updated Original change's description: > Revert "move GrColor.h to private, IWYU" > > This reverts commit e602f395813aab8242afad356008b8e79911adbb. > > Reason for revert: Breaks PDFIUM > > Original change's description: > > move GrColor.h to private, IWYU > > > > Bug: skia: > > Change-Id: I0f0dabd7cc54cb7786f53bd6da0c0c012375037e > > Reviewed-on: https://skia-review.googlesource.com/104160 > > Commit-Queue: Mike Reed <reed@google.com> > > Reviewed-by: Brian Salomon <bsalomon@google.com> > > TBR=bsalomon@google.com,reed@google.com > > Change-Id: Ifaa50f8771fa1ca8bc152270efdb1fe27f7210f2 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia: > Reviewed-on: https://skia-review.googlesource.com/104440 > Reviewed-by: Brian Salomon <bsalomon@google.com> > Commit-Queue: Brian Salomon <bsalomon@google.com> TBR=bsalomon@google.com,reed@google.com Change-Id: I22fa5c0e0628b5c1f3b5f13879c7d1a4528cc93a No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/104561 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Revert "move GrColor.h to private, IWYU"Gravatar Brian Salomon2018-02-06
| | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit e602f395813aab8242afad356008b8e79911adbb. Reason for revert: Breaks PDFIUM Original change's description: > move GrColor.h to private, IWYU > > Bug: skia: > Change-Id: I0f0dabd7cc54cb7786f53bd6da0c0c012375037e > Reviewed-on: https://skia-review.googlesource.com/104160 > Commit-Queue: Mike Reed <reed@google.com> > Reviewed-by: Brian Salomon <bsalomon@google.com> TBR=bsalomon@google.com,reed@google.com Change-Id: Ifaa50f8771fa1ca8bc152270efdb1fe27f7210f2 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/104440 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* move GrColor.h to private, IWYUGravatar Mike Reed2018-02-06
| | | | | | | | Bug: skia: Change-Id: I0f0dabd7cc54cb7786f53bd6da0c0c012375037e Reviewed-on: https://skia-review.googlesource.com/104160 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* Reland "remove bicubic clamp in SkImageShader"Gravatar Mike Klein2017-12-21
| | | | | | | | | | | | | | | | | | | | | | This is a reland of bc9f3499c345ce59f8cd3889c580fa75db54034b Original change's description: > remove bicubic clamp in SkImageShader > > We ought to be able to handle out-of-gamut colors now, whatever > their provenance. Should be we can just not clamp here. > > Bug: skia:5733 > > Change-Id: Icd9851543638fd81755afee2eac2347702b88e9f > Reviewed-on: https://skia-review.googlesource.com/87000 > Commit-Queue: Mike Klein <mtklein@chromium.org> > Reviewed-by: Brian Osman <brianosman@google.com> Bug: skia:5733 Change-Id: I66dafdb12abdb02e8677a6f6b18602a2fa3f5f8b Reviewed-on: https://skia-review.googlesource.com/88760 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Revert "remove bicubic clamp in SkImageShader"Gravatar Mike Klein2017-12-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit bc9f3499c345ce59f8cd3889c580fa75db54034b. Reason for revert: gotta be the reason for layout test issues. Original change's description: > remove bicubic clamp in SkImageShader > > We ought to be able to handle out-of-gamut colors now, whatever > their provenance. Should be we can just not clamp here. > > Bug: skia:5733 > > Change-Id: Icd9851543638fd81755afee2eac2347702b88e9f > Reviewed-on: https://skia-review.googlesource.com/87000 > Commit-Queue: Mike Klein <mtklein@chromium.org> > Reviewed-by: Brian Osman <brianosman@google.com> TBR=mtklein@chromium.org,brianosman@google.com # Not skipping CQ checks because original CL landed > 1 day ago. Bug: skia:5733 Change-Id: I3bccf494479b845210ee2a6824dcc32b89a93312 Reviewed-on: https://skia-review.googlesource.com/88423 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* remove bicubic clamp in SkImageShaderGravatar Mike Klein2017-12-20
| | | | | | | | | | | | We ought to be able to handle out-of-gamut colors now, whatever their provenance. Should be we can just not clamp here. Bug: skia:5733 Change-Id: Icd9851543638fd81755afee2eac2347702b88e9f Reviewed-on: https://skia-review.googlesource.com/87000 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Brian Osman <brianosman@google.com>
* test scalePixels and unpremulGravatar Mike Reed2017-11-16
| | | | | | | | | Bug: skia:5733 Change-Id: I6c661408198f6a536e1e55ba01d976948446b8eb Reviewed-on: https://skia-review.googlesource.com/70280 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Brian Osman <brianosman@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
* Make SkImageGeneratorCG apply encoded originGravatar Leon Scroggins III2017-11-03
| | | | | | | | | | | | | | | | | | | | | | | | | | SkImageGeneratorCG: - Detect the origin and apply it to the output - Deprecate NewFromEncodedCG and add MakeFromEncodedCG SkCodecImageGenerator: - Move code elsewhere for sharing - Apply origin for incomplete decodes SkPixmap.cpp/SkPixmapPriv.h: - Now has the shared code for generators to apply origin DMSrcSink.cpp: - Call MakeFromEncodedCG SkCGUtils.h: - Add a version of SkCopyPixelsFromCGImage that takes an SkPixmap Bug: skia:7138 Bug: skia:3834 Change-Id: Ic6dbc76360c6a84913b67373582f328d3946d637 Reviewed-on: https://skia-review.googlesource.com/63740 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Leon Scroggins <scroggo@google.com>
* - add bench for pixmap orientGravatar Mike Reed2017-10-25
| | | | | | | | | | - reduce code size by using a draw instead of custom blits Bug: skia: Change-Id: I90f9fb2abf40496e771f1f725556c178d730b590 Reviewed-on: https://skia-review.googlesource.com/62860 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Reed <reed@google.com>
* Revert[4] "apply codec origin in generator"Gravatar Mike Reed2017-10-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit dd340146f1fe7414702d6fea251da989d425691e. Reason for revert: ios gn file fixed Original change's description: > Revert "Revert "Revert "apply codec origin in generator""" > > This reverts commit 82269abfec798621c8dbbc6bd48996c0b2686f41. > > Reason for revert: ios build needs include path for SkCodec.h > > Original change's description: > > Revert "Revert "apply codec origin in generator"" > > > > This reverts commit 363dd988a55c2ed3fa92e2368c1c889101425734. > > > > Reason for revert: pdfium fix landed > > > > Original change's description: > > > Revert "apply codec origin in generator" > > > > > > This reverts commit fa15877f487333bec876e7315cf584c0d598d098. > > > > > > Reason for revert: Appears to break PDFium. > > > > > > Original change's description: > > > > apply codec origin in generator > > > > > > > > Bug: skia: > > > > Change-Id: I383dacb49b1e3c88467ccdbf3288764bb1bbf01a > > > > Reviewed-on: https://skia-review.googlesource.com/58600 > > > > Reviewed-by: Leon Scroggins <scroggo@google.com> > > > > Commit-Queue: Mike Reed <reed@google.com> > > > > > > TBR=scroggo@google.com,reed@google.com > > > > > > Change-Id: Id97137d6ec39ca638c941928bae6510814b1c499 > > > No-Presubmit: true > > > No-Tree-Checks: true > > > No-Try: true > > > Bug: skia: > > > Reviewed-on: https://skia-review.googlesource.com/60041 > > > Reviewed-by: Ben Wagner <benjaminwagner@google.com> > > > Commit-Queue: Ben Wagner <benjaminwagner@google.com> > > > > TBR=benjaminwagner@google.com,scroggo@google.com,reed@google.com > > > > Change-Id: I1b54a6e6e6cbda07f346ffbbc4977f9db705abcd > > No-Presubmit: true > > No-Tree-Checks: true > > No-Try: true > > Bug: skia: > > Reviewed-on: https://skia-review.googlesource.com/60320 > > Reviewed-by: Mike Reed <reed@google.com> > > Commit-Queue: Mike Reed <reed@google.com> > > TBR=benjaminwagner@google.com,scroggo@google.com,reed@google.com > > Change-Id: I4c2d310521d1a678b407d30b9fe3c261c49d67bc > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia: > Reviewed-on: https://skia-review.googlesource.com/60560 > Reviewed-by: Mike Reed <reed@google.com> > Commit-Queue: Mike Reed <reed@google.com> TBR=benjaminwagner@google.com,scroggo@google.com,reed@google.com Change-Id: I5c1e53aff3ad174b0d4a806c35b7cdcd194479d7 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/60563 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Revert "Revert "Revert "apply codec origin in generator"""Gravatar Mike Reed2017-10-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 82269abfec798621c8dbbc6bd48996c0b2686f41. Reason for revert: ios build needs include path for SkCodec.h Original change's description: > Revert "Revert "apply codec origin in generator"" > > This reverts commit 363dd988a55c2ed3fa92e2368c1c889101425734. > > Reason for revert: pdfium fix landed > > Original change's description: > > Revert "apply codec origin in generator" > > > > This reverts commit fa15877f487333bec876e7315cf584c0d598d098. > > > > Reason for revert: Appears to break PDFium. > > > > Original change's description: > > > apply codec origin in generator > > > > > > Bug: skia: > > > Change-Id: I383dacb49b1e3c88467ccdbf3288764bb1bbf01a > > > Reviewed-on: https://skia-review.googlesource.com/58600 > > > Reviewed-by: Leon Scroggins <scroggo@google.com> > > > Commit-Queue: Mike Reed <reed@google.com> > > > > TBR=scroggo@google.com,reed@google.com > > > > Change-Id: Id97137d6ec39ca638c941928bae6510814b1c499 > > No-Presubmit: true > > No-Tree-Checks: true > > No-Try: true > > Bug: skia: > > Reviewed-on: https://skia-review.googlesource.com/60041 > > Reviewed-by: Ben Wagner <benjaminwagner@google.com> > > Commit-Queue: Ben Wagner <benjaminwagner@google.com> > > TBR=benjaminwagner@google.com,scroggo@google.com,reed@google.com > > Change-Id: I1b54a6e6e6cbda07f346ffbbc4977f9db705abcd > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia: > Reviewed-on: https://skia-review.googlesource.com/60320 > Reviewed-by: Mike Reed <reed@google.com> > Commit-Queue: Mike Reed <reed@google.com> TBR=benjaminwagner@google.com,scroggo@google.com,reed@google.com Change-Id: I4c2d310521d1a678b407d30b9fe3c261c49d67bc No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/60560 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Revert "Revert "apply codec origin in generator""Gravatar Mike Reed2017-10-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 363dd988a55c2ed3fa92e2368c1c889101425734. Reason for revert: pdfium fix landed Original change's description: > Revert "apply codec origin in generator" > > This reverts commit fa15877f487333bec876e7315cf584c0d598d098. > > Reason for revert: Appears to break PDFium. > > Original change's description: > > apply codec origin in generator > > > > Bug: skia: > > Change-Id: I383dacb49b1e3c88467ccdbf3288764bb1bbf01a > > Reviewed-on: https://skia-review.googlesource.com/58600 > > Reviewed-by: Leon Scroggins <scroggo@google.com> > > Commit-Queue: Mike Reed <reed@google.com> > > TBR=scroggo@google.com,reed@google.com > > Change-Id: Id97137d6ec39ca638c941928bae6510814b1c499 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia: > Reviewed-on: https://skia-review.googlesource.com/60041 > Reviewed-by: Ben Wagner <benjaminwagner@google.com> > Commit-Queue: Ben Wagner <benjaminwagner@google.com> TBR=benjaminwagner@google.com,scroggo@google.com,reed@google.com Change-Id: I1b54a6e6e6cbda07f346ffbbc4977f9db705abcd No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/60320 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Revert "apply codec origin in generator"Gravatar Ben Wagner2017-10-16
| | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit fa15877f487333bec876e7315cf584c0d598d098. Reason for revert: Appears to break PDFium. Original change's description: > apply codec origin in generator > > Bug: skia: > Change-Id: I383dacb49b1e3c88467ccdbf3288764bb1bbf01a > Reviewed-on: https://skia-review.googlesource.com/58600 > Reviewed-by: Leon Scroggins <scroggo@google.com> > Commit-Queue: Mike Reed <reed@google.com> TBR=scroggo@google.com,reed@google.com Change-Id: Id97137d6ec39ca638c941928bae6510814b1c499 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/60041 Reviewed-by: Ben Wagner <benjaminwagner@google.com> Commit-Queue: Ben Wagner <benjaminwagner@google.com>
* apply codec origin in generatorGravatar Mike Reed2017-10-16
| | | | | | | | Bug: skia: Change-Id: I383dacb49b1e3c88467ccdbf3288764bb1bbf01a Reviewed-on: https://skia-review.googlesource.com/58600 Reviewed-by: Leon Scroggins <scroggo@google.com> Commit-Queue: Mike Reed <reed@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>
* pixmap erase fast-pathGravatar Mike Klein2017-09-01
| | | | | | | | | | | Brian and I saw a measurable speedup on software path rendering when calling memset(..., 0, ...) instead of looping over one memset per scanline. This brings that fast path to the masses. Change-Id: I792416e30e924efdd6ab40d445148b5c59f7bc62 Reviewed-on: https://skia-review.googlesource.com/41847 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* guard references to SkColorTableGravatar Mike Reed2017-07-18
| | | | | | | | Bug: skia:6828 Change-Id: I0c8c78e70b118f51cb59dc45675e4ddcd4776108 Reviewed-on: https://skia-review.googlesource.com/24260 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Leon Scroggins <scroggo@google.com>
* Don't store colortables in pixmaps or pixelrefsGravatar Mike Reed2017-07-17
| | | | | | | | | | Lots more changes coming later (need to remove colortable parameters from bitmaps and pixmaps) Bug: skia:6828 Change-Id: Ic63e89570644839fab068141f49915b3f66d1053 Reviewed-on: https://skia-review.googlesource.com/24127 Reviewed-by: Leon Scroggins <scroggo@google.com> Commit-Queue: Mike Reed <reed@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>
* Make SkPixmap::getColor support kUnpremul pixelsGravatar Matt Sarett2017-06-09
| | | | | | | | Bug: skia:6319 Change-Id: Id5ad27b4e85516dfdad0c127655e6272bc0a39ac Reviewed-on: https://skia-review.googlesource.com/19089 Commit-Queue: Matt Sarett <msarett@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
* Create an SkColorSpaceXform image generatorGravatar Matt Sarett2017-06-06
| | | | | | | | | | | | | | | | | This should be immediately useful in the Skia-Android rendering pipeline. Possible future uses include creating a "renderable" SkImage from a bitmap with a funny color space. Inspired by: https://skia-review.googlesource.com/c/13981/ Bug: b/62347704 Change-Id: I388c7af1fc43834b8ad22022d0caf3ac90b734c8 Reviewed-on: https://skia-review.googlesource.com/18598 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
* remove vestigle code for lockpixelsGravatar Mike Reed2017-04-20
| | | | | | | | Bug: skia:6481 Change-Id: Icfd53981b8588fbea74fca2e3be58bc6f13ef923 Reviewed-on: https://skia-review.googlesource.com/13968 Reviewed-by: Matt Sarett <msarett@google.com> Commit-Queue: Mike Reed <reed@google.com>
* hide lockpixels api behind flagGravatar Mike Reed2017-04-17
| | | | | | | | | | | | | | guarded by SK_SUPPORT_OBSOLETE_LOCKPIXELS needs https://codereview.chromium.org/2820873002/# to land first Bug: skia:6481 Change-Id: I1c39902cbf6fe99f622adfa8192733b95f7fea09 Change-Id: I1c39902cbf6fe99f622adfa8192733b95f7fea09 Reviewed-on: https://skia-review.googlesource.com/13580 Reviewed-by: Florin Malita <fmalita@chromium.org> Reviewed-by: Leon Scroggins <scroggo@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Use SkTransferFunctionBehavior for raster pixel conversionsGravatar Matt Sarett2017-03-28
| | | | | | | | | | | Fixes some gbr-8888 behaviors. BUG=skia: Change-Id: I1351b043129f7ed0e125bfdb626a0ecaf64c15cc Reviewed-on: https://skia-review.googlesource.com/10169 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Matt Sarett <msarett@google.com>
* Rename SkConfig8888/SkPixelInfo to SkConvertPixelsGravatar Matt Sarett2017-02-15
| | | | | | | | | BUG=skia: Change-Id: I4f3c6370b3ef4247aa446716c7c154899925d089 Reviewed-on: https://skia-review.googlesource.com/8442 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Mike Klein <mtklein@chromium.org>
* Make raster pipeline support all pixel conversionsGravatar Matt Sarett2017-02-14
| | | | | | | | | | | BUG=skia: CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD Change-Id: Idc76999d0f5591a567b3976cb9db829c350e4be2 Reviewed-on: https://skia-review.googlesource.com/8304 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Matt Sarett <msarett@google.com>
* Reland "Refactor trimming logic for read/writePixels()"Gravatar Matt Sarett2017-01-23
| | | | | | | | | | | | | | | | | | | | | | | Original CL: https://skia-review.googlesource.com/c/7326/ (1) Move trimming logic into Bitmap/Pixmap level for raster. Everything goes through here, so we'll only do the work once. (2) This means it also goes to GPU level. (3) Always use SkReadPixelsRec rather than inlining the logic. (4) Create an SkWritePixelsRec to encapsulate write trimming. (5) Disabled kIndex8 as a dst - always. CQ_INCLUDE_TRYBOTS=skia.primary:Perf-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Debug BUG=skia:6021 Change-Id: I25a964e3c610c4e36d195a255e2150657baec649 Reviewed-on: https://skia-review.googlesource.com/7404 Reviewed-by: Matt Sarett <msarett@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
* Revert "Refactor trimming logic for read/writePixels()"Gravatar Matt Sarett2017-01-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 977f64cbfad1ecd7fd4b1231c694c7e828fda1f0. Reason for revert: Triggering nanobench asserts Original change's description: > Refactor trimming logic for read/writePixels() > > (1) Move trimming logic into Bitmap/Pixmap level for > raster. Everything goes through here, so we'll > only do the work once. > (2) This means it also goes to GPU level. > (3) Always use SkReadPixelsRec rather than inlining > the logic. > (4) Create an SkWritePixelsRec to encapsulate write > trimming. > (5) Disabled kIndex8 as a dst - always. > > BUG=skia:6021 > > Change-Id: I748f50c3b726f7c6de5462e2b1ccb54bc387a510 > Reviewed-on: https://skia-review.googlesource.com/7326 > Reviewed-by: Mike Reed <reed@google.com> > Commit-Queue: Matt Sarett <msarett@google.com> > TBR=msarett@google.com,brianosman@google.com,reed@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia:6021 Change-Id: If9aacc6ce8b20e3dfe8a0f22ebca653f28356175 Reviewed-on: https://skia-review.googlesource.com/7379 Commit-Queue: Matt Sarett <msarett@google.com> Reviewed-by: Matt Sarett <msarett@google.com>
* Refactor trimming logic for read/writePixels()Gravatar Matt Sarett2017-01-23
| | | | | | | | | | | | | | | | | | | (1) Move trimming logic into Bitmap/Pixmap level for raster. Everything goes through here, so we'll only do the work once. (2) This means it also goes to GPU level. (3) Always use SkReadPixelsRec rather than inlining the logic. (4) Create an SkWritePixelsRec to encapsulate write trimming. (5) Disabled kIndex8 as a dst - always. BUG=skia:6021 Change-Id: I748f50c3b726f7c6de5462e2b1ccb54bc387a510 Reviewed-on: https://skia-review.googlesource.com/7326 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
* Reland "Add SkImageInfoValidConversion() and SkImageInfoIsValid"Gravatar Matt Sarett2017-01-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The original is at: https://skia-review.googlesource.com/c/6887/ The only change to the original is to temporarily comment out a check in SkImageInfoPriv.h until a Chrome unit test can be fixed. The idea is share these standards for the following: SkImage::readPixels() SkCanvas::readPixels() SkCanvas::writePixels() SkBitmap::readPixels() SkPixmap::readPixels() On the raster side, SkPixmap::readPixels() is the right place to check, because all raster calls go through there eventually. Then at lower levels (ex: SkPixelInfo), we can assert. There's not really a unifying location for gpu calls, so I've added this in multiple places. I haven't really dug into the gpu code to SkASSERT() on invalid cases that we will have already caught. Follow-up work: Similar refactor for SkReadPixelRec::trim(). Code cleanup in SkPixelInfo::CopyPixels() BUG=skia:6021 Change-Id: I6a16f9479bc09e3c87e10c72b0378579f1a70866 Reviewed-on: https://skia-review.googlesource.com/7104 Reviewed-by: Matt Sarett <msarett@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
* Revert "Add SkImageInfoValidConversion() and SkImageInfoIsValid"Gravatar Brian Osman2017-01-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit cf5d6caff7a58f1c7ecc36d9a91ccdada5fc7b78. Reason for revert: Chrome DEPS roll failing, based on the unit tests, I suspect this is the cause. Original change's description: > Add SkImageInfoValidConversion() and SkImageInfoIsValid > > The idea is share these standards for the following: > SkImage::readPixels() > SkCanvas::readPixels() > SkCanvas::writePixels() > SkBitmap::readPixels() > SkPixmap::readPixels() > > On the raster side, SkPixmap::readPixels() is the right > place to check, because all raster calls go through > there eventually. Then at lower levels (ex: SkPixelInfo), > we can assert. > > There's not really a unifying location for gpu calls, > so I've added this in multiple places. I haven't really > dug into the gpu code to SkASSERT() on invalid cases > that we will have already caught. > > Follow-up work: > Similar refactor for SkReadPixelRec::trim(). > Code cleanup in SkPixelInfo::CopyPixels() > > BUG=skia:6021 > > Change-Id: I91ecce10e46c1a6530f0af24a9eb8226dbecaaa2 > Reviewed-on: https://skia-review.googlesource.com/6887 > Reviewed-by: Brian Osman <brianosman@google.com> > Reviewed-by: Mike Reed <reed@google.com> > TBR=mtklein@google.com,msarett@google.com,brianosman@google.com,reed@google.com,reviews@skia.org # Not skipping CQ checks because original CL landed > 1 day ago. BUG=skia:6021 Change-Id: I63b88e90bdbb3051a14de00ac73a8351ab776d25 Reviewed-on: https://skia-review.googlesource.com/7095 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
* Add SkImageInfoValidConversion() and SkImageInfoIsValidGravatar Matt Sarett2017-01-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The idea is share these standards for the following: SkImage::readPixels() SkCanvas::readPixels() SkCanvas::writePixels() SkBitmap::readPixels() SkPixmap::readPixels() On the raster side, SkPixmap::readPixels() is the right place to check, because all raster calls go through there eventually. Then at lower levels (ex: SkPixelInfo), we can assert. There's not really a unifying location for gpu calls, so I've added this in multiple places. I haven't really dug into the gpu code to SkASSERT() on invalid cases that we will have already caught. Follow-up work: Similar refactor for SkReadPixelRec::trim(). Code cleanup in SkPixelInfo::CopyPixels() BUG=skia:6021 Change-Id: I91ecce10e46c1a6530f0af24a9eb8226dbecaaa2 Reviewed-on: https://skia-review.googlesource.com/6887 Reviewed-by: Brian Osman <brianosman@google.com> Reviewed-by: Mike Reed <reed@google.com>
* SkBitmap::ComputeIsOpaque -> SkPixmap::computeIsOpaqueGravatar Hal Canary2016-12-07
| | | | | | | | | | | | | | Motivation: Twice internal Skia clients have to do something awkward like this: bool ComputeIsOpaque(const SkPixmap& pixmap) { SkBitmap bm; return bm.installPixels(pixmap) && SkBitmap::ComputeIsOpaque(bm); } Change-Id: I7263c06f754c1305ecb07c4c005d9cfb9d1f523d Reviewed-on: https://skia-review.googlesource.com/5684 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* SkBitmap::ComputeIsOpaque and SkBitmap::eraseColor support F16Gravatar Hal Canary2016-12-07
| | | | | | | | | Also add a unit test. Change-Id: I9b6635ce9dd504788ca36b3246eaac2b37c2f3a6 Reviewed-on: https://skia-review.googlesource.com/5443 Commit-Queue: Hal Canary <halcanary@google.com> Reviewed-by: Mike Reed <reed@google.com>
* Revert "Revert "make it illegal to include SkXfermode.h""Gravatar Mike Reed2016-11-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit e9d1b299ccbf8017ba57040986ded638f954684a. Reason for revert: <INSERT REASONING HERE> Original change's description: > Revert "make it illegal to include SkXfermode.h" > > This reverts commit 07764cefbb18041a77897df3453903b0a2016583. > > Reason for revert: breaking google3 > > Original change's description: > > make it illegal to include SkXfermode.h > > > > BUG=skia: > > > > GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5133 > > > > Change-Id: I6e8596dcb17cd7e8efa67859bb682bf9bfcac4db > > Reviewed-on: https://skia-review.googlesource.com/5133 > > Reviewed-by: Mike Reed <reed@google.com> > > Commit-Queue: Mike Reed <reed@google.com> > > > > TBR=reed@google.com,reviews@skia.org > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > > Change-Id: I136f9e533eb60633c49dffa19b5747d50b6d98a8 > Reviewed-on: https://skia-review.googlesource.com/5196 > Commit-Queue: Greg Daniel <egdaniel@google.com> > Reviewed-by: Greg Daniel <egdaniel@google.com> > TBR=egdaniel@google.com,reviews@skia.org,reed@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: I0b767ce778a4ade83c2f07d5ece486bb46d7712c Reviewed-on: https://skia-review.googlesource.com/5223 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Mike Reed <reed@google.com>
* Revert "make it illegal to include SkXfermode.h"Gravatar Greg Daniel2016-11-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 07764cefbb18041a77897df3453903b0a2016583. Reason for revert: breaking google3 Original change's description: > make it illegal to include SkXfermode.h > > BUG=skia: > > GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5133 > > Change-Id: I6e8596dcb17cd7e8efa67859bb682bf9bfcac4db > Reviewed-on: https://skia-review.googlesource.com/5133 > Reviewed-by: Mike Reed <reed@google.com> > Commit-Queue: Mike Reed <reed@google.com> > TBR=reed@google.com,reviews@skia.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: I136f9e533eb60633c49dffa19b5747d50b6d98a8 Reviewed-on: https://skia-review.googlesource.com/5196 Commit-Queue: Greg Daniel <egdaniel@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>