aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/image/SkImage_Lazy.cpp
Commit message (Collapse)AuthorAge
* share helper for flagging when added to raster cacheGravatar Mike Reed2018-07-19
| | | | | | | | | | | Rename to clarify that it is a "raster" cache we're talking about. clean up -- motivated by looking to make the purge of a staleID synchronous Bug: skia: Change-Id: I87493690dd5a4f2ebd002e2635ebd0e44fe27320 Reviewed-on: https://skia-review.googlesource.com/142325 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Mike Reed <reed@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>
* Remove old lazy image decoding heuristic logicGravatar Brian Osman2018-07-11
| | | | | | | | | | | This led to removing a lot of transfer function behavior code. There is more that could be done, and we need to add in decoding to dst color space, but this CL is almost entirely mechanical. Change-Id: I91b2169f95aadcfaacdd2b9821bb1a01ce53f9a6 Reviewed-on: https://skia-review.googlesource.com/140349 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Revert "Revert "Temporary fix for SkImage_Lazy handling of color spaces""Gravatar Brian Osman2018-06-28
| | | | | | | | | | | | This reverts commit e269310a09646c7df63039392782a078cc5256c6. Now guarded to avoid breaking Chrome. Bug: skia: Change-Id: I5d98b227c0388a730ad9b5e2e77adbb27dd445b8 Reviewed-on: https://skia-review.googlesource.com/137894 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Brian Osman <brianosman@google.com>
* Handle F32 in lazy imageGravatar Brian Osman2018-06-26
| | | | | | | | | Bug: skia: Change-Id: Idec8259b48733830790a3957b41d204835d7be02 Reviewed-on: https://skia-review.googlesource.com/137705 Auto-Submit: Brian Osman <brianosman@google.com> Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Revert "Temporary fix for SkImage_Lazy handling of color spaces"Gravatar Brian Osman2018-06-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 439b99451445a9d61f0670bbe3f588f5b08f59fa. Reason for revert: Chrome tests failing. Original change's description: > Temporary fix for SkImage_Lazy handling of color spaces > > The aim is to always decode in the generator's color space, > with nonlinear blending. Eventually, we want to decode into > the destination color space, but that requires changing API > and caching flow. For now, this prevents linear premul when > decoding, and stops decoding to formats like F16 and sBGRA. > > Bug: skia: > Change-Id: I9efd909fa6a56df2547ad5955f109e113527f815 > Reviewed-on: https://skia-review.googlesource.com/136791 > Commit-Queue: Mike Klein <mtklein@google.com> > Reviewed-by: Mike Klein <mtklein@google.com> TBR=mtklein@google.com,brianosman@google.com Change-Id: Ie15c585b69e4309c090c8aafbe3c2d20191caa4d No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/137720 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Temporary fix for SkImage_Lazy handling of color spacesGravatar Brian Osman2018-06-26
| | | | | | | | | | | | | | The aim is to always decode in the generator's color space, with nonlinear blending. Eventually, we want to decode into the destination color space, but that requires changing API and caching flow. For now, this prevents linear premul when decoding, and stops decoding to formats like F16 and sBGRA. Bug: skia: Change-Id: I9efd909fa6a56df2547ad5955f109e113527f815 Reviewed-on: https://skia-review.googlesource.com/136791 Commit-Queue: Mike Klein <mtklein@google.com> Reviewed-by: Mike Klein <mtklein@google.com>
* Remove const from (immutable) SkColorSpace args to some functionsGravatar Brian Osman2018-06-14
| | | | | | | | | | | | Another piece of https://skia-review.googlesource.com/c/skia/+/132090 that I'd like to land separately. Change-Id: I64d8968cf7e0fb0d288eca71c79d361410c924b8 Reviewed-on: https://skia-review.googlesource.com/134782 Commit-Queue: Brian Osman <brianosman@google.com> Commit-Queue: Mike Klein <mtklein@google.com> Auto-Submit: Brian Osman <brianosman@google.com> Reviewed-by: Mike Klein <mtklein@google.com>
* Fall back to bilerp if we are undable to do a copy for mips.Gravatar Greg Daniel2018-06-08
| | | | | | | | Bug: skia: Change-Id: I52b86d83aaec1fa245be2ee17bbd56defcb5881f Reviewed-on: https://skia-review.googlesource.com/133587 Commit-Queue: Greg Daniel <egdaniel@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* Reland "Reland "Require mips to be allocated at texture creation time and ↵Gravatar Greg Daniel2018-06-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | disable late allocations."" This reverts commit 01422bc8eff0c317b9c234b3b4f5a82f1011dfce. Reason for revert: follow on change may be ready Original change's description: > Revert "Reland "Require mips to be allocated at texture creation time and disable late allocations."" > > This reverts commit 9eb36b9eb8e81e970e02fa985ae82fe64de0a8f0. > > Reason for revert: Alpha8 isn't renderable on es2 so we end up dropping draws on certain A8 mip requests > > Original change's description: > > Reland "Require mips to be allocated at texture creation time and disable late allocations." > > > > This reverts commit 0c78238e2991c95b6fb3c945d4ad2b5d941ae21b. > > > > Reason for revert: <INSERT REASONING HERE> > > > > Original change's description: > > > Revert "Require mips to be allocated at texture creation time and disable late allocations." > > > > > > This reverts commit cd2c3f9055452d413d6be7ea6dc63fd1922fe994. > > > > > > Reason for revert: Looks to be causing angle failures on initial clear test > > > > > > Original change's description: > > > > Require mips to be allocated at texture creation time and disable late allocations. > > > > > > > > If we get a non-mipped texture for a draw that wants to be use mip map filter, we > > > > will copy the texture into a new mipped texture. > > > > > > > > Clean up of unused code in the GPU backends for reallocating for mips will be done > > > > in a follow up CL. > > > > > > > > Bug: skia: > > > > Change-Id: Idab588c1abf4bbbf7eeceb3727d500e5df274188 > > > > Reviewed-on: https://skia-review.googlesource.com/132830 > > > > Reviewed-by: Brian Salomon <bsalomon@google.com> > > > > Commit-Queue: Greg Daniel <egdaniel@google.com> > > > > > > > > > > > > Change-Id: I49f0ace52f2586d61b451630b2e6aae84b420b81 > > > No-Presubmit: true > > > No-Tree-Checks: true > > > No-Try: true > > > Bug: skia: > > > Reviewed-on: https://skia-review.googlesource.com/133041 > > > Reviewed-by: Greg Daniel <egdaniel@google.com> > > > Commit-Queue: Greg Daniel <egdaniel@google.com> > > > > Bug: skia: > > Change-Id: I004447a5f1ec72c3be2318ddea803f57efb12ea4 > > Reviewed-on: https://skia-review.googlesource.com/133340 > > Reviewed-by: Brian Salomon <bsalomon@google.com> > > Commit-Queue: Greg Daniel <egdaniel@google.com> > > TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com > > Change-Id: I9e9718d380c4d9927ec39e46008750ab7396391f > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia: > Reviewed-on: https://skia-review.googlesource.com/133680 > Reviewed-by: Greg Daniel <egdaniel@google.com> > Commit-Queue: Greg Daniel <egdaniel@google.com> TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com Change-Id: Ic3df69f65a89962b21cdb50ee436a29fd121ab1f No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/133740 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
* Revert "Reland "Require mips to be allocated at texture creation time and ↵Gravatar Greg Daniel2018-06-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | disable late allocations."" This reverts commit 9eb36b9eb8e81e970e02fa985ae82fe64de0a8f0. Reason for revert: Alpha8 isn't renderable on es2 so we end up dropping draws on certain A8 mip requests Original change's description: > Reland "Require mips to be allocated at texture creation time and disable late allocations." > > This reverts commit 0c78238e2991c95b6fb3c945d4ad2b5d941ae21b. > > Reason for revert: <INSERT REASONING HERE> > > Original change's description: > > Revert "Require mips to be allocated at texture creation time and disable late allocations." > > > > This reverts commit cd2c3f9055452d413d6be7ea6dc63fd1922fe994. > > > > Reason for revert: Looks to be causing angle failures on initial clear test > > > > Original change's description: > > > Require mips to be allocated at texture creation time and disable late allocations. > > > > > > If we get a non-mipped texture for a draw that wants to be use mip map filter, we > > > will copy the texture into a new mipped texture. > > > > > > Clean up of unused code in the GPU backends for reallocating for mips will be done > > > in a follow up CL. > > > > > > Bug: skia: > > > Change-Id: Idab588c1abf4bbbf7eeceb3727d500e5df274188 > > > Reviewed-on: https://skia-review.googlesource.com/132830 > > > Reviewed-by: Brian Salomon <bsalomon@google.com> > > > Commit-Queue: Greg Daniel <egdaniel@google.com> > > > > > > > > Change-Id: I49f0ace52f2586d61b451630b2e6aae84b420b81 > > No-Presubmit: true > > No-Tree-Checks: true > > No-Try: true > > Bug: skia: > > Reviewed-on: https://skia-review.googlesource.com/133041 > > Reviewed-by: Greg Daniel <egdaniel@google.com> > > Commit-Queue: Greg Daniel <egdaniel@google.com> > > Bug: skia: > Change-Id: I004447a5f1ec72c3be2318ddea803f57efb12ea4 > Reviewed-on: https://skia-review.googlesource.com/133340 > Reviewed-by: Brian Salomon <bsalomon@google.com> > Commit-Queue: Greg Daniel <egdaniel@google.com> TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com Change-Id: I9e9718d380c4d9927ec39e46008750ab7396391f No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/133680 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
* Fix A2B JPEG images on GPU backed xform or color-managed canvasGravatar Brian Osman2018-06-08
| | | | | | | | | | | | | | | | | | | | | | | | A2B images can't be transformed on the GPU, so ensure that they're "converted" before being uploaded. (This may just create a new lazy image with an updated color space). Then, when we're converting JPEG images (YUV) to textures, don't allow GPU decode if the result needs to go through A2B conversion (again, we can't do this). In that case, we just ask the generator (codec) for RGB data, which will trigger correct CPU conversion before the upload. Eventually this will be rewritten further, because we won't allow A2B data in SkColorSpace, but for now this fixes a problem that's not actually affecting any clients, but is blocking a GrColorSpaceXform refactor. Change-Id: I1ebef4a90773d21ec4011ed1ac16aed486ba5539 Reviewed-on: https://skia-review.googlesource.com/133447 Commit-Queue: Brian Osman <brianosman@google.com> Commit-Queue: Mike Klein <mtklein@google.com> Auto-Submit: Brian Osman <brianosman@google.com> Reviewed-by: Mike Klein <mtklein@google.com>
* Reland "Require mips to be allocated at texture creation time and disable ↵Gravatar Greg Daniel2018-06-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | late allocations." This reverts commit 0c78238e2991c95b6fb3c945d4ad2b5d941ae21b. Reason for revert: <INSERT REASONING HERE> Original change's description: > Revert "Require mips to be allocated at texture creation time and disable late allocations." > > This reverts commit cd2c3f9055452d413d6be7ea6dc63fd1922fe994. > > Reason for revert: Looks to be causing angle failures on initial clear test > > Original change's description: > > Require mips to be allocated at texture creation time and disable late allocations. > > > > If we get a non-mipped texture for a draw that wants to be use mip map filter, we > > will copy the texture into a new mipped texture. > > > > Clean up of unused code in the GPU backends for reallocating for mips will be done > > in a follow up CL. > > > > Bug: skia: > > Change-Id: Idab588c1abf4bbbf7eeceb3727d500e5df274188 > > Reviewed-on: https://skia-review.googlesource.com/132830 > > Reviewed-by: Brian Salomon <bsalomon@google.com> > > Commit-Queue: Greg Daniel <egdaniel@google.com> > > > > Change-Id: I49f0ace52f2586d61b451630b2e6aae84b420b81 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia: > Reviewed-on: https://skia-review.googlesource.com/133041 > Reviewed-by: Greg Daniel <egdaniel@google.com> > Commit-Queue: Greg Daniel <egdaniel@google.com> Bug: skia: Change-Id: I004447a5f1ec72c3be2318ddea803f57efb12ea4 Reviewed-on: https://skia-review.googlesource.com/133340 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
* Revert "Require mips to be allocated at texture creation time and disable ↵Gravatar Greg Daniel2018-06-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | late allocations." This reverts commit cd2c3f9055452d413d6be7ea6dc63fd1922fe994. Reason for revert: Looks to be causing angle failures on initial clear test Original change's description: > Require mips to be allocated at texture creation time and disable late allocations. > > If we get a non-mipped texture for a draw that wants to be use mip map filter, we > will copy the texture into a new mipped texture. > > Clean up of unused code in the GPU backends for reallocating for mips will be done > in a follow up CL. > > Bug: skia: > Change-Id: Idab588c1abf4bbbf7eeceb3727d500e5df274188 > Reviewed-on: https://skia-review.googlesource.com/132830 > Reviewed-by: Brian Salomon <bsalomon@google.com> > Commit-Queue: Greg Daniel <egdaniel@google.com> TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com Change-Id: I49f0ace52f2586d61b451630b2e6aae84b420b81 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/133041 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
* Require mips to be allocated at texture creation time and disable late ↵Gravatar Greg Daniel2018-06-07
| | | | | | | | | | | | | | | | allocations. If we get a non-mipped texture for a draw that wants to be use mip map filter, we will copy the texture into a new mipped texture. Clean up of unused code in the GPU backends for reallocating for mips will be done in a follow up CL. Bug: skia: Change-Id: Idab588c1abf4bbbf7eeceb3727d500e5df274188 Reviewed-on: https://skia-review.googlesource.com/132830 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Greg Daniel <egdaniel@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>
* support image-subsets in serializationGravatar Mike Reed2018-05-29
| | | | | | | | | | | A follow-on API change *could* be to extend the SerialProcs to pass subset information up to the client, in case they want to handle the subsetting step themselves. Bug: skia:7983 Change-Id: I36d3f1ce439886384495485c3be3c591d611a135 Reviewed-on: https://skia-review.googlesource.com/130543 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Remove SK_IGNORE_SKIMAGE_ONREFENCODED_CHANGE.Gravatar Ben Wagner2018-05-17
| | | | | | | | | All implementers have been updated, so remove the flag and old code. Change-Id: Ie9747f37dd0ea3f1db682891bcae2496a470bc3a Reviewed-on: https://skia-review.googlesource.com/128883 Reviewed-by: Leon Scroggins <scroggo@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
* SkImage::onRefEncoded to return sk_sp.Gravatar Ben Wagner2018-05-16
| | | | | | | | | | | | This changes SkImage::onRefEncoded and downstack calls to return sk_sp. All of the values returned are already sk_sp, so this just updates the API. This change is currently behind the new flag SK_IGNORE_SKIMAGE_ONREFENCODED_CHANGE so that Chromium can be updated. Change-Id: Ic53a88ae23fa8b3b41b84c4abdc4b74e9879da38 Reviewed-on: https://skia-review.googlesource.com/128311 Reviewed-by: Leon Scroggins <scroggo@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
* Make GrCaps and GrShaderCaps private.Gravatar Brian Salomon2018-05-11
| | | | | | | | | Moves getCaps() from GrContext to GrContextPriv and removes unused refCaps(). Change-Id: Ic6a8951b656c0d1b2773eae73bff8e88af819866 Reviewed-on: https://skia-review.googlesource.com/127389 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* Tag the unique keys of lazy images.Gravatar Derek Sollenberger2018-04-04
| | | | | | | Change-Id: I54175db2aae43d28fd7aff224d57bf6ed9093b1e Reviewed-on: https://skia-review.googlesource.com/118588 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Derek Sollenberger <djsollen@google.com>
* Add SkColorType getter on SkImage.Gravatar Greg Daniel2018-03-14
| | | | | | | | | | Bug: skia: Change-Id: I131fb5f7faf3f54e0eb6d31b800d224e6d4963ce Reviewed-on: https://skia-review.googlesource.com/114464 Reviewed-by: Cary Clark <caryclark@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com> Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
* When creating emptyp MipMap proxies, don't instantiate them immediately. ↵Gravatar Greg Daniel2018-02-15
| | | | | | | | | | | | Attempt 3 original: https://skia-review.googlesource.com/106966 Bug: skia: Change-Id: I779985cef2d3c4f36a0129d8ecedd12e510bec7e Reviewed-on: https://skia-review.googlesource.com/107781 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
* Revert "Revert "Revert "When creating emptyp MipMap proxies, don't ↵Gravatar Greg Daniel2018-02-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | instantiate them immediately.""" This reverts commit 95edb43251e8fcef4286c91d334c3259940a0095. Reason for revert: breaking Ubuntu Linux GMs Original change's description: > Revert "Revert "When creating emptyp MipMap proxies, don't instantiate them immediately."" > > This reverts commit 0ee866dac78b60497b4c107995d3c2747309ef8b. > > Reason for revert: <INSERT REASONING HERE> > > Original change's description: > > Revert "When creating emptyp MipMap proxies, don't instantiate them immediately." > > > > This reverts commit 8242c5c199f5d04e4209222b265f9e27f7c55fa7. > > > > Reason for revert: Hitting assert on intel bots on skbug6850overlay2.skp, SkASSERT(proxy->getUniqueKey().isValid()); in processInvalidProxyUniqueKey > > > > Original change's description: > > > When creating emptyp MipMap proxies, don't instantiate them immediately. > > > > > > This chnages makes it match how we handle non mipped proxies where we > > > don't actually instantiate them until we need to. > > > > > > Bug: skia: > > > Change-Id: Id0c50eefce43ef1458a3ff0bb1881a817b045279 > > > Reviewed-on: https://skia-review.googlesource.com/106966 > > > Commit-Queue: Greg Daniel <egdaniel@google.com> > > > Reviewed-by: Robert Phillips <robertphillips@google.com> > > > > TBR=egdaniel@google.com,robertphillips@google.com > > > > Change-Id: I1fa6165b69c5bbb1d6bb10abba33dcdb55a27ba3 > > No-Presubmit: true > > No-Tree-Checks: true > > No-Try: true > > Bug: skia: > > Reviewed-on: https://skia-review.googlesource.com/107263 > > Reviewed-by: Greg Daniel <egdaniel@google.com> > > Commit-Queue: Greg Daniel <egdaniel@google.com> > > TBR=egdaniel@google.com,robertphillips@google.com > > Bug: skia: > Change-Id: Ice34283f9ac183faed6e061d8162cf2226b18289 > Reviewed-on: https://skia-review.googlesource.com/107320 > Reviewed-by: Robert Phillips <robertphillips@google.com> > Commit-Queue: Greg Daniel <egdaniel@google.com> TBR=egdaniel@google.com,robertphillips@google.com Change-Id: I53f166d508cc8ccd71e7473934a12a52f2eba7bb No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/107321 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
* Revert "Revert "When creating emptyp MipMap proxies, don't instantiate them ↵Gravatar Greg Daniel2018-02-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | immediately."" This reverts commit 0ee866dac78b60497b4c107995d3c2747309ef8b. Reason for revert: <INSERT REASONING HERE> Original change's description: > Revert "When creating emptyp MipMap proxies, don't instantiate them immediately." > > This reverts commit 8242c5c199f5d04e4209222b265f9e27f7c55fa7. > > Reason for revert: Hitting assert on intel bots on skbug6850overlay2.skp, SkASSERT(proxy->getUniqueKey().isValid()); in processInvalidProxyUniqueKey > > Original change's description: > > When creating emptyp MipMap proxies, don't instantiate them immediately. > > > > This chnages makes it match how we handle non mipped proxies where we > > don't actually instantiate them until we need to. > > > > Bug: skia: > > Change-Id: Id0c50eefce43ef1458a3ff0bb1881a817b045279 > > Reviewed-on: https://skia-review.googlesource.com/106966 > > Commit-Queue: Greg Daniel <egdaniel@google.com> > > Reviewed-by: Robert Phillips <robertphillips@google.com> > > TBR=egdaniel@google.com,robertphillips@google.com > > Change-Id: I1fa6165b69c5bbb1d6bb10abba33dcdb55a27ba3 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia: > Reviewed-on: https://skia-review.googlesource.com/107263 > Reviewed-by: Greg Daniel <egdaniel@google.com> > Commit-Queue: Greg Daniel <egdaniel@google.com> TBR=egdaniel@google.com,robertphillips@google.com Bug: skia: Change-Id: Ice34283f9ac183faed6e061d8162cf2226b18289 Reviewed-on: https://skia-review.googlesource.com/107320 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
* Add function to GrProxyProvider to lazily upload mip map dataGravatar Greg Daniel2018-02-07
| | | | | | | | Bug: skia: Change-Id: I906207727242bed8a109bf3ca10b5a6e8e4b952e Reviewed-on: https://skia-review.googlesource.com/104581 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
* Revert "Revert "Revert "Revert "Revert "Revert "Redefine the meaning of ↵Gravatar Brian Salomon2018-02-03
| | | | | | | | | | | | | sample counts in GPU backend."""""" This reverts commit 3a2cc2c2ec124de36d2544b2a523ef1dd317ca32. Fix code with samplecnt=0 that slipped in between trybots/CQ and landing of previous version Change-Id: Iab19f2e8d1e9901601c8c76244d7a88c5d707fab Reviewed-on: https://skia-review.googlesource.com/103181 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Revert "Revert "Revert "Revert "Revert "Redefine the meaning of sample ↵Gravatar Brian Salomon2018-02-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | counts in GPU backend.""""" This reverts commit 5bb82cbecd740d21b92e8d2944280ab6eb6af7a6. Reason for revert: <INSERT REASONING HERE> Original change's description: > Revert "Revert "Revert "Revert "Redefine the meaning of sample counts in GPU backend."""" > > This reverts commit 18c52a7b52211de5d0dcd86dc048adef758c6c75. > > Also relands "More sample count cleanup:" and "Add new GrContext queries for imagability, surfacability, and max sample count of color types" > > > Bug: skia: > Change-Id: I4028105a3a1f16ce3944e134619eb6245af6b947 > Reviewed-on: https://skia-review.googlesource.com/102940 > Reviewed-by: Brian Salomon <bsalomon@google.com> > Commit-Queue: Brian Salomon <bsalomon@google.com> TBR=egdaniel@google.com,bsalomon@google.com Change-Id: Idee23be2f1719f0bdc9305043e95a2d589bee8d1 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/103220 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Revert "Revert "Revert "Revert "Redefine the meaning of sample counts in GPU ↵Gravatar Brian Salomon2018-02-02
| | | | | | | | | | | | | | | backend."""" This reverts commit 18c52a7b52211de5d0dcd86dc048adef758c6c75. Also relands "More sample count cleanup:" and "Add new GrContext queries for imagability, surfacability, and max sample count of color types" Bug: skia: Change-Id: I4028105a3a1f16ce3944e134619eb6245af6b947 Reviewed-on: https://skia-review.googlesource.com/102940 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Revert "Revert "Revert "Redefine the meaning of sample counts in GPU backend."""Gravatar Brian Salomon2018-02-02
| | | | | | | | | | | | | | | | | | | | This reverts commit d0d7270fcc32546005b8e847df516cb11592cd30. Revert "More sample count cleanup:" This reverts commit d653cac70ed17983125ceed053138c09f1401846. Revert "Add new GrContext queries for imagability, surfacability, and max sample count of color types" This reverts commit 85ae7159c9c8a9186a4c7e74304eabb35bca9a79. Need to understand NVPR perf changes before relanding Change-Id: I0db075fb42438ef2a1f9885df184dce52892ac4b Reviewed-on: https://skia-review.googlesource.com/102780 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* More sample count cleanup:Gravatar Brian Salomon2018-02-01
| | | | | | | | | | | | | | | | | | | rename getSampleCount -> getRenderTargetSampleCount because it will return 0 when a config is not renderable but *is* supported as a texture format. (Old name kept around until Chrome stops calling it) Add virtual GrCaps::maxRenderTargetSampleCount(GrPixelConfig). Devirtualize isConfigRenderable() and implement as maxRTSC != 0. Separate implementation for version with bool withMSAA param to be removed after Flutter is updated to no longer call. Consolidate various file static GrSurfaceDesc validators fns into GrCaps::validateSurfaceDesc(). Bug: skia: Change-Id: Ie30a291aa027e910df3bd90fac8518ccdb39e53f Reviewed-on: https://skia-review.googlesource.com/102141 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* Add kRGBX_8888, kRGBA_1010102, and kRGBX_1010102 color types. Unused for now.Gravatar Brian Salomon2018-01-30
| | | | | | | | | BUG= skia:7533 Change-Id: I4b3f6b827fd833ba2d07895884d2abc9a3132366 Reviewed-on: https://skia-review.googlesource.com/99781 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Brian Salomon <bsalomon@google.com>
* remove SkColorSpace_BaseGravatar Mike Klein2018-01-26
| | | | | | | | | | | | The type SkColorSpace_Base doesn't need to exist. Its one type() query can be answered instead by toXYZD50(). Now all that's left in the file is SkGammas, so rename it to SkGammas.h. Change-Id: Id60ddbfb342accfd5674ae89b37a24a6583ef7b8 Reviewed-on: https://skia-review.googlesource.com/99702 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Funnel most proxy creation through GrProxyProviderGravatar Robert Phillips2018-01-16
| | | | | | | | | This is to provide a choke point for DDL to create Lazy Proxies. Change-Id: If178da13bc6447b31b7601810236d34502d9efbd Reviewed-on: https://skia-review.googlesource.com/93303 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* Add GrProxyProviderGravatar Robert Phillips2018-01-08
| | | | | | | | | This pulls all the proxy tracking & creation functionality out of the GrResourceCache and GrResourceProvider and consolidates it in the GrProxyProvider. Change-Id: I7256f7c544319a70c1bd93dd5a9ccbe5fa0a544f Reviewed-on: https://skia-review.googlesource.com/91501 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* Removed unused useCache param in GrYUVProviderGravatar Greg Daniel2018-01-04
| | | | | | | | | | | The function was only ever called in one spot and always passed in true for this value. Bug: skia: Change-Id: Ie22c01d13da5e34664cb67b7b1c900da6d92bb45 Reviewed-on: https://skia-review.googlesource.com/90402 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
* Push much of the SkColorSpace_Base interface up to SkColorSpaceGravatar Brian Osman2017-12-12
| | | | | | | | | | | Some pieces still remain, but the next step looks less mechanical, so I wanted to land this piece independently. Bug: skia: Change-Id: Ie63afcfa08af2f6e4996911fa2225c43441dbfb2 Reviewed-on: https://skia-review.googlesource.com/84120 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Brian Osman <brianosman@google.com>
* Add hint to SkSurface::MakeRenderTarget that we will use mipsGravatar Greg Daniel2017-10-23
| | | | | | | | | | | Additionally this changed triggered a cascade of plumbing GrMipMapped down throughout Ganesh. Bug: skia: Change-Id: I4181f44d9046d66139bb491c7abf86703305aaeb Reviewed-on: https://skia-review.googlesource.com/63000 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
* Add api for passing mipped hint into ImageGenerator onGenerateTextureGravatar Greg Daniel2017-10-11
| | | | | | | | | | | | This does not actually add any additional functionality to the generators. Once this lands I will enable the generators one at a time to more easily monitor the effects of each one. Bug: skia: Change-Id: I382a1acfaebcbf9ad44c9873b87cdbbe02a13602 Reviewed-on: https://skia-review.googlesource.com/57083 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
* Add option to create a deferred render target context with mipsGravatar Greg Daniel2017-10-06
| | | | | | | | | | | | | | We need this since we have texture generators that draw the base level but nothing more. Thus we want them to be able to directly draw into a pre allocated mipped target instead of doing a copy later. TBR: bsalomon@google.com Bug: skia: Change-Id: I1dfae0da7153b21b30fdfa51a7061fc255739a1e Reviewed-on: https://skia-review.googlesource.com/54100 Reviewed-by: Brian Salomon <bsalomon@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
* When mip mapping, do YUV mip generation on CPU then upload to GPU.Gravatar Greg Daniel2017-10-05
| | | | | | | | Bug: skia: Change-Id: I930508b38e828652dfbb7c3f9d934d206cf1d72a Reviewed-on: https://skia-review.googlesource.com/56060 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
* Revert "Revert "Update lockTextureProxy to return mipped proxys if mipping ↵Gravatar Greg Daniel2017-10-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | is requested."" This reverts commit 87c76edd2c2247a6d0194a0e511a7bdc259aedf4. Reason for revert: attempt to reland Original change's description: > Revert "Update lockTextureProxy to return mipped proxys if mipping is requested." > > This reverts commit 97abf014b40cc17c4100768299ef8cccd335aff7. > > Reason for revert: REALLY Really really really big perf regressions > > Original change's description: > > Update lockTextureProxy to return mipped proxys if mipping is requested. > > > > We will either create a new mipped surface from scratch, or just create > > the base layer and copy that into the mipped surface. We then defer the > > creation of the rest of the mips to the GPU. > > > > Bug: skia: > > Change-Id: Ida3000ad5e666153c61b05e714f033138593b09b > > Reviewed-on: https://skia-review.googlesource.com/52743 > > Commit-Queue: Greg Daniel <egdaniel@google.com> > > Reviewed-by: Robert Phillips <robertphillips@google.com> > > TBR=egdaniel@google.com,robertphillips@google.com,brianosman@google.com > > Change-Id: If3b1ff555ef310b75493412a7533175195994684 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia: > Reviewed-on: https://skia-review.googlesource.com/54320 > Reviewed-by: Greg Daniel <egdaniel@google.com> > Commit-Queue: Greg Daniel <egdaniel@google.com> TBR=egdaniel@google.com,robertphillips@google.com,brianosman@google.com # Not skipping CQ checks because original CL landed > 1 day ago. Bug: skia: Change-Id: I176ff7279f29eff536ab13aff8fda882b6ef7a2f Reviewed-on: https://skia-review.googlesource.com/55081 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
* Revert "Update lockTextureProxy to return mipped proxys if mipping is ↵Gravatar Greg Daniel2017-10-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | requested." This reverts commit 97abf014b40cc17c4100768299ef8cccd335aff7. Reason for revert: REALLY Really really really big perf regressions Original change's description: > Update lockTextureProxy to return mipped proxys if mipping is requested. > > We will either create a new mipped surface from scratch, or just create > the base layer and copy that into the mipped surface. We then defer the > creation of the rest of the mips to the GPU. > > Bug: skia: > Change-Id: Ida3000ad5e666153c61b05e714f033138593b09b > Reviewed-on: https://skia-review.googlesource.com/52743 > Commit-Queue: Greg Daniel <egdaniel@google.com> > Reviewed-by: Robert Phillips <robertphillips@google.com> TBR=egdaniel@google.com,robertphillips@google.com,brianosman@google.com Change-Id: If3b1ff555ef310b75493412a7533175195994684 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/54320 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
* Update lockTextureProxy to return mipped proxys if mipping is requested.Gravatar Greg Daniel2017-10-02
| | | | | | | | | | | | We will either create a new mipped surface from scratch, or just create the base layer and copy that into the mipped surface. We then defer the creation of the rest of the mips to the GPU. Bug: skia: Change-Id: Ida3000ad5e666153c61b05e714f033138593b09b Reviewed-on: https://skia-review.googlesource.com/52743 Commit-Queue: Greg Daniel <egdaniel@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
* Add ability to remove unique key from proxy and underlying surface.Gravatar Greg Daniel2017-09-26
| | | | | | | | Bug: skia: Change-Id: I66b891ce9ca35906fdbddb36f565b35b25825112 Reviewed-on: https://skia-review.googlesource.com/51240 Commit-Queue: Greg Daniel <egdaniel@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
* Rework GrSamplerParams to be more compact and use its own wrap mode enum.Gravatar Brian Salomon2017-09-07
| | | | | | | | | The main change is to make GrSamplerParams smaller by making its enums have byte-sized underlying types. The rest is cosmetic. Change-Id: Ib71ea50612d24619a85e463826c6b8dfb9b445e3 Reviewed-on: https://skia-review.googlesource.com/43200 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* Make SkImage_Lazy always report the color space of its dataGravatar Brian Osman2017-09-07
| | | | | | | | | | | | Legacy clients are likely to ignore this information, but there are cases (using SkColorSpaceXformCanvas) where getting accurate information is important. Bug: skia: Change-Id: Ia56170559c82299375021c813424098ffc627b02 Reviewed-on: https://skia-review.googlesource.com/43562 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Reduce dependence on GrSurface's origin field (take 3)Gravatar Robert Phillips2017-07-25
| | | | | | | | | TBR=bsalomon@google.com Change-Id: I8c95c6774897dbd87e3c5c87d92f75c5b64d4e76 Reviewed-on: https://skia-review.googlesource.com/26424 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
* Revert "Reduce dependence on GrSurface's origin field (take 2)"Gravatar Robert Phillips2017-07-25
| | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 22115b4fc6ab169d45a1cfb65dae2dc7e544c80a. Reason for revert: GrAHardwareBufferImageGenerator.cpp Original change's description: > Reduce dependence on GrSurface's origin field (take 2) > > TBR=bsalomon@google.com > Change-Id: Ia238fc66b0fe10a3626c7967b2ac1f1a4bf4cd71 > Reviewed-on: https://skia-review.googlesource.com/25800 > Reviewed-by: Robert Phillips <robertphillips@google.com> > Commit-Queue: Robert Phillips <robertphillips@google.com> TBR=bsalomon@google.com,robertphillips@google.com Change-Id: I6dc77f02eed3073317128c48f0b426b81926787f No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/26480 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Reduce dependence on GrSurface's origin field (take 2)Gravatar Robert Phillips2017-07-25
| | | | | | | | TBR=bsalomon@google.com Change-Id: Ia238fc66b0fe10a3626c7967b2ac1f1a4bf4cd71 Reviewed-on: https://skia-review.googlesource.com/25800 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>