Commit Graph

22486 Commits

Author SHA1 Message Date
Robert Phillips
6603a1743e Make SkImage_Base::asTextureProxyRef take a GrRecordingContext parameter
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>
2019-03-05 19:49:40 +00:00
Brian Salomon
9ac0407006 Distinguish between "flushed" and "finished" idle state callbacks on GrTexture.
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>
2019-03-05 19:49:00 +00:00
Brian Salomon
2ca31f8de2 Use GrSurface::setRelease helper that creates ref-counted wrapper
Change-Id: Ic748ee18d6cdf7d7b83a89ad6ec580be96bc305b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197769
Commit-Queue: Robert Phillips <robertphillips@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-03-05 19:43:55 +00:00
Chris Dalton
ff8065c2d2 Make sure to apply the stencil settings for GrDashOp
Bug: skia:8807
Change-Id: I0389d4836382aac289732effb41221e84978cc66
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197789
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-03-05 18:23:03 +00:00
Herb Derby
d3898b987d Have SkGlyphRunListPainter close over SkStrikeCacheInterface
Change-Id: I7b07cc7f7fc4335fd614b45c7d19bdefe55fe8e8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197165
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-03-05 16:47:45 +00:00
Ben Wagner
68efb2122d Clarify ownership of typefaces in implementation.
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>
2019-03-05 16:20:45 +00:00
Ethan Nicholas
a70693b234 Add support for runtime color filters written in SkSL.
Bug: skia:
Change-Id: I9b930e81cff1c656908125dcf900279f73570204
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/195581
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-03-05 16:03:25 +00:00
Florin Malita
6041d315c7 Reland "SkMixerColorFilter GPU impl"
This reverts commit c2949ec67b.

Reason for revert: not related to crossfade

Original change's description:
> Revert "SkMixerColorFilter GPU impl"
> 
> This reverts commit e80f7eb9d6.
> 
> Reason for revert: break crossfade in chrome roll?
> 
> Original change's description:
> > SkMixerColorFilter GPU impl
> > 
> > Bug: skia:
> > Change-Id: Ia1e25e0c99737d9720c17f92f0d76a1cb7897ea8
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/193163
> > Commit-Queue: Florin Malita <fmalita@chromium.org>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> 
> TBR=bsalomon@google.com,ethannicholas@google.com,fmalita@chromium.org,reed@google.com
> 
> Change-Id: Ib9464fcabc649b95ba131146690d6208af728436
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197760
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=bsalomon@google.com,ethannicholas@google.com,fmalita@chromium.org,reed@google.com

Change-Id: Ie96e80e153aeab16c4ea35d5f1350372060228aa
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197763
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-03-05 15:03:34 +00:00
Mike Reed
c2949ec67b Revert "SkMixerColorFilter GPU impl"
This reverts commit e80f7eb9d6.

Reason for revert: break crossfade in chrome roll?

Original change's description:
> SkMixerColorFilter GPU impl
> 
> Bug: skia:
> Change-Id: Ia1e25e0c99737d9720c17f92f0d76a1cb7897ea8
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/193163
> Commit-Queue: Florin Malita <fmalita@chromium.org>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

TBR=bsalomon@google.com,ethannicholas@google.com,fmalita@chromium.org,reed@google.com

Change-Id: Ib9464fcabc649b95ba131146690d6208af728436
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197760
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-03-05 14:45:08 +00:00
Mike Reed
c9273997fd Reland "check if we can use legacy blits"
This reverts commit 2b28b1c12d.

Reason for revert: hmmm, maybe not

Original change's description:
> Revert "check if we can use legacy blits"
> 
> This reverts commit 5539390c53.
> 
> Reason for revert: broke chrome roll?
> 
> Original change's description:
> > check if we can use legacy blits
> > 
> > depends on https://skia-review.googlesource.com/c/skia/+/196647
> > 
> > Bug: skia:
> > Change-Id: I85ea7aac34558838d120c2c02abaaeebd77d8b8a
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/196651
> > Reviewed-by: Mike Klein <mtklein@google.com>
> > Commit-Queue: Mike Reed <reed@google.com>
> 
> TBR=mtklein@google.com,brianosman@google.com,reed@google.com
> 
> Change-Id: Ib05f310e428145ffb79c27a077c8c31ef937487e
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197658
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=mtklein@google.com,brianosman@google.com,reed@google.com

