In future Ganesh the SkImage's will only have GrImageContexts. asTextureProxyRef, however, may need to perform some rendering thus requires an external GrRecordingContext.
Change-Id: I893573e9f3462b4c4cf5e29a7f8ee74027a2ce6e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197134
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This is necessary to convert the promise image API to call Release when all
work is flushed and Done when all work is complete (future work).
Change-Id: I9745952bb0978ca2aaa79aeed460730b2fea856e
Bug: skia:8800
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197163
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
This converts a number of ownership semantics by using sk_sp and
unique_ptr instead of comments.
Change-Id: I4c584a5a8ea54fd22a4d23deddb5ce844f883117
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197206
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Need to output matching indices as well.
Bug: skia:13417, chromium:937412
Change-Id: I251a70eb07fda8b3a257d9f57ebdd9f20ad01b5a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197160
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Now that we never re-fulfill a promise image we no longer need to deinstantiate
promise image proxies. They now can use kSingleUse callback semantics.
This was the only usage of the kDeinstantiate lazy callback type so it is
removed. The DeinstantiateProxyTracker is also no longer required and is
removed.
The GrTexture idle callback mechanism now uses GrReleaseProcHelper, which has
been extended to support chaining multiple callbacks together and an abandon()
method that aborts calling the callback in the destructor. It has been renamed
GrRefCntedCallback to reflect its more general usage.
Bug: skia:8800
Change-Id: I857c9eec57fdf706631a266ec8bea682d6657a7c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/196500
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
In future Ganesh these classes will, respectively, have a RecordingContext and an ImageContext.
Change-Id: I69ced004a2edae5c410e9c00c2de6c0246699caa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197167
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
We had only used this extension in conjunction with
GL_NV_framebuffer_mixed_samples to draw directly to the framebuffer.
However, it's faster and higher quality to just use our own analytic
AA if we can draw directly to the framebuffer.
It might have been interesting to fake mixed samples using
GL_EXT_raster_multisample and PLS together, but those two extensions
don't appear to ever exist together.
Bug: skia:
Change-Id: Iea489cb0e03fc55aa64d3ea7fccc61b539cc461e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197082
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
This reverts commit 49b293a7d5.
Reason for revert: speculative to fix chrome roll
Original change's description:
> Remove (unnecessary?) flush in RenderYUVAToRGBA
>
> I don't think we need a flush here.
>
> Change-Id: I87bf41b491835578e7df9bea4e15ea24dd551c1e
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/196645
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>
TBR=egdaniel@google.com,jvanverth@google.com,robertphillips@google.com
Change-Id: I49305a5a2bcd5fe112b5f55b64511fd05d6c8548
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197305
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
SkCanvas::flush is problematic and we wish to deprecate it. As a first step, this CL begins to remove Skia's internal usage of it.
Ideally clients would use SkSurface::flush and/or GrContext::flush.
Change-Id: I39bb0702f8230134a97961a4ee70833fd5bd0dcc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/196641
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Change-Id: I14b39a77039d26ca5a98310c41d328a7126ee90a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/196621
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Introduce SkStrikeCacheInterface in order to move from a
template a based interface on SkGlyphRunListPainter to
a class based interface.
Change-Id: Ib15e437420c00f4e11242ac1a4d8a87ee2af9ee1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197101
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
GrSurfaceContext was explicitly holding a lot of things it could just get from its GrRecordingContext.
Change-Id: Ia2e9708d71318dc0c101d56aadf5ae797230bc75
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/194360
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
For now this is distinct from kRGBA_F16_SkColorType but treated the
same. Next steps are to see if we can keep it clamped to [0,1].
Switched a few switches away from default to exhaustive.
Took away any explicit SW clamps for now except the one we definitely
want in append_gamut_clamp_if_normalized().
Skip F16Norm in the DDL test because we can't yet distinguish it from
F16.
Change-Id: I021a864fe078e4fa4e2b399982e6c38350e10d74
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/196371
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
I don't think we need a flush here.
Change-Id: I87bf41b491835578e7df9bea4e15ea24dd551c1e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/196645
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Prior to this CL peekProxy could cause the conversion of YUVA planes to RGBA. This switches peekProxy back to just peeking.
In future Ganesh asTextureProxyRef is going to require a GrRecordingContext (bc it can actually do work). The options were to either add a GrRecordingContext parameter to peekProxy or remove its ability to do work (as in this CL).
Change-Id: I42d7dcd41f7c99a7712446d3f6629ffde91bfe5b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197105
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This reverts commit c6671be0ea.
Reason for revert: looks like it didn't help
Original change's description:
> Revert "bring back lowp bilerp_clamp_8888"
>
> This reverts commit 5043c09b8b.
>
> Reason for revert: speculative, to try to unblock android roller
>
> Original change's description:
> > bring back lowp bilerp_clamp_8888
> >
> > PS1-3 are the literal code I removed a few months ago.
> >
> > PS4 adds asserts to make sure we don't underflow.
> > PS5 adds rounding when scaling off bias, reducing diff slightly.
> >
> > Cq-Include-Trybots: luci.chromium.try:linux-blink-rel
> > Change-Id: Ice573395a1680e1c3b55a8fe3e4d034f15adde1b
> > Reviewed-on: https://skia-review.googlesource.com/c/196620
> > Commit-Queue: Mike Klein <mtklein@google.com>
> > Reviewed-by: Brian Osman <brianosman@google.com>
>
> TBR=mtklein@google.com,brianosman@google.com,reed@google.com
>
> # Not skipping CQ checks because original CL landed > 1 day ago.
>
> Change-Id: I816c23c4a12451be518ea3baf4b9a3fdba9b818a
> Cq-Include-Trybots: luci.chromium.try:linux-blink-rel
> Reviewed-on: https://skia-review.googlesource.com/c/196777
> Reviewed-by: Mike Reed <reed@google.com>
TBR=mtklein@google.com,brianosman@google.com,reed@google.com
Change-Id: I0f96a395ac704a52735c93a08f8ed52a148d5de5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Cq-Include-Trybots: luci.chromium.try:linux-blink-rel
Reviewed-on: https://skia-review.googlesource.com/c/196980
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
This reverts commit 5043c09b8b.
Reason for revert: speculative, to try to unblock android roller
Original change's description:
> bring back lowp bilerp_clamp_8888
>
> PS1-3 are the literal code I removed a few months ago.
>
> PS4 adds asserts to make sure we don't underflow.
> PS5 adds rounding when scaling off bias, reducing diff slightly.
>
> Cq-Include-Trybots: luci.chromium.try:linux-blink-rel
> Change-Id: Ice573395a1680e1c3b55a8fe3e4d034f15adde1b
> Reviewed-on: https://skia-review.googlesource.com/c/196620
> Commit-Queue: Mike Klein <mtklein@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
TBR=mtklein@google.com,brianosman@google.com,reed@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Change-Id: I816c23c4a12451be518ea3baf4b9a3fdba9b818a
Cq-Include-Trybots: luci.chromium.try:linux-blink-rel
Reviewed-on: https://skia-review.googlesource.com/c/196777
Reviewed-by: Mike Reed <reed@google.com>
It appears that on macOS 10.13 smoothed subpixel antialiased black glyphs
are blit with a gamma of 2.0, but white are blit with a gamma of ~1.4 with
a smooth trasition between these. In macOS 10.14 smoothed black glyphs are
blit with a gamma of 2.0, but white are blit with a gamma ~1.0 with a
smooth transition between. The reason for this is to tone down the high
dilation of the outlines after autohinting.
In order to render like the platform, emulate this behavior by adjusting
the luminance value used to pick the mask gamma.
Bug: chromium:933137
Change-Id: I02d73c29bee1a3506b43598d78f07a03c968349f
Reviewed-on: https://skia-review.googlesource.com/c/196501
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
PS1-3 are the literal code I removed a few months ago.
PS4 adds asserts to make sure we don't underflow.
PS5 adds rounding when scaling off bias, reducing diff slightly.
Cq-Include-Trybots: luci.chromium.try:linux-blink-rel
Change-Id: Ice573395a1680e1c3b55a8fe3e4d034f15adde1b
Reviewed-on: https://skia-review.googlesource.com/c/196620
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Bug: skia:8793
Change-Id: I1de4bde25f7dcb12175733a3213c43f92410dc4a
Reviewed-on: https://skia-review.googlesource.com/c/196647
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
ARC wasn't kicking in for the renderCmdEncoders -- adding the __strong
keyword seems to be enough of a hint.
Bug: skia:8243
Change-Id: I07e75d355ab89102126ba2134250f0440ecc488c
Reviewed-on: https://skia-review.googlesource.com/c/196652
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Bug: skia:
Change-Id: I5e664939a446616ef57acc79d26a10e6908cda10
Reviewed-on: https://skia-review.googlesource.com/c/196643
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
We haven't updated this since the tagged == linear days.
Bug: skia:8812
Cq-Include-Trybots: luci.chromium.try:linux-blink-rel
Change-Id: I2f67696f37aab410e1b482348ee8b1cf7e7b1697
Reviewed-on: https://skia-review.googlesource.com/c/196622
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Allows us to cache MTLRenderPipelines rather than regenerating them
for every use.
Bug: skia:
Change-Id: I3357d3bc6d644074bd9d544a8d5205af56d918e5
Reviewed-on: https://skia-review.googlesource.com/c/195127
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Prior to this CL, we always used raster-pipeline if the device had a
colorspace. In this CL, we defer to individual shaders to decide if they can still
use the legacy path (onMakeContext).
The motivation is purely performance (and perhaps short-term backwards
compat): the legacy blits are usually faster, so staying in them
(as long as we still draw correctly) is preferable.
Causes some (mostly unimportant) rebaselines, esp. around bilerp, as the
rasterpipeline does a much better (but slower) job of it, and now we will
use the legacy bilerp more often.
Bug: skia:8793
Change-Id: I1e7e482a863a1a09ffef86a87e2aa9a4a8d1b9b5
Reviewed-on: https://skia-review.googlesource.com/c/195888
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
This restores support for sample variables and improves on the
original API.
A test will come once we restore support for sample locations.
Bug: skia:
Change-Id: I350cc08477c532a13ff7acdd8055c0aa65c51d26
Reviewed-on: https://skia-review.googlesource.com/c/195720
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
This reverts commit 24adb3a356.
Reason for revert: fixes SkGpuDevice extraction when running gbr configs in dm.
Original change's description:
> Revert "Add general quad API to SkGpuDevice"
>
> This reverts commit 339e1cc8d4.
>
> Reason for revert: compositor GM breaks dm on windows
>
> Original change's description:
> > Add general quad API to SkGpuDevice
> >
> > Heavily refactors SkGpuDevice's internal texturing code in an attempt
> > to consolidate entry points for drawing an image. Helps lay the ground
> > work for eventually implementing bitmap tiling with per-edge AA.
> >
> > Bug: skia:
> > Change-Id: I9feb86d5315d73119deb21e954c45e45513a63f6
> > Reviewed-on: https://skia-review.googlesource.com/c/191571
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
>
> TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com
>
> Change-Id: I74bc7eb08855dff5535cf809fc47ce6f16d2c15d
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:
> Reviewed-on: https://skia-review.googlesource.com/c/195889
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com
Change-Id: I667eb5b4d1253b050670a64de9f0aa70f4df3a5e
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/196160
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Lights are in [0, 1], so converting to SkColor requires scaling.
Bug: skia:
Change-Id: I54726fa6abcc9a801ae51f4ee2a24c067656effd
Reviewed-on: https://skia-review.googlesource.com/c/196420
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
There's a lot of refactoring here to fix up the
namespace of the JS (see pre/postamble js).
A reviewer can skip all the changes to interface.js,
as they are mostly whitespace changes.
Bug: skia:
Change-Id: I7cedeb98f04d4446ac4dfb555a416f30490b2b94
Reviewed-on: https://skia-review.googlesource.com/c/195885
Reviewed-by: Florin Malita <fmalita@chromium.org>
All math discovered the lazy way through brute force.
Some of it makes sense when you think about it.
Cq-Include-Trybots: luci.chromium.try:linux-blink-rel
Bug: skia:8799
Change-Id: I044b0bf702cf5a5648f5017d58cc7e5d0ac09a7d
Reviewed-on: https://skia-review.googlesource.com/c/196010
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Bug: skia:
Change-Id: I9bab3ff73d3934786d7457c4b1bcf67d01c653f3
Reviewed-on: https://skia-review.googlesource.com/c/196060
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>