aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkBitmapController.cpp
Commit message (Collapse)AuthorAge
* De-virtualize SkBitmapControllerGravatar Florin Malita2018-07-19
| | | | | | | | | Fold its only subclass (SkDefaultBitmapController) into base. Change-Id: I77f5c9f3b459d644d5749b8ec34722ec6c2228bf Reviewed-on: https://skia-review.googlesource.com/141541 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Florin Malita <fmalita@chromium.org>
* plumb through arenaallocGravatar Mike Reed2018-07-16
| | | | | | | | | | | - simplifies the older pattern of storage/size - removes a dynamic allocation in defaultbitmapcontroller Bug: skia: Change-Id: Ibc937d3e0c057e78cc0c8bf7d9ad2d824eb240d9 Reviewed-on: https://skia-review.googlesource.com/141321 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Mike Reed <reed@google.com>
* Dest color space no longer impacts mipmaps or texture samplingGravatar Brian Osman2018-06-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PS5: Removes SkDestinationSurfaceColorMode, tracking of mipmap mode on GrTexture, sRGB decode state per-texture. Because we were often choosing sRGB configs for RGB color types, legacy rendering would then be incorrect (too dark). So... PS7: Stops ever using sRGB pixel configs when translating image info or color type. Also removes a bunch of GrCaps bits and a GrContextOption that are no longer relevant. PS9: Adjusts surface creation unit test expectations, and changes the raster rules accordingly. At this point, sRGB configs are (obviously) going to be broken. Locally, I ran 8888, gl, and the gbr- versions of both. Across all GMs x configs, there are 13 diffs. 12 are GMs that create surfaces with a color-space attached (and thus, the offscreen is no longer getting sRGB pixel config). The only remainder constructs an SkPictureImageGenerator, (with an attached color space) and renders it to the gbr-gl canvas, which triggers a a tagged surface inside the generator. Bug: skia: Change-Id: Ie5edfa157dd799f3121e8173fc4f97f6c8ed6789 Reviewed-on: https://skia-review.googlesource.com/131282 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Mike Klein <mtklein@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* Remove uses of sk_throw.Gravatar Ben Wagner2017-08-17
| | | | | | | | | | | The sk_throw macro is now an alias to SK_ABORT, but is often used when other macros better describe the situation. This change replaces sk_throw with SK_ABORT or SkASSERT_RELEASE as appropriate. Change-Id: I313facc6d535c8e8bec90ceeaf17ae3a381c48f3 Reviewed-on: https://skia-review.googlesource.com/35882 Reviewed-by: Yuqian Li <liyuqian@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
* Assume HQ is handled by pipeline, delete legacy code-pathGravatar Mike Reed2017-07-20
| | | | | | | | | CQ_INCLUDE_TRYBOTS=skia.primary:Test-Debian9-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD Bug: skia: Change-Id: If6f0d0a57463bf99a66d674e65a62ce3931d0116 Reviewed-on: https://skia-review.googlesource.com/24644 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: 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>
* support either 32bit swizzle in HQ modeGravatar Mike Reed2017-04-17
| | | | | | | | Bug: skia:6515 Change-Id: I8570a76824026d973fd0cc7247b34de7ae70a190 Reviewed-on: https://skia-review.googlesource.com/13593 Reviewed-by: Brian Osman <brianosman@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>
* Change bitmapcache to not rely on lockpixels.Gravatar Mike Reed2017-04-11
| | | | | | | | | | | | | | | | | | | | The Rec in the cache is the owner of the pixel memory - discardable or - malloc Each external client has a pixelref that just points to those pixels, and whose destructor will notify the rec. This eliminates the dependency on lockPixels in pixelref, freeing us to remove that entirely from pixelref. Bug: skia: Change-Id: If45ed0ae202a1211336626364235215253e8aa7c Reviewed-on: https://skia-review.googlesource.com/10300 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Brian Osman <brianosman@google.com> Reviewed-by: Matt Sarett <msarett@google.com> Reviewed-by: Mike Klein <mtklein@google.com>
* Revert "Revert "simplify api to bitmapcache""Gravatar Mike Reed2017-03-25
| | | | | | | | | | | | Remove (for now) overly agressive assert This reverts commit dd1b4e94c4298213f1f238a8634471086d6749fb. Bug: skia: Change-Id: Ibdcf0b2e92cf108ae710cd180d4fa359f81176d1 Reviewed-on: https://skia-review.googlesource.com/10129 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Revert "simplify api to bitmapcache"Gravatar Florin Malita2017-03-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 9f4b0ae91e1875831cc11f0629b5db998ad85438. Reason for revert: Nanobench asserts. ../../../src/core/SkBitmapCache.cpp:81: fatal error: "assert(scaledWidth != image->width() || scaledHeight != image->height())" Aborted Command exited with code 134 step returned non-zero exit code: 134 https://chromium-swarm.appspot.com/task?id=351b1d10c7936310&refresh=10 Original change's description: > simplify api to bitmapcache > > Force all Find callers to make a bitmpacachedesc, which now > has more rigid validation. > > Goal is to ensure we never make two desc (which turn into keys) > that look different but represent the same image/transformation. > > BUG=skia: > > Change-Id: I8571837ee4754a69acc99e949bee9a465fa25f2b > Reviewed-on: https://skia-review.googlesource.com/10114 > Commit-Queue: Mike Reed <reed@google.com> > Reviewed-by: Brian Osman <brianosman@google.com> > TBR=brianosman@google.com,fmalita@chromium.org,reed@google.com,reviews@skia.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Change-Id: I21b3c8a5bae409ba740cfc28b352c3b970dcf5af Reviewed-on: https://skia-review.googlesource.com/10171 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Florin Malita <fmalita@chromium.org>
* simplify api to bitmapcacheGravatar Mike Reed2017-03-24
| | | | | | | | | | | | | | | Force all Find callers to make a bitmpacachedesc, which now has more rigid validation. Goal is to ensure we never make two desc (which turn into keys) that look different but represent the same image/transformation. BUG=skia: Change-Id: I8571837ee4754a69acc99e949bee9a465fa25f2b Reviewed-on: https://skia-review.googlesource.com/10114 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
* add experimental flag for downscalingGravatar Mike Reed2017-03-23
| | | | | | | | | | | enabling SK_USE_MIP_FOR_DOWNSCALE_HQ makes raster more closely match ganesh BUG=skia: Change-Id: I0fad43d6259755f95ec918ae133915d87be2f0c4 Reviewed-on: https://skia-review.googlesource.com/10058 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Mike Reed <reed@google.com>
* removed unused code around scaled generatorsGravatar Mike Reed2017-02-15
| | | | | | | | | | BUG=skia: Change-Id: I9e042cd9343e0f29032f84ee17b4b316214ec693 Reviewed-on: https://skia-review.googlesource.com/8403 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org> Reviewed-by: Brian Osman <brianosman@google.com>
* bicubic, attempt gazillionGravatar Mike Klein2016-12-09
| | | | | | | | | | | | | - explicitly separate bilinear_ stages in x and y too BUG=skia: CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD Change-Id: Ib7b4f9d26ea6abe9171068e92424479d811ee606 Reviewed-on: https://skia-review.googlesource.com/5636 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Plumb dst color space in many places, rather than "mode"Gravatar Brian Osman2016-12-09
| | | | | | | | | | | | | | | | | This is less to type in most cases, and gives us more information (for things like picture-backed images, where we need to know all about the destination surface). Additionally, strip out the plumbing entirely for bitmap sources, where we don't need to know anything. BUG=skia: Change-Id: I4deff6c7c345fcf62eb08b2aff0560adae4313da Reviewed-on: https://skia-review.googlesource.com/5748 Reviewed-by: Mike Klein <mtklein@chromium.org> Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Remove dest surface color mode from bitmap controllerGravatar Brian Osman2016-12-06
| | | | | | | | | | | This is already on the bitmap provider - no need to plumb it here. BUG=skia: Change-Id: Ie8c5aef8ea443c58d59598aa66e357ad4c212b25 Reviewed-on: https://skia-review.googlesource.com/5621 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
* External SkImageGenerator APIGravatar Florin Malita2016-11-16
| | | | | | | | | | | | | | | Introduce an SkImageGenerator API to support the implementation of externally-managed image decode and scale caches. BUG=skia:5806 R=reed@google.com GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4720 Change-Id: Ibfe37af5471f78f28f88f9d5e80938882be1a344 Reviewed-on: https://skia-review.googlesource.com/4720 Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Mike Reed <reed@google.com>
* Simplify SkBitmapProviderGravatar Florin Malita2016-11-10
| | | | | | | | | | | | | | | | | | We're no longer using SkBitmap sources for SkBitmapProvider, so we can restrict it to SkImage only. At this point we could also remove it, but I think it'll come in handy when we add shader subset support. BUG=skia:5806 R=reed@google.com GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4655 Change-Id: I298da253cc8f7c1205b543521e62060a202a9f78 Reviewed-on: https://skia-review.googlesource.com/4655 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Florin Malita <fmalita@chromium.org>
* Rename SkSourceGammaTreatment to SkDestinationSurfaceColorModeGravatar Brian Osman2016-11-09
| | | | | | | | | | | | | | | This is much more explicit about what that type represents (are we in legacy mode or not), which also makes it suitable for other (upcoming) usage. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4529 Change-Id: Iacb397c34e7765f1ca86c0195bc622b2be4d9acf Reviewed-on: https://skia-review.googlesource.com/4529 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* src/core: s/SkAutoTUnref/sk_sp/gGravatar Hal Canary2016-11-07
| | | | | | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4492 Change-Id: I753ad01b03e891221965252e3befe280d09cdb9f Reviewed-on: https://skia-review.googlesource.com/4492 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* respect srgb gamma when building mipsGravatar reed2016-06-10
| | | | | | | | | | | Proposed policy: - If the target is *legacy* (e.g. L32/PMColor) ignore gamma - If the target is S32/F16 respect gamma BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2029373004 Review-Url: https://codereview.chromium.org/2029373004
* 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
* Remove SK_SUPPORT_LEGACY_BITMAP_FILTER guardGravatar fmalita2016-02-11
| | | | | | | TBR=reed@google.com GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1695443002 Review URL: https://codereview.chromium.org/1695443002
* Relocate anisotropic mipmap logic to SkMipMap::extractLevel()Gravatar fmalita2016-02-09
| | | | | | | | | Pass a full x/y scale and defer the anisotropic heuristic to SkMipMap. R=reed@google.com GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1686563002 Review URL: https://codereview.chromium.org/1686563002
* Use min scale when selecting mip levelGravatar fmalita2016-02-09
| | | | | | | R=reed@google.com,robertphillips@google.com GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1681953004 Review URL: https://codereview.chromium.org/1681953004
* remove dead SK_SUPPORT_LEGACY_NEG_SCALE_HQ flagGravatar reed2016-02-08
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1674263003 Review URL: https://codereview.chromium.org/1674263003
* don't get dismayed by negative scales for HQGravatar reed2016-02-03
| | | | | | | | | needs https://codereview.chromium.org/1663793003/ to land first BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1668033002 Review URL: https://codereview.chromium.org/1668033002
* Delete 2 legacy flagsGravatar fmalita2016-01-25
| | | | | | | | | | | | No longer used in Chrome/Android: SK_SUPPORT_LEGACY_ANISOTROPIC_MIPMAPS SK_SUPPORT_LEGACY_PRESCALE_SEMANTICS R=caryclark@google.com,reed@google.com GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1632633002 Review URL: https://codereview.chromium.org/1632633002
* Anisotropic mipmap fixesGravatar fmalita2016-01-22
| | | | | | | | | | | | 1) when selecting a level scale, use max(scaleX, scaleY) instead of current sqrt(scaleX * scaleY) 2) track and apply non-uniform fixup scales R=reed@google.com GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1617183004 Review URL: https://codereview.chromium.org/1617183004
* use pixmaps in mipmap apiGravatar reed2016-01-16
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1598803002 Review URL: https://codereview.chromium.org/1598803002
* Cap filtering to kMedium_SkFilterQuality when downsamplingGravatar fmalita2015-12-09
| | | | | | R=reed@google.com Review URL: https://codereview.chromium.org/1510673002
* scaling API on SkPixmapGravatar reed2015-11-23
| | | | | | BUG=skia:4481 Review URL: https://codereview.chromium.org/1463373002
* move SkBitmapProvider to its own fileGravatar reed2015-09-15
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1346713002
* create SkBitmapProvider to abstract images and bitmapsGravatar reed2015-09-15
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1340223003
* simplify bitmap scaler and cacheGravatar reed2015-08-31
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1320513005
* Style Change: NULL->nullptrGravatar halcanary2015-08-27
| | | | | | DOCS_PREVIEW= https://skia.org/?cl=1316233002 Review URL: https://codereview.chromium.org/1316233002
* Move SkTemplates.h to private.Gravatar bungeman2015-08-19
| | | | | | | | SkTemplates.h contains a number of Skia specific utilities which are not designed for external use. In addition to reducing the external support burden, this will allow Skia to freely refactor this file. Review URL: https://codereview.chromium.org/1272293004
* change Resize to take pixmap for srcGravatar reed2015-06-12
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1174293005
* switch bitmapshader internals over to pixmapGravatar reed2015-06-04
| | | | | | | BUG=skia: NOTRY=True Review URL: https://codereview.chromium.org/1158273007
* refactor bitmapshader to use a controllerGravatar reed2015-06-04
BUG=skia: Review URL: https://codereview.chromium.org/1153123003