aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/image/SkImage_Base.h
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>
* 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>
* Reland "Remove GrBackendObject and all related functions from Skia."Gravatar Greg Daniel2018-05-21
| | | | | | | | | | | | | | | | | | | This is a reland of ccd4cfc23ebbbecbc6b292359352aad335ad7b73 Original change's description: > Remove GrBackendObject and all related functions from Skia. > > Bug: skia: > Change-Id: I59434b7477c0bc26fd982bd81eb97ab94bbba073 > Reviewed-on: https://skia-review.googlesource.com/125822 > Reviewed-by: Brian Salomon <bsalomon@google.com> > Commit-Queue: Greg Daniel <egdaniel@google.com> Bug: skia: Change-Id: Ibd1b9bd04b36840d9d872e2f0970dd6bac378bc9 Reviewed-on: https://skia-review.googlesource.com/129380 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Greg Daniel <egdaniel@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>
* Revert "Remove GrBackendObject and all related functions from Skia."Gravatar Brian Osman2018-05-10
| | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit ccd4cfc23ebbbecbc6b292359352aad335ad7b73. Reason for revert: Fuchsia not building again. (Flutter roll may have been reverted?) Original change's description: > Remove GrBackendObject and all related functions from Skia. > > Bug: skia: > Change-Id: I59434b7477c0bc26fd982bd81eb97ab94bbba073 > Reviewed-on: https://skia-review.googlesource.com/125822 > 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: Ie2c518b84b0c9513c0c622082de2831088b1ad8d No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/127480 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Remove GrBackendObject and all related functions from Skia.Gravatar Greg Daniel2018-05-10
| | | | | | | | Bug: skia: Change-Id: I59434b7477c0bc26fd982bd81eb97ab94bbba073 Reviewed-on: https://skia-review.googlesource.com/125822 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
* Add SK_SUPPORT_LEGACY_BACKEND_OBJECTSGravatar Robert Phillips2018-04-12
| | | | | | | | | This relies on the Chrome CL: https://chromium-review.googlesource.com/c/chromium/src/+/999796 (Add SK_SUPPORT_LEGACY_BACKEND_OBJECTS to SkUserConfig.h) landing first. Change-Id: Ie0a2b7b84cc02e46957765a0a7d6444a5320769d Reviewed-on: https://skia-review.googlesource.com/119140 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* Add GrBackendTexture/RenderTarget accessors to SkSurfaceGravatar Robert Phillips2018-04-05
| | | | | | | | | Change-Id: I63477fd4b8d48dc50af72736f0f8df566cd96d4a Reviewed-on: https://skia-review.googlesource.com/85220 Reviewed-by: Brian Salomon <bsalomon@google.com> Reviewed-by: Cary Clark <caryclark@skia.org> Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Add GrBackendTexture accessor to SkImage (take 2)Gravatar Robert Phillips2018-04-04
| | | | | | | | | | | This makes accessing the GPU resource behind an SkImage a lot more typesafe. Additionally, the GrBackendObject is being deprecated so this is the path forward. I split the controversial stuff off into https://skia-review.googlesource.com/c/skia/+/118575 (Add SkImage::setLayout call). Change-Id: I297e72770e8fb360fac7c7cd74f050ae759ae133 Reviewed-on: https://skia-review.googlesource.com/118571 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Brian Salomon <bsalomon@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>
* remove kRW_LegacyBitmapModeGravatar Cary Clark2018-02-08
| | | | | | | | | | | | | | experiment to see if there are any unknown dependencies on kRW_LegacyBitmapMode R=reed@google.com,fmalita@chromium.org,bungeman@google.com Bug: skia:5615 Change-Id: I2cc578570ac18cd31c3520e1bd801f4a7a669347 Reviewed-on: https://skia-review.googlesource.com/105283 Reviewed-by: Florin Malita <fmalita@chromium.org> Reviewed-by: Mike Reed <reed@google.com> Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Cary Clark <caryclark@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>
* Remove SkImage_Base::peekTexture callGravatar Robert Phillips2017-06-26
| | | | | | | Change-Id: Ie5b6bec8df083e0a128aa234d80f5a214cd98f0d Reviewed-on: https://skia-review.googlesource.com/20741 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Retract GrTexture*.h & GrRenderTarget*.h from other headersGravatar Robert Phillips2017-06-13
| | | | | | | | | This does push some additional work (& includes) into the .cpp files. Change-Id: I27c847e371802270d13594dcc22aae44039990bb Reviewed-on: https://skia-review.googlesource.com/19660 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* Hide ctors of SkShader, SkImage & SkColorSpaceGravatar Florin Malita2017-05-26
| | | | | | | | | To prevent external clients from subclassing. Change-Id: I60a3833bf64019aea2f537850ca2a1ae38bb8767 Reviewed-on: https://skia-review.googlesource.com/18038 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* remove (possibly slow) call to refEncoded in getDeferredTextureImageDataGravatar Mike Reed2017-05-09
| | | | | | | | | | | | | | | - explicitly reject already-texture-backed and picture-backed Needed to add a virtual to image_base and generator to distinguish generators that can (or cannot) natively "generate" on the gpu (e.g. pictures) Bug: 646089 Change-Id: I3aea22f89b31009ecbb3bd50d88512e6532f0a0f Change-Id: I3aea22f89b31009ecbb3bd50d88512e6532f0a0f Reviewed-on: https://skia-review.googlesource.com/15765 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Leon Scroggins <scroggo@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* SkImage::isValidGravatar Brian Osman2017-05-08
| | | | | | | | | | | | Lets clients know if an image is drawable to a particular GrContext (or to CPU). Checks for abandoned GrContexts beneath GPU backed images, as well as context mis-match. Bug: skia: Change-Id: Ibe88c7ce8091f965c14f6023a3597be4b70c3f99 Reviewed-on: https://skia-review.googlesource.com/15801 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* Reland "Add SkImage::makeColorSpace() with correct transfer fn behavior"Gravatar Matt Sarett2017-05-04
| | | | | | | | | | | Completes implementation for lazy and raster images. gpu is still a TODO. Bug: skia:6553 Change-Id: I898e4464ffc91442c7f98669f1203dd5c203621b Reviewed-on: https://skia-review.googlesource.com/15307 Reviewed-by: Matt Sarett <msarett@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
* Revert "Add SkImage::makeColorSpace() with correct transfer fn behavior"Gravatar Matt Sarett2017-05-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 9ad0531a18f854e5a2c8034880140dd6cd3ea3c1. Reason for revert: Does not handle transfer fn behavior. Original change's description: > Add SkImage::makeColorSpace() with correct transfer fn behavior > > Completes implementation for lazy and raster images. gpu is > still a TODO. > > Bug: skia:6553 > Change-Id: I04eea5c4fb53c50c0406c2e6b6778b0e21fd85f8 > Reviewed-on: https://skia-review.googlesource.com/14403 > Commit-Queue: Matt Sarett <msarett@google.com> > Reviewed-by: Mike Reed <reed@google.com> > TBR=mtklein@google.com,msarett@google.com,brianosman@google.com,reed@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: I3830321aea7d0dc5ab38a40f3318bb53a41df383 Reviewed-on: https://skia-review.googlesource.com/15306 Reviewed-by: Matt Sarett <msarett@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
* Add SkImage::makeColorSpace() with correct transfer fn behaviorGravatar Matt Sarett2017-05-03
| | | | | | | | | | | Completes implementation for lazy and raster images. gpu is still a TODO. Bug: skia:6553 Change-Id: I04eea5c4fb53c50c0406c2e6b6778b0e21fd85f8 Reviewed-on: https://skia-review.googlesource.com/14403 Commit-Queue: Matt Sarett <msarett@google.com> Reviewed-by: Mike Reed <reed@google.com>
* remove unused yuv methodsGravatar Mike Reed2017-04-28
| | | | | | | | Bug: skia: Change-Id: Ie1e6c905d8989b49c2cf5c9e5fd1f383268f6480 Reviewed-on: https://skia-review.googlesource.com/14645 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Remove compressed texture support from cacheratorGravatar Brian Osman2017-04-25
| | | | | | | | | | | All variants of (on)?[rR]efEncoded(Data)? no longer need a GrContext parameter. Bug: skia:5485 skia:4971 Change-Id: If4f5e785718d5522eb3df8588318ccb8a02a5749 Reviewed-on: https://skia-review.googlesource.com/14269 Reviewed-by: Leon Scroggins <scroggo@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Add SkImage::makeColorSpace() to public APIGravatar Matt Sarett2017-04-05
| | | | | | | | | | | | | Gives Chrome the flexibility to xform and cache SkImages before they reach the SkColorSpaceXformCanvas. Bug: skia: Change-Id: I1f188f385b953b5a958c15578ea66deffb4dc6c5 Reviewed-on: https://skia-review.googlesource.com/11290 Commit-Queue: Matt Sarett <msarett@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org> Reviewed-by: Mike Reed <reed@google.com>
* Remove GrFragmentProcessor-derived class' GrTexture-based ctorsGravatar Robert Phillips2017-03-27
| | | | | | | | | | | | | | | | | | | | | | Split out into: https://skia-review.googlesource.com/c/8881/ (Switch GrTextureStripAtlas over to GrTextureProxies) https://skia-review.googlesource.com/c/8942/ (Wrap cached GrTextures in GrTextureProxies (e.g., blur profiles, nine-patch blurs, etc.)) https://skia-review.googlesource.com/c/8997/ (Clean up/remove unused GrFragmentProcessor-derived ctors) https://skia-review.googlesource.com/c/9191/ (Switch SkImageGenerator over to generating GrTextureProxies) https://skia-review.googlesource.com/c/9448/ (Switch GrYUVProvider over to GrTextureProxies) https://skia-review.googlesource.com/c/9559/ (Preparatory Proxification) https://skia-review.googlesource.com/c/9626/ (Consolidate Proxy caching code in GrResourceProvider) https://skia-review.googlesource.com/c/9683/ (More pre-emptive proxification) https://skia-review.googlesource.com/c/9917/ (Make experimental Perlin noise shader take texture proxies) https://skia-review.googlesource.com/c/9961/ (rename makeCopyForTextureParams to isACopyNeededForTextureParams) https://skia-review.googlesource.com/c/9945/ (Make SkImageCacherator be deferred) https://skia-review.googlesource.com/c/10180/ (Add new proxy-based DetermineDomainMode w/ test) Change-Id: Ia33389d92360e542a9d2bf395948deb04d017465 Reviewed-on: https://skia-review.googlesource.com/8823 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Remove SkImage_Base::asTextureRef (in favor of asTextureProxyRef)Gravatar Robert Phillips2017-03-22
| | | | | | | | | Minor consolidation/clean-up Change-Id: I9f8ba794cfb95b33dd60ada0e734ddd2f5f21710 Reviewed-on: https://skia-review.googlesource.com/9947 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Make SkImage_Gpu be deferred (take 2)Gravatar Robert Phillips2017-03-22
| | | | | | | | | | | | | | This CL removes the GrTexture-based ctor forcing everyone to create deferred SkImage_Gpus. relanding of: https://skia-review.googlesource.com/c/6680/ (Make SkImage_Gpu be deferred) split out into: https://skia-review.googlesource.com/c/9106/ (Remove atlas creation from GrResourceProvider) Change-Id: I834ede430b9706cf9b675bdfdddf1c8c624c2f14 Reviewed-on: https://skia-review.googlesource.com/9965 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Revert "Make SkImage_Gpu be deferred"Gravatar Robert Phillips2017-03-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 0db235bc0278887c344eb25b4681e9cca4cf892a. Reason for revert: cc_unittests failing Original change's description: > Make SkImage_Gpu be deferred > > This CL removes the GrTexture-based ctor forcing everyone to create deferred SkImage_Gpus. > > split out into: > https://skia-review.googlesource.com/c/9106/ (Remove atlas creation from GrResourceProvider) > > Change-Id: I266bbe089c242fe54d5b7adcc7895aa5a39440a0 > Reviewed-on: https://skia-review.googlesource.com/6680 > Commit-Queue: Robert Phillips <robertphillips@google.com> > Reviewed-by: Brian Salomon <bsalomon@google.com> > TBR=bsalomon@google.com,robertphillips@google.com,reviews@skia.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: Ia15590a1fae04b52723713760fdbf0492ad36286 Reviewed-on: https://skia-review.googlesource.com/9962 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Make SkImage_Gpu be deferredGravatar Robert Phillips2017-03-21
| | | | | | | | | | | | This CL removes the GrTexture-based ctor forcing everyone to create deferred SkImage_Gpus. split out into: https://skia-review.googlesource.com/c/9106/ (Remove atlas creation from GrResourceProvider) Change-Id: I266bbe089c242fe54d5b7adcc7895aa5a39440a0 Reviewed-on: https://skia-review.googlesource.com/6680 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* Begin implementation of SkImage_Base::makeColorSpaceGravatar Matt Sarett2017-03-14
| | | | | | | | | | | | | | Originally: https://skia-review.googlesource.com/9622 CQ_INCLUDE_TRYBOTS=skia.primary:Test-Mac-Clang-MacMini6.2-CPU-AVX-x86_64-Release,Test-Android-Clang-PixelC-CPU-TegraX1-arm64-Debug-Android BUG=skia: Change-Id: I7ef1daaab32892399e3333e4b2fc75d70a1900e4 Reviewed-on: https://skia-review.googlesource.com/9651 Commit-Queue: Matt Sarett <msarett@google.com> Reviewed-by: Matt Sarett <msarett@google.com>
* Revert "Begin implementation of SkImage_Base::makeColorSpace"Gravatar Mike Reed2017-03-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 98629efdde9236e444d7b3fa644eaab3a1301566. Reason for revert: unittest failures Failures: ../../../tests/ImageTest.cpp:1099 0x28 == SkGetPackedR32(*p3Bitmap.getAddr32(0, 0)) ../../../tests/ImageTest.cpp:1100 0x40 == SkGetPackedG32(*p3Bitmap.getAddr32(0, 0)) ../../../tests/ImageTest.cpp:1101 0x5E == SkGetPackedB32(*p3Bitmap.getAddr32(0, 0)) Original change's description: > Begin implementation of SkImage_Base::makeColorSpace > > BUG=skia: > > Change-Id: Idf946faa64dad32a28070a430926a8225dbf6e5a > Reviewed-on: https://skia-review.googlesource.com/9622 > Commit-Queue: Matt Sarett <msarett@google.com> > Reviewed-by: Brian Osman <brianosman@google.com> > TBR=mtklein@google.com,msarett@google.com,brianosman@google.com,reviews@skia.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Change-Id: I6ce2a28ca581f7d01322588c2435133d8c6a2435 Reviewed-on: https://skia-review.googlesource.com/9649 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Begin implementation of SkImage_Base::makeColorSpaceGravatar Matt Sarett2017-03-14
| | | | | | | | | BUG=skia: Change-Id: Idf946faa64dad32a28070a430926a8225dbf6e5a Reviewed-on: https://skia-review.googlesource.com/9622 Commit-Queue: Matt Sarett <msarett@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
* Partially defer SkImage_GpuGravatar Robert Phillips2017-03-10
| | | | | | | | | One of SkImageCacherator, GrBitmapTextureMaker, GrImageTextureMaker, GrTextureAdjuster, GrTextureProducer or SkImage has to take the first step. This is probably the least odd of the options. Change-Id: Ie167034553451f4b3633a5a1548dbd4d75839b3d Reviewed-on: https://skia-review.googlesource.com/9488 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Switch GrYUVProvider over to GrTextureProxiesGravatar Robert Phillips2017-03-08
| | | | | | | | | This is split out of: https://skia-review.googlesource.com/c/8823/ (Remove GrFragmentProcessor-derived class' GrTexture-based ctors) Change-Id: I302e6b4c1ffed449a990288ec06f2dfdcdadf1f8 Reviewed-on: https://skia-review.googlesource.com/9448 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Add SkImage_Base::onMakeColorSpace() stubGravatar Matt Sarett2017-03-08
| | | | | | | | | BUG=skia: Change-Id: I103ea172a4874bc2a9f644caa406da7afe94aa1c Reviewed-on: https://skia-review.googlesource.com/9451 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
* Reduce use of SkImage_Base::peekTextureGravatar Robert Phillips2017-01-31
| | | | | | | Change-Id: I079093c9706df4911d47fba04b786e59240e8cb4 Reviewed-on: https://skia-review.googlesource.com/7792 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Continue making Ganesh use absolute texture coordinates - take 2Gravatar Robert Phillips2017-01-20
| | | | | | | | | | | | The idea here is that the GrCoordTransform will actually hold a GrTextureProxy (rather than a GrTexture) and then, in GrGLSLPrimitiveProcessor::GetTransformMatrix, use the instantiated width & height (when uploading the transform matrix) Relanding of: https://skia-review.googlesource.com/c/6977/ Change-Id: Ibc9b9e354f7fc23b1a6e6e4fe7c9fe3cef771c02 Reviewed-on: https://skia-review.googlesource.com/7265 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Make SkImage_Base::onReadPixels() pure virtualGravatar Matt Sarett2017-01-10
| | | | | | | | | BUG=skia: Change-Id: I52504b21313717bf8321ec3f1df770773703a1a1 Reviewed-on: https://skia-review.googlesource.com/6831 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
* 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>
* Support decoding images to multiple formats, depending on usageGravatar Brian Osman2016-11-21
| | | | | | | | | | | | | | | | | | | | | | | | Our codec generator will now preserve any asked-for color space, and convert the encoded data to that representation. Cacherator now allows decoding an image to both legacy (nullptr color space), and color-correct formats. In color-correct mode, we choose the best decoded format, based on the original properties, and our backend's capabilities. Preference is given to the native format, when it's already texturable (sRGB 8888 or F16 linear). Otherwise, we prefer linear F16, and fall back to sRGB when that's not an option. Re-land (and fix) of: https://skia-review.googlesource.com/c/4438/ https://skia-review.googlesource.com/c/4796/ BUG=skia:5907 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4838 Change-Id: I20ff972ffe1c7e6535ddc501e2a8ab8c246e4061 Reviewed-on: https://skia-review.googlesource.com/4838 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Matt Sarett <msarett@google.com>
* Rename GrTextureParams to GrSamplerParamsGravatar Brian Salomon2016-11-17
| | | | | | | | | GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4965 Change-Id: I7d52e81c670e92ca96117284f44b274ce3cc3671 Reviewed-on: https://skia-review.googlesource.com/4965 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Revert "Support decoding images to multiple formats, depending on usage"Gravatar Brian Osman2016-11-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit c73a1ecbed64652b3d7aa8dc6face9a2205ce830. Reason for revert: ANGLE and CommandBuffer failures Original change's description: > Support decoding images to multiple formats, depending on usage > > Our codec generator will now preserve any asked-for color space, and > convert the encoded data to that representation. Cacherator now > allows decoding an image to both legacy (nullptr color space), and > color-correct formats. In color-correct mode, we choose the best > decoded format, based on the original properties, and our backend's > capabilities. Preference is given to the native format, when it's > already texturable (sRGB 8888 or F16 linear). Otherwise, we prefer > linear F16, and fall back to sRGB when that's not an option. > > BUG=skia:5907 > > GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4438 > > Change-Id: I847c243dcfb72d8c0f1f6fc73c09547adea933f0 > Reviewed-on: https://skia-review.googlesource.com/4438 > Reviewed-by: Matt Sarett <msarett@google.com> > Commit-Queue: Brian Osman <brianosman@google.com> > TBR=mtklein@google.com,bsalomon@google.com,msarett@google.com,brianosman@google.com,reed@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: I1818f937464573d601f64e5a1f1eb43f5a778f4e Reviewed-on: https://skia-review.googlesource.com/4832 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
* Support decoding images to multiple formats, depending on usageGravatar Brian Osman2016-11-15
| | | | | | | | | | | | | | | | | | | | Our codec generator will now preserve any asked-for color space, and convert the encoded data to that representation. Cacherator now allows decoding an image to both legacy (nullptr color space), and color-correct formats. In color-correct mode, we choose the best decoded format, based on the original properties, and our backend's capabilities. Preference is given to the native format, when it's already texturable (sRGB 8888 or F16 linear). Otherwise, we prefer linear F16, and fall back to sRGB when that's not an option. BUG=skia:5907 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4438 Change-Id: I847c243dcfb72d8c0f1f6fc73c09547adea933f0 Reviewed-on: https://skia-review.googlesource.com/4438 Reviewed-by: Matt Sarett <msarett@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Enable SkImage_pinAsTexture to signal if the operation succeeded.Gravatar Derek Sollenberger2016-11-09
| | | | | | | | | GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4488 Change-Id: Id667f385b172e4a56faa9324066f57295af30ef3 Reviewed-on: https://skia-review.googlesource.com/4488 Commit-Queue: Derek Sollenberger <djsollen@google.com> Reviewed-by: Brian Salomon <bsalomon@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>
* Remove unused SkImage_Base and SkImage_Gpu onNewSurface methodsGravatar robertphillips2016-09-21
| | | | | | GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2353403002 Review-Url: https://codereview.chromium.org/2353403002
* Add alphaType() to SkImageGravatar brianosman2016-08-17
| | | | | | | | | | | | | | Keep isOpaque as a convenience method -- many places really only need to know that for optimization purposes (SrcOver -> Src, etc...). In all the places where we pull data back out or convert to another object and need to supply an SkImageInfo, we can avoid losing information about premulness. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2250663002 Review-Url: https://codereview.chromium.org/2250663002
* fix no-gpu buildGravatar reed2016-08-17
| | | | | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2253073003 TBR=robertphilips NOTREECHECKS=true Review-Url: https://codereview.chromium.org/2253073003
* pin as texture apiGravatar reed2016-08-17
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2241353002 Review-Url: https://codereview.chromium.org/2241353002