Change-Id: I14180cd0025a33a3c9c3cd8a1652e4a6cf8be141
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197659
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-03-05 14:42:56 +00:00
Mike Reed
2b28b1c12d Revert "check if we can use legacy blits"
This reverts commit 5539390c53.

Reason for revert: broke chrome roll?

Original change's description:
> check if we can use legacy blits
> 
> depends on https://skia-review.googlesource.com/c/skia/+/196647
> 
> Bug: skia:
> Change-Id: I85ea7aac34558838d120c2c02abaaeebd77d8b8a
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/196651
> Reviewed-by: Mike Klein <mtklein@google.com>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=mtklein@google.com,brianosman@google.com,reed@google.com

Change-Id: Ib05f310e428145ffb79c27a077c8c31ef937487e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197658
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-03-05 14:40:05 +00:00
Brian Osman
fbe9fa73f5 Remove dithering during SkConvertPixels
Now that https://chromium-review.googlesource.com/c/chromium/src/+/1495208
has landed, this is safe to land.

Bug: b/124403051 skia:8787
Change-Id: I087cd2313343229176a1814c2097dbe8f77620cc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/195886
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-03-05 14:23:22 +00:00
Jim Van Verth
6e8174e957 Fix issue with offsetting polygon by 0 distance.
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>
2019-03-05 14:06:02 +00:00
Brian Salomon
1c1c666382 Default implementation of onSetRelease() on GrSurface
Change-Id: I96ca2a8372d0748b56d5048ea294d7e2be80d22a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197040
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-03-05 13:24:52 +00:00
Brian Salomon
b2c5dae65d Simplify promise image lazy instantiation callbacks.
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>
2019-03-05 13:18:22 +00:00
Robert Phillips
920d488d5f Lay some groundwork for depowering SkGpuDevice's and SkImage_GpuBase's context pointer
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>
2019-03-05 13:14:32 +00:00
Mike Reed
5539390c53 check if we can use legacy blits
depends on https://skia-review.googlesource.com/c/skia/+/196647

Bug: skia:
Change-Id: I85ea7aac34558838d120c2c02abaaeebd77d8b8a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/196651
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-03-05 11:49:02 +00:00
Florin Malita
e80f7eb9d6 SkMixerColorFilter GPU impl
Bug: skia:
Change-Id: Ia1e25e0c99737d9720c17f92f0d76a1cb7897ea8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/193163
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-03-05 11:35:47 +00:00
Chris Dalton
4c56b03cfd Drop support for GL_EXT_raster_multisample
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>
2019-03-05 11:35:21 +00:00
Mike Reed
fbc887df72 Revert "Remove (unnecessary?) flush in RenderYUVAToRGBA"
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>
2019-03-05 02:47:38 +00:00
Robert Phillips
9882dae24d Reduce usage of SkCanvas::flush
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>
2019-03-04 22:09:39 +00:00
Florin Malita
390f9bd8ba Fix handling of SkSL nullable FPs
Bug: skia:8798
Change-Id: Iec311c9d834a6f35b0a4481dbd748532107cd4b1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197108
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-03-04 22:09:20 +00:00
Mike Klein
5ece363ff4 mark lowp TODOs
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>
2019-03-04 22:04:32 +00:00
Herb Derby
0f27b5ee2b Introduce SkStrikeCacheInterface
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>
2019-03-04 21:59:30 +00:00
Greg Daniel
b6c15babd5 Add API for creating SkImage from AHB while uploading data to it.
Bug: skia:
Change-Id: I893b511450df7f15bdde202fe01ce223ea2294a9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/195366
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-03-04 21:59:12 +00:00
Robert Phillips
0d075de863 Clean up GrSurfaceContext's relationship with GrRecordingContext
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>
2019-03-04 21:54:05 +00:00
Mike Klein
b70990eda4 add kRGBA_F16Norm_SkColorType
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>
2019-03-04 21:49:07 +00:00
Robert Phillips
49b293a7d5 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>
2019-03-04 21:49:03 +00:00
Robert Phillips
193c421f2f Remove peekProxy's side-effect behavior
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>
2019-03-04 21:38:54 +00:00
Mike Reed
5800f2e8a9 Reland "use colorspace steps to determine legacy blits"
This reverts commit c945f0e31a.

Reason for revert: looks like this did not help

