aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/image/SkImage_Gpu.h
Commit message (Collapse)AuthorAge
* 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>
* Add DDL to SKPBenchGravatar Robert Phillips2018-05-30
| | | | | | | | | | | Most of this CL is just repackaging the promise image and tile code from ViaDDL for reuse by SKPBench. Change-Id: Ie5003c36fe85cc5be9639552f9488b8e92dcdbbf Reviewed-on: https://skia-review.googlesource.com/129805 Reviewed-by: Chris Dalton <csmartdalton@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Make SkImage own its GrContext.Gravatar Brian Salomon2018-05-24
| | | | | | | Change-Id: I86577fab5406ae9ad89d87fa971b0db6e0283cb4 Reviewed-on: https://skia-review.googlesource.com/130020 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
* Add usage of SkYUVAIndex as pre-step to transfer to new YUVA APIGravatar Weiliang Chen2018-05-23
| | | | | | | | | | | | | | The plan foward is to have a new API on SkImage to make from YUVA textures which a combination of array of textures and array of SkYUVAIndex struct indicating which texture and channel to read for each plane. This is a pre-step to let the old API use these ideas. Bug: skia: 7903 Change-Id: I6a696db31a574247eb2abff60f2186a74b640142 Reviewed-on: https://skia-review.googlesource.com/128601 Commit-Queue: Weiliang Chen <weiliangc@chromium.org> Reviewed-by: Brian Salomon <bsalomon@google.com> Reviewed-by: Greg Daniel <egdaniel@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>
* 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 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 DoneProc to Promise ImagesGravatar Greg Daniel2018-03-16
| | | | | | | | | | | | | This proc will notify the client when we will no longer call fulfill on their promise image so that can delete any meta data they needed to store to be able to complete the fulfill requests. Bug: skia: Change-Id: Ife1e6845f221c31ce1ae2c0d2ba5e4c8f0203b74 Reviewed-on: https://skia-review.googlesource.com/114092 Commit-Queue: Greg Daniel <egdaniel@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* Cleanup SkImage YUV texture factories.Gravatar Brian Salomon2018-03-15
| | | | | | | | | | | | | Remove unused GrBackendObject variants. Add versions without redundant size param. Make this work with GrBackendTextures that weren't created with a GrPixelConfig. Change-Id: Ic1bbf5f2817cebab938b4f31000126a6ab5c44d5 Reviewed-on: https://skia-review.googlesource.com/114460 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: 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>
* Add promise images for deferred instantiation of wrapped gpu texturesGravatar Greg Daniel2018-03-09
| | | | | | | | | | | | | This will allow a client to make an SkImage that "wraps" a gpu texture, however the client does need to supply the actual gpu texture at Image creation time. Instead it is retrieve at flush time via a callback. Bug: skia: Change-Id: I6267a55ab7102101a7bd80a6f547b6a870d2df08 Reviewed-on: https://skia-review.googlesource.com/109021 Commit-Queue: Greg Daniel <egdaniel@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com> Reviewed-by: 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>
* Make instantiate return a BooleanGravatar Robert Phillips2017-06-05
| | | | | | | | | | | | From an off-line conversation: The longer term idea will be to create a helper class isolates the ability to instantiate proxies until flush time. The peek* methods could then be moved to GrSurfaceProxy. Change-Id: I8e8c02c098475b77d515791c0d6b81f7e4a327dd Reviewed-on: https://skia-review.googlesource.com/18076 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* Remove GrSurfaceDesc member from GrSurfaceProxy.Gravatar Brian Salomon2017-05-17
| | | | | | | | | Stores the config, origin, and dimensions in GrSurfaceProxy, sample count in GrRenderTargetProxy, and "was constructed with mip maps" in GrTextureProxy. Change-Id: Iee058674dce49107a991cca9d083cd33e3572809 Reviewed-on: https://skia-review.googlesource.com/17209 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Robert Phillips <robertphillips@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 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>
* check-headers-self-sufficient: updateGravatar Hal Canary2017-03-21
| | | | | | | | | | | | * Translate to python, use multiprocessing to make it wun in reasonanble time. * Fix three headers. * Move one header. Change-Id: I0b26f912bb8086ec158d1c0bae76b923ec6121a4 Reviewed-on: https://skia-review.googlesource.com/8490 Reviewed-by: Brian Salomon <bsalomon@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Hal Canary <halcanary@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>
* Remove budgeted parameter from SkSurface::makeImageSnapshot (take 2)Gravatar Robert Phillips2017-03-20
| | | | | | | | | | | | | This unused feature complicates MDB. Chrome compiles locally for me with this CL. frameworks/base/libs/hwui compiles locally for me with this CL. Change-Id: Id3ad64dac72eace52855896df0d7ce3679f15884 Reviewed-on: https://skia-review.googlesource.com/9882 Reviewed-by: Brian Salomon <bsalomon@google.com> Reviewed-by: Matt Sarett <msarett@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Revert "Revert "Revert "Remove budgeted parameter from ↵Gravatar Yuqian Li2017-03-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SkSurface::makeImageSnapshot""" This reverts commit 31249bb2df023868e4585f14519bf17c835f8700. Reason for revert: Android build is still broken as shown below. out/target/product/bullhead/obj/NATIVE_TESTS/hwui_unit_tests_intermediates/tests/unit/SkiaPipelineTests.o frameworks/base/libs/hwui/tests/unit/SkiaPipelineTests.cpp" frameworks/base/libs/hwui/tests/unit/SkiaPipelineTests.cpp:211:51: error: non-virtual member function marked 'override' hides virtual member function sk_sp<SkImage> onNewImageSnapshot(SkBudgeted) override { ^ external/skia/src/image/SkSurface_Base.h:46:28: note: hidden overloaded virtual function 'SkSurface_Base::onNewImageSnapshot' declared here: different number of parameters (0 vs 1) virtual sk_sp<SkImage> onNewImageSnapshot() = 0; ^ frameworks/base/libs/hwui/tests/unit/SkiaPipelineTests.cpp:281:84: error: no viable conversion from 'sk_sp<DeferLayer<DeferTestCanvas>>' to 'sk_sp<SkSurface>' pipeline->renderFrame(layerUpdateQueue, dirty, nodes, true, contentDrawBounds, surface); ^~~~~~~ external/skia/include/core/SkRefCnt.h:253:15: note: candidate constructor not viable: no known conversion from 'sk_sp<DeferLayer<DeferTestCanvas> >' to 'std::nullptr_t' (aka 'nullptr_t') for 1st argument constexpr sk_sp(std::nullptr_t) : fPtr(nullptr) {} ^ external/skia/include/core/SkRefCnt.h:259:5: note: candidate constructor not viable: no known conversion from 'sk_sp<DeferLayer<DeferTestCanvas> >' to 'const sk_sp<SkSurface> &' for 1st argument sk_sp(const sk_sp<T>& that) : fPtr(SkSafeRef(that.get())) {} ^ external/skia/include/core/SkRefCnt.h:268:5: note: candidate constructor not viable: no known conversion from 'sk_sp<DeferLayer<DeferTestCanvas> >' to 'sk_sp<SkSurface> &&' for 1st argument sk_sp(sk_sp<T>&& that) : fPtr(that.release()) {} ^ external/skia/include/gpu/../private/SkTLogic.h:27:82: note: candidate template ignored: disabled by 'enable_if' [with U = (anonymous namespace)::DeferLayer<DeferTestCanvas>] template <bool B, typename T = void> using enable_if_t = typename std::enable_if<B, T>::type; ^ external/skia/include/gpu/../private/SkTLogic.h:27:82: note: candidate template ignored: disabled by 'enable_if' [with U = (anonymous namespace)::DeferLayer<DeferTestCanvas>] external/skia/include/core/SkRefCnt.h:327:5: note: candidate function operator unspecified_bool_type() const { return this->get() ? &sk_sp::fPtr : nullptr; } ^ frameworks/base/libs/hwui/pipeline/skia/SkiaPipeline.h:50:30: note: passing argument to parameter 'surface' here sk_sp<SkSurface> surface); ^ frameworks/base/libs/hwui/tests/unit/SkiaPipelineTests.cpp:312:58: error: no viable conversion from 'sk_sp<DeferLayer<ClippedTestCanvas>>' to 'sk_sp<SkSurface>' SkRect::MakeWH(CANVAS_WIDTH, CANVAS_HEIGHT), surface); ^~~~~~~ external/skia/include/core/SkRefCnt.h:253:15: note: candidate constructor not viable: no known conversion from 'sk_sp<DeferLayer<ClippedTestCanvas> >' to 'std::nullptr_t' (aka 'nullptr_t') for 1st argument constexpr sk_sp(std::nullptr_t) : fPtr(nullptr) {} ^ external/skia/include/core/SkRefCnt.h:259:5: note: candidate constructor not viable: no known conversion from 'sk_sp<DeferLayer<ClippedTestCanvas> >' to 'const sk_sp<SkSurface> &' for 1st argument sk_sp(const sk_sp<T>& that) : fPtr(SkSafeRef(that.get())) {} ^ external/skia/include/core/SkRefCnt.h:268:5: note: candidate constructor not viable: no known conversion from 'sk_sp<DeferLayer<ClippedTestCanvas> >' to 'sk_sp<SkSurface> &&' for 1st argument sk_sp(sk_sp<T>&& that) : fPtr(that.release()) {} ^ external/skia/include/gpu/../private/SkTLogic.h:27:82: note: candidate template ignored: disabled by 'enable_if' [with U = (anonymous namespace)::DeferLayer<ClippedTestCanvas>] template <bool B, typename T = void> using enable_if_t = typename std::enable_if<B, T>::type; ^ external/skia/include/gpu/../private/SkTLogic.h:27:82: note: candidate template ignored: disabled by 'enable_if' [with U = (anonymous namespace)::DeferLayer<ClippedTestCanvas>] external/skia/include/core/SkRefCnt.h:327:5: note: candidate function operator unspecified_bool_type() const { return this->get() ? &sk_sp::fPtr : nullptr; } ^ frameworks/base/libs/hwui/pipeline/skia/SkiaPipeline.h:50:30: note: passing argument to parameter 'surface' here sk_sp<SkSurface> surface); ^ frameworks/base/libs/hwui/tests/unit/SkiaPipelineTests.cpp:343:58: error: no viable conversion from 'sk_sp<DeferLayer<ClipReplaceTestCanvas>>' to 'sk_sp<SkSurface>' SkRect::MakeWH(CANVAS_WIDTH, CANVAS_HEIGHT), surface); ^~~~~~~ external/skia/include/core/SkRefCnt.h:253:15: note: candidate constructor not viable: no known conversion from 'sk_sp<DeferLayer<ClipReplaceTestCanvas> >' to 'std::nullptr_t' (aka 'nullptr_t') for 1st argument constexpr sk_sp(std::nullptr_t) : fPtr(nullptr) {} ^ external/skia/include/core/SkRefCnt.h:259:5: note: candidate constructor not viable: no known conversion from 'sk_sp<DeferLayer<ClipReplaceTestCanvas> >' to 'const sk_sp<SkSurface> &' for 1st argument sk_sp(const sk_sp<T>& that) : fPtr(SkSafeRef(that.get())) {} ^ external/skia/include/core/SkRefCnt.h:268:5: note: candidate constructor not viable: no known conversion from 'sk_sp<DeferLayer<ClipReplaceTestCanvas> >' to 'sk_sp<SkSurface> &&' for 1st argument sk_sp(sk_sp<T>&& that) : fPtr(that.release()) {} ^ external/skia/include/gpu/../private/SkTLogic.h:27:82: note: candidate template ignored: disabled by 'enable_if' [with U = (anonymous namespace)::DeferLayer<ClipReplaceTestCanvas>] template <bool B, typename T = void> using enable_if_t = typename std::enable_if<B, T>::type; ^ external/skia/include/gpu/../private/SkTLogic.h:27:82: note: candidate template ignored: disabled by 'enable_if' [with U = (anonymous namespace)::DeferLayer<ClipReplaceTestCanvas>] external/skia/include/core/SkRefCnt.h:327:5: note: candidate function operator unspecified_bool_type() const { return this->get() ? &sk_sp::fPtr : nullptr; } ^ frameworks/base/libs/hwui/pipeline/skia/SkiaPipeline.h:50:30: note: passing argument to parameter 'surface' here sk_sp<SkSurface> surface); ^ frameworks/base/libs/hwui/tests/unit/SkiaPipelineTests.cpp:214:42: error: cannot initialize object parameter of type 'SkSurface' with an expression of type '(anonymous namespace)::DeferLayer<DeferTestCanvas>' T* canvas() { return static_cast<T*>(getCanvas()); } ^~~~~~~~~ frameworks/base/libs/hwui/tests/unit/SkiaPipelineTests.cpp:282:27: note: in instantiation of member function '(anonymous namespace)::DeferLayer<DeferTestCanvas>::canvas' requested here EXPECT_EQ(4, surface->canvas()->mDrawCounter); ^ frameworks/base/libs/hwui/tests/unit/SkiaPipelineTests.cpp:214:42: error: cannot initialize object parameter of type 'SkSurface' with an expression of type '(anonymous namespace)::DeferLayer<ClippedTestCanvas>' T* canvas() { return static_cast<T*>(getCanvas()); } ^~~~~~~~~ frameworks/base/libs/hwui/tests/unit/SkiaPipelineTests.cpp:313:27: note: in instantiation of member function '(anonymous namespace)::DeferLayer<ClippedTestCanvas>::canvas' requested here EXPECT_EQ(1, surface->canvas()->mDrawCounter); ^ frameworks/base/libs/hwui/tests/unit/SkiaPipelineTests.cpp:214:42: error: cannot initialize object parameter of type 'SkSurface' with an expression of type '(anonymous namespace)::DeferLayer<ClipReplaceTestCanvas>' T* canvas() { return static_cast<T*>(getCanvas()); } ^~~~~~~~~ frameworks/base/libs/hwui/tests/unit/SkiaPipelineTests.cpp:344:27: note: in instantiation of member function '(anonymous namespace)::DeferLayer<ClipReplaceTestCanvas>::canvas' requested here EXPECT_EQ(1, surface->canvas()->mDrawCounter); Original change's description: > Revert "Revert "Remove budgeted parameter from SkSurface::makeImageSnapshot"" > > This reverts commit 9e9188f84b15a25e27f63d5f8de3ccd393d9a173. > > Reason for revert: Android-side fix has landed > > Original change's description: > > Revert "Remove budgeted parameter from SkSurface::makeImageSnapshot" > > > > This reverts commit b64bcbdc3a5aa7b9e3ff216e4617ddc1db9260b5. > > > > Reason for revert: > > > > Android build failed as shown below. > > > > frameworks/base/libs/hwui/VkLayer.cpp:32:41: error: too many arguments to function call, expected 0, have 1 > > mImage = surface->makeImageSnapshot(SkBudgeted::kNo); > > > > Original change's description: > > > Remove budgeted parameter from SkSurface::makeImageSnapshot > > > > > > This unused feature complicates MDB. > > > > > > Chrome compiles locally for me with this CL. > > > > > > Change-Id: I611e464885fb984030eace43ead42cf39d0e7f72 > > > Reviewed-on: https://skia-review.googlesource.com/9734 > > > Reviewed-by: Brian Salomon <bsalomon@google.com> > > > Commit-Queue: Robert Phillips <robertphillips@google.com> > > > > > > > TBR=bsalomon@google.com,robertphillips@google.com,reviews@skia.org > > NOPRESUBMIT=true > > NOTREECHECKS=true > > NOTRY=true > > > > Change-Id: Iae6e313c15b2352bd0d4fc7b5629de0a51ac398e > > Reviewed-on: https://skia-review.googlesource.com/9788 > > Reviewed-by: Yuqian Li <liyuqian@google.com> > > Commit-Queue: Yuqian Li <liyuqian@google.com> > > > > TBR=bsalomon@google.com,robertphillips@google.com,reviews@skia.org,liyuqian@google.com > # Not skipping CQ checks because original CL landed > 1 day ago. > > Change-Id: If07d1b5db6e6c618d37445a0cf127780ed243a92 > Reviewed-on: https://skia-review.googlesource.com/9843 > Reviewed-by: Robert Phillips <robertphillips@google.com> > Commit-Queue: Robert Phillips <robertphillips@google.com> > TBR=bsalomon@google.com,robertphillips@google.com,reviews@skia.org,liyuqian@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: I674b0a9d4130e00164d2e0344a92c373cf70f4fd Reviewed-on: https://skia-review.googlesource.com/9873 Reviewed-by: Yuqian Li <liyuqian@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Revert "Revert "Remove budgeted parameter from SkSurface::makeImageSnapshot""Gravatar Robert Phillips2017-03-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 9e9188f84b15a25e27f63d5f8de3ccd393d9a173. Reason for revert: Android-side fix has landed Original change's description: > Revert "Remove budgeted parameter from SkSurface::makeImageSnapshot" > > This reverts commit b64bcbdc3a5aa7b9e3ff216e4617ddc1db9260b5. > > Reason for revert: > > Android build failed as shown below. > > frameworks/base/libs/hwui/VkLayer.cpp:32:41: error: too many arguments to function call, expected 0, have 1 > mImage = surface->makeImageSnapshot(SkBudgeted::kNo); > > Original change's description: > > Remove budgeted parameter from SkSurface::makeImageSnapshot > > > > This unused feature complicates MDB. > > > > Chrome compiles locally for me with this CL. > > > > Change-Id: I611e464885fb984030eace43ead42cf39d0e7f72 > > Reviewed-on: https://skia-review.googlesource.com/9734 > > Reviewed-by: Brian Salomon <bsalomon@google.com> > > Commit-Queue: Robert Phillips <robertphillips@google.com> > > > > TBR=bsalomon@google.com,robertphillips@google.com,reviews@skia.org > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > > Change-Id: Iae6e313c15b2352bd0d4fc7b5629de0a51ac398e > Reviewed-on: https://skia-review.googlesource.com/9788 > Reviewed-by: Yuqian Li <liyuqian@google.com> > Commit-Queue: Yuqian Li <liyuqian@google.com> > TBR=bsalomon@google.com,robertphillips@google.com,reviews@skia.org,liyuqian@google.com # Not skipping CQ checks because original CL landed > 1 day ago. Change-Id: If07d1b5db6e6c618d37445a0cf127780ed243a92 Reviewed-on: https://skia-review.googlesource.com/9843 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Revert "Remove budgeted parameter from SkSurface::makeImageSnapshot"Gravatar Yuqian Li2017-03-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit b64bcbdc3a5aa7b9e3ff216e4617ddc1db9260b5. Reason for revert: Android build failed as shown below. frameworks/base/libs/hwui/VkLayer.cpp:32:41: error: too many arguments to function call, expected 0, have 1 mImage = surface->makeImageSnapshot(SkBudgeted::kNo); Original change's description: > Remove budgeted parameter from SkSurface::makeImageSnapshot > > This unused feature complicates MDB. > > Chrome compiles locally for me with this CL. > > Change-Id: I611e464885fb984030eace43ead42cf39d0e7f72 > Reviewed-on: https://skia-review.googlesource.com/9734 > Reviewed-by: Brian Salomon <bsalomon@google.com> > Commit-Queue: Robert Phillips <robertphillips@google.com> > TBR=bsalomon@google.com,robertphillips@google.com,reviews@skia.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: Iae6e313c15b2352bd0d4fc7b5629de0a51ac398e Reviewed-on: https://skia-review.googlesource.com/9788 Reviewed-by: Yuqian Li <liyuqian@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Remove budgeted parameter from SkSurface::makeImageSnapshotGravatar Robert Phillips2017-03-16
| | | | | | | | | | | This unused feature complicates MDB. Chrome compiles locally for me with this CL. Change-Id: I611e464885fb984030eace43ead42cf39d0e7f72 Reviewed-on: https://skia-review.googlesource.com/9734 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* GPU version of onMakeColorSpaceGravatar Brian Osman2017-03-15
| | | | | | | | | | | | | | New fragment processor that implements end-to-end color space conversion, with nonlinear blending. BUG=skia:6242 Change-Id: Ied86170fc28537a2bc209d57530d3ded48b467a9 Reviewed-on: https://skia-review.googlesource.com/9543 Reviewed-by: Brian Salomon <bsalomon@google.com> Reviewed-by: Matt Sarett <msarett@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: 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>
* Make GrClip.h privateGravatar Brian Salomon2017-03-09
| | | | | | | | | BUG=skia: Change-Id: I4aa3c2707811ece3a63d161035e316c3bbc1cd15 Reviewed-on: https://skia-review.googlesource.com/9482 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Brian Osman <brianosman@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>
* 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>
* Move read/write-Pixels up to GrSurfaceContextGravatar Robert Phillips2017-01-18
| | | | | | | | | | | | | | This still needs to be propagated out in several ways: replace more instances of GrSurface::read/write-Pixels add colorSpace to more instances of the TextureContext but it establishes a beach-head and is exciting enough as is. Change-Id: If86035aa0245e70b54541e83722b3c75bc5ade13 Reviewed-on: https://skia-review.googlesource.com/7172 Reviewed-by: Brian Osman <brianosman@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@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>
* 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 SkAutoTUnref and SkAutoTDelete from public includes.Gravatar bungeman2016-10-27
| | | | | | | | | | | | | | | This also makes the required changed to src, tests, and tools. The few public APIs modified by this change appear to be unused outside of Skia. Removing these from the public API makes it easier to ensure users are no longer using them. This also updates GrGpu::wrapBackendXXX and the ::onWrapBackendXXX methods to clarify ownership. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2448593002 Review-Url: https://codereview.chromium.org/2448593002
* 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