This new api will eventually replace the version that takes an
SkSurface::BackendAccess.
Change-Id: I48cd013725e14027f386b0b111223459944ac44a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295567
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
This is currently only supported for the Vulkan backend
Bug: skia:10254
Change-Id: I9274799098dc00dec5abcbcec95ce7cc23fec537
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/293844
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
CanvasKit converts 4 floats to an int, just to have it be
converted back into 4 floats when it goes into the paint.
Change-Id: I93cf1c596283b83cc9452fb205b7000ceed09bb9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/293538
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Change-Id: I9dbe6020d67cc452c9cbbdeace68f1d01275b419
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/293559
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Bug: skia:10154
Once ag/11371053 lands, Android will only be referencing the new version
at android::skia::BitmapRegionDecoder. Remove the old code that remained
for the transition.
Change-Id: Ic532d705e8f2861f56dcaa0ac1c68dd2b0712035
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/291357
Commit-Queue: Leon Scroggins <scroggo@google.com>
Auto-Submit: Leon Scroggins <scroggo@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Still some more work to do to remove internal usage.
Bug: skia:9832
Change-Id: Id0403d92debc26af2002630a4dfcf960c9343260
Docs-Preview: https://skia.org/?cl=292719
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292719
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This was another surprising (to me) inconsistency. Just because these
geometric primitives allow for explicit local coords, doesn't mean we
should require them (vs. all others that implicitly sample using local
position).
Change-Id: If3e7f6077bd15891b06cd2ffc969f1a649305d42
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290130
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This reverts commit ed219fe171.
Reason for revert: relanding with fix
Original change's description:
> Revert "Reland "Add api on GrContext to update the data of GrBackendTextures.""
>
> This reverts commit 83c6626946.
>
> Reason for revert: technospark is failing to upload pixmaps to non base mip levels
>
> Original change's description:
> > Reland "Add api on GrContext to update the data of GrBackendTextures."
> >
> > This reverts commit 93ca54e0ac.
> >
> > Reason for revert: relanding with fix
> >
> > Original change's description:
> > > Revert "Add api on GrContext to update the data of GrBackendTextures."
> > >
> > > This reverts commit ac09f7cd7a.
> > >
> > > Reason for revert: breaking bots, may need to use swizzled color for
> > > correctness test
> > >
> > > Original change's description:
> > > > Add api on GrContext to update the data of GrBackendTextures.
> > > >
> > > > Change-Id: I680f12bf58fc7b66a6b2f3fa4c4723ae84d3f949
> > > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288555
> > > > 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: I47f41f536619ac13ca3ceeb216e7eaed9a9af255
> > > No-Presubmit: true
> > > No-Tree-Checks: true
> > > No-Try: true
> > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288630
> > > Reviewed-by: Greg Daniel <egdaniel@google.com>
> > > Commit-Queue: Greg Daniel <egdaniel@google.com>
> >
> > TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
> >
> > # Not skipping CQ checks because this is a reland.
> >
> > Change-Id: I82283b2437e523b80acead71c5f7c651180620db
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288631
> > Reviewed-by: Greg Daniel <egdaniel@google.com>
> > 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: I5d6614db8db59a69ded511726507a186596cfbd4
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288907
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>
TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
# Not skipping CQ checks because this is a reland.
Change-Id: I35fa1ae7dc47a697bbc358655f5c821942033234
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288909
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Currently this is possible by getting the canvas off of surface and then
getting the context off of the canvas. However, if in the future we wanted
a surface that didn't have a canvas (maybe something that looked like a
mutible image that only had a writePixels call), this would allow us to
still get the GrContext.
Bug: skia:10118
Change-Id: Ie8504bb708c1e4532edc8c7832ead86ae711e237
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/289479
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
We add a new flushAndSubmit() to replace the current flush() call. In
the future all other flush(GrFlushInfo) type calls will not do a
submission of work to the GPU. Instead an explicit submit call will have
to be made. flushAndSubmit will do a flush and submit.
Also adds a no-op submit call. This allows us to stage the flush submit
changes by updating all clients that use non simple flushes to add
a submit call immediately after each flush. Then we can change the logic
of where the submission happens from flush to submit without breaking
folks.
Bug: skia:10118
Change-Id: I4f02189a21912d52b888597c7734b4ca0baee792
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/289478
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
This reverts commit 83c6626946.
Reason for revert: technospark is failing to upload pixmaps to non base mip levels
Original change's description:
> Reland "Add api on GrContext to update the data of GrBackendTextures."
>
> This reverts commit 93ca54e0ac.
>
> Reason for revert: relanding with fix
>
> Original change's description:
> > Revert "Add api on GrContext to update the data of GrBackendTextures."
> >
> > This reverts commit ac09f7cd7a.
> >
> > Reason for revert: breaking bots, may need to use swizzled color for
> > correctness test
> >
> > Original change's description:
> > > Add api on GrContext to update the data of GrBackendTextures.
> > >
> > > Change-Id: I680f12bf58fc7b66a6b2f3fa4c4723ae84d3f949
> > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288555
> > > 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: I47f41f536619ac13ca3ceeb216e7eaed9a9af255
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288630
> > Reviewed-by: Greg Daniel <egdaniel@google.com>
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
>
> TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
>
> # Not skipping CQ checks because this is a reland.
>
> Change-Id: I82283b2437e523b80acead71c5f7c651180620db
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288631
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> 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: I5d6614db8db59a69ded511726507a186596cfbd4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288907
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
This reverts commit 93ca54e0ac.
Reason for revert: relanding with fix
Original change's description:
> Revert "Add api on GrContext to update the data of GrBackendTextures."
>
> This reverts commit ac09f7cd7a.
>
> Reason for revert: breaking bots, may need to use swizzled color for
> correctness test
>
> Original change's description:
> > Add api on GrContext to update the data of GrBackendTextures.
> >
> > Change-Id: I680f12bf58fc7b66a6b2f3fa4c4723ae84d3f949
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288555
> > 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: I47f41f536619ac13ca3ceeb216e7eaed9a9af255
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288630
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>
TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
# Not skipping CQ checks because this is a reland.
Change-Id: I82283b2437e523b80acead71c5f7c651180620db
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288631
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
This reverts commit ac09f7cd7a.
Reason for revert: breaking bots, may need to use swizzled color for
correctness test
Original change's description:
> Add api on GrContext to update the data of GrBackendTextures.
>
> Change-Id: I680f12bf58fc7b66a6b2f3fa4c4723ae84d3f949
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288555
> 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: I47f41f536619ac13ca3ceeb216e7eaed9a9af255
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288630
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
The callback lets the caller know when the data uploads to the texture
from the create call are finished. This is important since the caller
cannot delete the backend texture till the gpu is finished on vulkan
and d3d.
This change also removes the hard sync in vulkan during creation.
Change-Id: I660d142219474e22b1337d2b0c81cda66fe18a4b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/286517
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Will use this in Chrome to support LCDText in saveLayer/restore with
opacity.
This partly reverts https://skia-review.googlesource.com/c/skia/+/181841.
Bug: 1076019
Change-Id: Id870fb1dcc95c9b319797e936725b4447a97d1d5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/285956
Commit-Queue: Florin Malita <fmalita@chromium.org>
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Auto-Submit: Xianzhu Wang <wangxianzhu@chromium.org>
This reverts commit b25f30348b.
Bug: skia:10154
Original message:
> Add client_utils for code that is specifically for a single client.
> Move SkFrontBufferedStream into its android/ subdir. Rename the class
> to android::skia::FrontBufferedStream. Temporarily leave in
> SkFrontBufferedStream until Android updates to the new API.
>
> Add a new optional target for client_utils/android. It is built in dev
> builds for testing, and when building for the Android framework.
Deliberately do not include client_utils in Google3, since the whole
point is to only include where necessary.
Change-Id: I48938c56aabb98e1ed820240d43ffcd0fdce7956
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/285104
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Mike Reed <reed@google.com>
We don't have a way to erase with a non-sRGB color.
Update the P3 gm to test this, removing the SkBitmap erase case where
there's no option for even an SkColor4f, let alone non-sRGB. I'm not
sure it's really important to have one when we've got this on pixmap.
Updated release notes.
Change-Id: Ie98270d3f83e041593b4c6b2da8e325b36d4ff18
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/285341
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This reverts commit 513720f28e.
Reason for revert: Breaking the google3 roll:
https://sponge.corp.google.com/invocation?tab=Build+Log&id=5f96970b-8171-4c2f-abf3-006e11b8fff9
Original change's description:
> Move SkFrontBufferedStream into Android-only dir
>
> Bug: skia:10154
>
> Add client_utils for code that is specifically for a single client.
> Move SkFrontBufferedStream into its android/ subdir. Rename the class
> to android::skia::FrontBufferedStream. Temporarily leave in
> SkFrontBufferedStream until Android updates to the new API.
>
> Add a new optional target for client_utils/android. It is built in dev
> builds for testing, and when building for the Android framework.
>
> Change-Id: Ie0f425051ea370aab7861d61150a3d6007214a93
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284721
> Commit-Queue: Leon Scroggins <scroggo@google.com>
> Reviewed-by: Mike Reed <reed@google.com>
> Reviewed-by: Derek Sollenberger <djsollen@google.com>
TBR=djsollen@google.com,scroggo@google.com,reed@google.com
Change-Id: Iaeedaed184cc35f507d5441631ae709e1c5cb1ac
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10154
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/285100
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
Commit-Queue: Joe Gregorio <jcgregorio@google.com>
Bug: skia:10154
Add client_utils for code that is specifically for a single client.
Move SkFrontBufferedStream into its android/ subdir. Rename the class
to android::skia::FrontBufferedStream. Temporarily leave in
SkFrontBufferedStream until Android updates to the new API.
Add a new optional target for client_utils/android. It is built in dev
builds for testing, and when building for the Android framework.
Change-Id: Ie0f425051ea370aab7861d61150a3d6007214a93
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284721
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
The morphology image filters work on pixels, so took the radii as
integers. However, these radii will be mapped through the CTM, so any
rounding should happen as late as possible or the effect will be overly
discretized.
Bug: skia:10110
Change-Id: I62ab6c37d0b4612690addc48c9bc473099ac36b9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282636
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
From my scanning of clients this should not change how any of our main
users interact with semaphores. The biggest change here is that we don't
give up on submitted all the semaphores if a creation fails. We just
submit the semaphores we do have. It also makes it explicit that the
client is responsible for deleting any initialized semaphore regardless
if we were able to submit the semaphores or not or if the semaphore was
wrapped or created by Skia.
The motivation for this change is to more align the current API with
how things will work when we separate flushing and submit into different
calls.
Bug: skia:10118
Change-Id: I3e8b5d3a9852ddb2b5dc972fee21bf46ded7a36f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282265
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Now, drawing vertices without colors or a shader simply fills with the
paint color, like anyone would expect.
Bug: skia:9984
Change-Id: I9f7cf72f89948756b9c2c6e055a11c6b64fc22ff
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282043
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Bug: skia:10080
Change-Id: I936d6d696c86c50d5b51dc84894127c38ad753d4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/279048
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Add GrD3DTextureInfo and GrD3DBackendSurfaceInfo, and uses those
to initialize GrBackendTexture and GrBackendRendertarget.
Bug: skia:9935
Change-Id: I4571c1b3aa8115250ff748deb8cf4a95f80f1237
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/278036
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Updated to use sentinel GL context even when GL backend is not built.
This reverts commit 1171d314ef.
Change-Id: Ia94bbe4865ddd4e898446c13886877c539f0eb0b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277976
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
We haven't tested this in a while. Use the Metal backend instead.
Change-Id: Ic06bf4faff99950bd24e41bdea03962db99cfeee
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277612
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Also strengthens/adds some guarantees about this function:
* Always returns the same image if the original is texture-backed and
compatible with GrMipMapped (WRT HW MIP support)
* If a new texture backed image is returned it is always an uncached
texture that is not shared with another image or owned by an image
generator.
Adds a GrImageTexGenPolicy that allows control through image/bitmap
GrTextureProducers of whether a new texture must be made and whether
that texture should be budgeted or not.
Increases unit test coverage of this API.
Bug: skia:8669
Change-Id: Ifc0681856114a08fc8cfc57ca83d22efb1c1f166
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/274938
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Bug: skia:
Change-Id: Ia83f2b69948eeb747ecc171fb8677c8e22cc8ba7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277176
Reviewed-by: Heather Miller <hcm@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Heather Miller <hcm@google.com>
SkCanvas keeps its non-exotic drawBitmap calls for now but they
immediately wrap the bitmap in SkImage::MakeFromBitmap. This will
add a copy for mutable bitmaps, but this can be worked around by using
images directly (preferred), or marking the bitmap as immutable. In
practice, mutable bitmaps do not seem to be widely used so this is
deemed acceptable for now.
Several GMs are updated to mark the bitmaps as immutable in order to
avoid pixel churn in how CPU vs. GPU mipmaps are generated. As we move
towards explicit mipmap generation, this distinction will become less
critical, so I'm just avoiding it for now. See skbug.com/9337 for mipmap
proposal. The image diffs encountered in this CL directly related to
generating mipmaps for bitmaps already cached on the GPU vs. not on the
GPU yet.
It was decided to copy if mutable vs. never copying the bitmap because
it preserves the image guarantees the devices and canvas' rely on,
and imposing the need to inspect an image for mutability is undesired.
Bug: skia:10037, skia:9337
Change-Id: If152e6cae1e155ccf6bd2cd755895f3c7a0135a5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276004
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
No one was using this, and it added significant complexity to
GrDrawVerticesOp.
Bug: skia:9984
Change-Id: I23f38b3f5d853a8e531f13b6931cd57b5985a2c8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276407
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This reverts commit 9d4b788807.
Copyright issue has been fixed in
https://skia-review.googlesource.com/c/skia/+/275998.
Original description:
Bug: skia:9756
In CanvasKit, a large part of the binary is for encoding. Clients
would be happier with a smaller binary and no webp/jpeg encoding. Make
this an option by splitting up the GN arguments.
Split SK_HAS_WEBP_LIBRARY into SK_CODEC_DECODES_WEBP (to match the
existing SK_CODEC_DECODES_RAW) and SK_ENCODE_WEBP. Same for JPEG and
PNG.
Update CanvasKit compile script to disable webp and jpeg encoding.
Update debugger compile script to disable all encoding.
Change IsPng signature to match other SkCodecs.
TBR=djsollen@google.com
Change-Id: Ic847bae0154e0a2922100b3f2ee14a077ee5635a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276007
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>