Original change's description:
> Revert "use colorspace steps to determine legacy blits"
> 
> This reverts commit 0919852526.
> 
> Reason for revert: speculative: unblock android roll
> 
> Original change's description:
> > use colorspace steps to determine legacy blits
> > 
> > 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>
> 
> TBR=mtklein@google.com,brianosman@google.com,reed@google.com
> 
> Change-Id: I79a21df9a3c3a9f3127f57131feff0f3e417e642
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:8793
> Reviewed-on: https://skia-review.googlesource.com/c/196774
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=mtklein@google.com,brianosman@google.com,reed@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: skia:8793
Change-Id: I2b70c6e3763bf27112b54ed0d0611a6addc755b9
Reviewed-on: https://skia-review.googlesource.com/c/196981
Reviewed-by: Mike Reed <reed@google.com>
2019-03-03 22:13:00 +00:00
Mike Reed
cf27e74da0 Reland "bring back lowp bilerp_clamp_8888"
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>
2019-03-03 22:12:24 +00:00
Mike Reed
c6671be0ea 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>
2019-03-03 13:06:40 +00:00
Mike Reed
c945f0e31a Revert "use colorspace steps to determine legacy blits"
This reverts commit 0919852526.

Reason for revert: speculative: unblock android roll

Original change's description:
> use colorspace steps to determine legacy blits
> 
> 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>

TBR=mtklein@google.com,brianosman@google.com,reed@google.com

Change-Id: I79a21df9a3c3a9f3127f57131feff0f3e417e642
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:8793
Reviewed-on: https://skia-review.googlesource.com/c/196774
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-03-02 17:52:34 +00:00
Ben Wagner
c025aa9638 Adjust luminance gamma for Mac.
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>
2019-03-02 03:55:47 +00:00
Mike Klein
5043c09b8b 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>
2019-03-02 03:55:46 +00:00
Mike Reed
0919852526 use colorspace steps to determine legacy blits
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>
2019-03-02 03:50:43 +00:00
Jim Van Verth
841d654844 Fix memory leak in Metal.
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>
2019-03-02 03:50:40 +00:00
Greg Daniel
bae712104d Add flush call to take access type, flags, and semaphore.
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>
2019-03-02 03:45:36 +00:00
Mike Klein
656281b793 update high-contrast color filter for tagged SW destinations
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>
2019-03-01 18:47:29 +00:00
Ian McKellar
947e5e437f Clean up SkFontMgr_fuchsia.cpp after FIDL API change
This cleans up some changes made in:
https://skia-review.googlesource.com/c/179994

Bug: skia:
Change-Id: I813f44578fd6dcd0da8a3ec3a877f307c6e36093
Reviewed-on: https://skia-review.googlesource.com/c/196504
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-03-01 16:56:19 +00:00
Jim Van Verth
1223e7fc0a Add GrMtlPipelineStateCache.
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>
2019-03-01 14:48:59 +00:00
Chris Dalton
906430d4b4 Make GrMesh compatible with instanced draws that have no attribs
Bug: skia:
Change-Id: Ia366e20608670df34ab2db3966f5beaa23242592
Reviewed-on: https://skia-review.googlesource.com/c/196162
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-02-28 23:19:22 +00:00
Mike Reed
011d166d37 Move responsibility to onMakeContext for device colorspace decision
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>
2019-02-28 22:50:02 +00:00
Chris Dalton
d31b5e7489 Revert "Drop unused shader support for sample variables"
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>
2019-02-28 21:19:22 +00:00
Brian Salomon
7d88f310a9 Remove support for SkDeferredDisplayListRecorder::DelayReleaseCallback::kNo.
Bug: skia:8800
Change-Id: I39d1ac62ab9a0d4f987c23de96c644aa9b2fa70e
Reviewed-on: https://skia-review.googlesource.com/c/196161
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-02-28 19:02:20 +00:00
Michael Ludwig
1433cfd7c4 Reland "Add general quad API to SkGpuDevice"
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>
2019-02-28 18:44:20 +00:00
Brian Osman
57a06e24d6 Fix scaling error in SkLights::makeColorSpace
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>
2019-02-28 18:30:01 +00:00
Kevin Lubick
f5ea37f981 [canvaskit] Support image assets for Skottie
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>
2019-02-28 15:56:09 +00:00
Mike Klein
1c94143772 round when writing lowp 565 or 4444
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>
2019-02-27 21:48:51 +00:00
Mike Reed
31cc6d7917 utility to check if floats are [0...1]
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>
2019-02-27 21:43:31 +00:00