aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkBitmapCache.h
Commit message (Collapse)AuthorAge
* 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>
* 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>
* remove dead code in bitmapcacheGravatar Mike Reed2017-03-23
| | | | | | | | | BUG=skia: Change-Id: If17511179851ac192758f9d96092ff6dd7c60888 Reviewed-on: https://skia-review.googlesource.com/10055 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Mike Reed <reed@google.com>
* 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>
* 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
* 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
* cache private readback for gpu-imagesGravatar reed2015-08-04
| | | | | | | | | | | | Does not try to cache calls to readPixels at the moment: - not triggered by drawing - not clear if we want to perform any pixel transformations (that readPixels allows) on the GPU or CPU Can consider that another time. BUG=513695 Review URL: https://codereview.chromium.org/1262923003
* only notify bitmaps that have been added to the cacheGravatar reed2015-02-25
| | | | | | | | | | | | old code: - calls=2677 hit-rate=3.51139% new code: - calls=94 hit-rate=97.8723% BUG=skia: Review URL: https://codereview.chromium.org/960563002
* Notify resource caches when pixelref genID goes staleGravatar reed2015-02-24
| | | | | | | | patch from issue 954443002 at patchset 40001 (http://crrev.com/954443002#ps40001) BUG=skia: Review URL: https://codereview.chromium.org/950363002
* Revert of notify resource caches when pixelref genID goes stale (patchset #4 ↵Gravatar mtklein2015-02-19
| | | | | | | | | | | | | | | | | | | | | | | | id:60001 of https://codereview.chromium.org/825263005/) Reason for revert: Crazy failures. http://build.chromium.org/p/client.skia/builders/Test-Mac10.8-MacMini4.1-GeForce320M-x86_64-Debug/builds/1428/steps/dm/logs/stdio Original issue's description: > notify resource caches when pixelref genID goes stale > > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/4675819b9dbb3ad71ec851776e5de26d342f29fe TBR=bsalomon@google.com,reed@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/936423002
* notify resource caches when pixelref genID goes staleGravatar reed2015-02-19
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/825263005
* Add SkCachedData and use it for SkMipMapGravatar reed2014-10-08
| | | | | | | | This reverts commit 37c5a815d8ea33247968212ef4cc83394ceee1bc. TBR=mtklein Review URL: https://codereview.chromium.org/635333002
* Speculative revert to diagnose crash in chrome. Revert "Add SkCachedData and ↵Gravatar reed2014-10-03
| | | | | | | | | | | use it for SkMipMap" This reverts commit 92561a0b99ad6c08ab7a11dd1872f028199392e9. crasher in question: https://code.google.com/p/chromium/issues/detail?id=420178 Review URL: https://codereview.chromium.org/617613003
* Add SkCachedData and use it for SkMipMapGravatar reed2014-10-02
| | | | Review URL: https://codereview.chromium.org/592843003
* allow SkBitmapCache to operate on a local instance, for testabilityGravatar reed2014-09-16
| | | | | | | | | BUG=skia: R=mtklein@google.com, danakj@chromium.org, piotaixr@chromium.org, junov@chromium.org Author: reed@google.com Review URL: https://codereview.chromium.org/576763002
* Remove SkBitmapCache::Find/Add(_,width,height,_)Gravatar piotaixr2014-09-03
| | | | | | | | | | | in favor of the versions having a SkIRect as input parameter BUG=skia:2909 R=reed@google.com, junov@chromium.org Author: piotaixr@chromium.org Review URL: https://codereview.chromium.org/539643002
* The key for SkBitmapCache can now be genID+SkIRectGravatar piotaixr2014-09-03
| | | | | | | | | BUG=skia:2894 R=junov@chromium.org, reed@google.com Author: piotaixr@chromium.org Review URL: https://codereview.chromium.org/518983002
* Added Doc for GetAllocator in SkResourceCache and SkBitmapCacheGravatar piotaixr2014-09-02
| | | | | | | | | BUG=skia:2896 R=junov@chromium.org, reed@google.com Author: piotaixr@chromium.org Review URL: https://codereview.chromium.org/533713003
* harden requirements on SkBitmapCacheGravatar reed2014-08-29
| | | | | | | | | BUG=skia: R=humper@google.com Author: reed@google.com Review URL: https://codereview.chromium.org/521433002
* retool image cache to be generic cache, allowing the client to subclass ↵Gravatar reed2014-08-26
| | | | | | | | | | | | | | | "Rec", so they can provide a custom Key and arbitrary Value. Follow-on CLs - rename ScaledimageCache to something like GeneralCache - explore if we can use call-backs or some mechanism to completely hide "lock/unlock", by forcing all clients to support "copying" their value out of the cache as the result of a Find. R=mtklein@google.com, senorblanco@google.com, bsalomon@google.com, qiankun.miao@intel.com, senorblanco@chromium.org Author: reed@google.com Review URL: https://codereview.chromium.org/507483002
* expose generalized imagecache keyGravatar reed2014-08-21
BUG=skia: R=mtklein@google.com, halcanary@google.com, qiankun.miao@intel.com Author: reed@google.com Review URL: https://codereview.chromium.org/483493003