Commit Graph

5424 Commits

Author SHA1 Message Date
Greg Daniel
7af060a8bc Add gray_8_as_lum and _as_red private grpixelconfigs
Bug: skia:
Change-Id: I70cbd0bc9f7a7a16fb9f0688d272d7afa607700a
Reviewed-on: https://skia-review.googlesource.com/80622
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-12-07 20:52:40 +00:00
Brian Salomon
384fab467e sk_spification of GrGpu creation.
Make GrContext::MakeGL take interface as sk_sp.

Make GrContext::MakeVulkan take GrVkBackendContext as sk_sp.

Change-Id: I13c22a57bd281c51738f503d9ed3418d35a466df
Reviewed-on: https://skia-review.googlesource.com/81842
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-12-07 17:56:59 +00:00
Brian Salomon
4f5e1d4ff3 Remove SkImage deferred texture image data APIs.
These APIs existed for Chrome. Chrome is no longer using them.

Change-Id: I15a5e2f88c7e8d1356188748fc68d4658f6f1849
Reviewed-on: https://skia-review.googlesource.com/81021
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-12-07 13:13:20 +00:00
Mike Reed
fadbfcd4ab upgrade SkReadBuffer to always validate
Bug: skia:
Change-Id: I054560b66c6cde346d939015326d8547879d2c4b
Reviewed-on: https://skia-review.googlesource.com/81160
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2017-12-06 21:33:00 +00:00
Cary Clark
5104137844 Revert "keep SVG arcs axis aligned"
This reverts commit c382384848.

Reason for revert: need to add legacy flag to chrome first

Original change's description:
> keep SVG arcs axis aligned
> 
> Computing the arc width introduces rounding errors that cause the
> arc to exceed 1/4 circle and cause integer anchored arcs to start
> outside their marks. A round rect may lose convexity as a result.
> 
> Check if arcTo() inputs are integers and arc is 90 degrees;
> if so, output conics which are axis-aligned on integers as well.
> 
> This is triggered when using SVG to represent a round rect.
> 
> Possible future enhancements are recorded in bug.skia.org/7383
> 
> R=​reed@google.com,djsollen@google.com
> Change-Id: I6609456fcefabcda6c9560a044533ecb5cda2d31
> Reviewed-on: https://skia-review.googlesource.com/79423
> Reviewed-by: Derek Sollenberger <djsollen@google.com>
> Commit-Queue: Derek Sollenberger <djsollen@google.com>

TBR=djsollen@google.com,caryclark@google.com,reed@google.com,caryclark@skia.org

Change-Id: Ia503ea62def15322df2b11da30d377a9543d6999
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/81281
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
2017-12-06 20:07:56 +00:00
Mike Klein
0554d497f8 add SkVptr()
I was wondering how feasible using this to make downcasts safe would be.
These tests would need to build and pass on all our bots, at least.

Change-Id: I1753ba58841bf6c17d6ac3af7374518356e1bb05
Reviewed-on: https://skia-review.googlesource.com/81180
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-12-06 19:37:27 +00:00
Cary Clark
c382384848 keep SVG arcs axis aligned
Computing the arc width introduces rounding errors that cause the
arc to exceed 1/4 circle and cause integer anchored arcs to start
outside their marks. A round rect may lose convexity as a result.

Check if arcTo() inputs are integers and arc is 90 degrees;
if so, output conics which are axis-aligned on integers as well.

This is triggered when using SVG to represent a round rect.

Possible future enhancements are recorded in bug.skia.org/7383

R=reed@google.com,djsollen@google.com
Change-Id: I6609456fcefabcda6c9560a044533ecb5cda2d31
Reviewed-on: https://skia-review.googlesource.com/79423
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
2017-12-06 16:50:39 +00:00
Chris Dalton
a3e9271ec4 CCPR: Eliminate texel buffers
Points cost 8 bytes and indices cost 4. If a point is accessed twice,
it's a wash whether we duplicate it or index. This change eliminates
texel buffers by duplicating points across instance arrays. This
reduces our dependence on extensions as well as getting rid of our
indirect memory access pattern in vertex shaders.

As a result of this change, memory usage by GPU buffers will only be a
fraction larger at worst, and slightly better at best.

Bug: skia:
Cq-Include-Trybots: skia.primary:Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-SKNX_NO_SIMD
Change-Id: I3c7f03772edd4f850d5fdd7b55552647335c1b52
Reviewed-on: https://skia-review.googlesource.com/79185
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2017-12-05 21:12:48 +00:00
Mike Reed
60691a5127 add serial procs to pictures
Bug: skia:7380
Change-Id: Ic1b7e437316c7913711cf5cb119e3fe904cd2c05
Reviewed-on: https://skia-review.googlesource.com/76980
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-12-05 20:33:18 +00:00
Leon Scroggins III
c8037dc5ed Reland "Hide SkEncodedInfo"
This partially reverts commit
1793e7bb46.

Hide SkEncodedInfo

Bug: skia:7353
Bug: skia:6839

This contains information that is not necessary for clients to know. The
Color enum tells the number of components in the input, but this is only
interesting internally (to the SkSwizzler).

Similarly, the Alpha enum differs from SkAlphaType in that it has
kBinary instead of kPremul. This is useful information only internally
for determining whether the SkColorSpaceXform needs to premultiply.

The bitsPerComponent is potentially useful for a client; Android (in
SkAndroidCodec) uses it to determine the SkColorType. Rather than
exposing bitsPerComponent, make SkAndroidCodec a friend so it can
access the SkEncodedInfo. A future change will change SkCodec to
recommend F16 for bitsPerComponent > 8, but that will be more involved;
it was the reason for the revert of this CL.

Switch conversionSupported to use an SkColorType, which is enough info.

Replace the SkEncodedInfo::Alpha field on SkCodec::FrameInfo with an
SkAlphaType.

SkCodec still needs an SkEncodedInfo, so move its header (which is
already not SK_API) to include/private.

TBR=mtklein@chromium.org,reed@google.com
Change-Id: I928b1f55317602cb37d29da63b53026c8d139cee
Reviewed-on: https://skia-review.googlesource.com/80860
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2017-12-05 19:28:08 +00:00
Chris Dalton
a32a3c32c3 Add analytic clip FPs that read from the CCPR atlas
Bug: skia:7190
Change-Id: Ie31d368f52910e6917efdeb1b024370b06fc11ee
Reviewed-on: https://skia-review.googlesource.com/77160
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-12-05 18:06:18 +00:00
Brian Salomon
1447177005 Avoid GrEllipseEffect for small radii on devices without 32 bit float.
Also limit small radius bail in GrCircleEffect to clip out cases.

Change-Id: I14ce736969b05203219d68f30283c36c84f78f3a
Reviewed-on: https://skia-review.googlesource.com/80621
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-12-05 15:56:01 +00:00
Leon Scroggins
1793e7bb46 Revert "Hide SkEncodedInfo"
This reverts commit c6f7a4ffa9.

Reason for revert: Causing differences in Gold, stemming from the fact that this changes the recommended SkImageInfo for 16 bits-per-component PNG from N32 to F16.
- an F16 bitmap already png-encodes to a 16 bits-per-component PNG, but it does not encode a linear colorspace (possibly a bug?). when we decode this PNG using getInfo(), it fails because it has an F16 color type and non-linear colorspace. (In the encode-srgb-png gm, this results in blank results for F16.) We could correct this on the encoder side, but it seems possible that a 16 bits-per-component PNG could be encoded with a different color space. In that case, we'd want SkCodec to recommend F16/SRGBLinear, but I think we'd want the SkCodec to store the encoded SkColorSpace so that we can Xform between the two. Currently SkCodec only stores one color space, so that will require a refactor.
- When decoding 16-bits-per-component PNGs, we are now decoding them to F16. This shows differences in Gold. The srgb/gpu results now look more like F16. I think this is fine.

Original change's description:
> Hide SkEncodedInfo
> 
> Bug: skia:7353
> Bug: skia:6839
> 
> This contains information that is not necessary for clients to know. The
> Color enum tells the number of components in the input, but this is only
> interesting internally (to the SkSwizzler).
> 
> Similarly, the Alpha enum differs from SkAlphaType in that it has
> kBinary instead of kPremul. This is useful information only internally
> for determining whether the SkColorSpaceXform needs to premultiply.
> 
> The bitsPerComponent is potentially useful for a client; Android (in
> SkAndroidCodec) uses it to determine the SkColorType. Rather than
> exposing bitsPerComponent, use it to make the same decision that Android
> would have made - 16 bits per component means to set the info to F16. Add
> a test that computeOutputColorType behaves as expected.
> 
> Switch conversionSupported to use an SkColorType, which is enough info.
> 
> Replace the SkEncodedInfo::Alpha field on SkCodec::FrameInfo with an
> SkAlphaType.
> 
> SkCodec still needs an SkEncodedInfo, so move its header (which is
> already not SK_API) to include/private.
> 
> Change-Id: Ie2cf11339bf999ebfd4390c0f448f7edd6feabda
> Reviewed-on: https://skia-review.googlesource.com/79260
> Reviewed-by: Mike Reed <reed@google.com>
> Reviewed-by: Mike Klein <mtklein@chromium.org>
> Commit-Queue: Leon Scroggins <scroggo@google.com>

TBR=mtklein@chromium.org,scroggo@google.com,reed@google.com

Change-Id: I0c5dd1461e1b70d1e55349a8e7ee6b029c3f556e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7353, skia:6839
Reviewed-on: https://skia-review.googlesource.com/80660
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2017-12-05 15:38:22 +00:00
Leon Scroggins III
c6f7a4ffa9 Hide SkEncodedInfo
Bug: skia:7353
Bug: skia:6839

This contains information that is not necessary for clients to know. The
Color enum tells the number of components in the input, but this is only
interesting internally (to the SkSwizzler).

Similarly, the Alpha enum differs from SkAlphaType in that it has
kBinary instead of kPremul. This is useful information only internally
for determining whether the SkColorSpaceXform needs to premultiply.

The bitsPerComponent is potentially useful for a client; Android (in
SkAndroidCodec) uses it to determine the SkColorType. Rather than
exposing bitsPerComponent, use it to make the same decision that Android
would have made - 16 bits per component means to set the info to F16. Add
a test that computeOutputColorType behaves as expected.

Switch conversionSupported to use an SkColorType, which is enough info.

Replace the SkEncodedInfo::Alpha field on SkCodec::FrameInfo with an
SkAlphaType.

SkCodec still needs an SkEncodedInfo, so move its header (which is
already not SK_API) to include/private.

Change-Id: Ie2cf11339bf999ebfd4390c0f448f7edd6feabda
Reviewed-on: https://skia-review.googlesource.com/79260
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2017-12-05 00:52:42 +00:00
Robert Phillips
8d1e67ed6b Add resource cache limits to SkSurfaceCharacterization
Change-Id: I4c3b2f1c6ecc39b2364cefae07d5dee5e3d20d60
Reviewed-on: https://skia-review.googlesource.com/79600
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2017-12-04 18:54:09 +00:00
Robert Phillips
7ffbcf909d Add unit test for SkDeferredDisplayLists (take 2)
Change-Id: I76a4c77d5b9418cb7fe677bd55ba32a2e336924d
Reviewed-on: https://skia-review.googlesource.com/79820
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-12-04 18:37:29 +00:00
Robert Phillips
8172c0a24a Revert "Add unit test for SkDeferredDisplayLists"
This reverts commit 8458a2807b.

Reason for revert: ??
Original change's description:
> Add unit test for SkDeferredDisplayLists
> 
> Change-Id: I015094145cb0af6cfe368c570a5d5280c11c8f28
> Reviewed-on: https://skia-review.googlesource.com/78660
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com

Change-Id: Iec3abb18d3ed41fcfbec72bc2de14603f659f8ce
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/79720
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-12-04 14:38:15 +00:00
Robert Phillips
8458a2807b Add unit test for SkDeferredDisplayLists
Change-Id: I015094145cb0af6cfe368c570a5d5280c11c8f28
Reviewed-on: https://skia-review.googlesource.com/78660
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-12-04 14:00:14 +00:00
Greg Daniel
10ed243e2e Add cap on intel to avoid calling abs and floor on the same line in a
shader.

This fixes a bug on some intel devices where we are failing
in the ProcessorOptimizationTest.

I've tried other "no op" type things between the floor call and abs which
also fixed the issue, as well as adding explicit checks to see if we are
less than -1 or greater than 1 where the clamp is. Thus the clamp itself
should be a no op and shouldn't secretly be fixing the problem outside
of forcing the floor and abs lines to be separate.

Bug: skia:
Change-Id: I85bf82e0e02607b78470b7a5f8f918e9f53f0154
Reviewed-on: https://skia-review.googlesource.com/76820
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-12-02 00:00:59 +00:00
Chris Dalton
0cb75879a5 Add Store3 to Sk2f
Bug: skia:
Change-Id: I0377e6a1dd8259e944f7902a5c68af524fa588c7
Reviewed-on: https://skia-review.googlesource.com/79382
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2017-12-01 21:12:49 +00:00
Cary Clark
afca4d6bc0 fix pathops handling of tiny wrapback quads and cubics
If a quad or cubic reverses on itself, path ops breaks
it in two. It determines the type of curve remaining,
but needs to replace near-zero with zero first.

TBR=reed@google.com
Bug:790731
Change-Id: I3a1afa14fff064ca874b5abc768ec1ec5c2cf22f
Reviewed-on: https://skia-review.googlesource.com/79400
Commit-Queue: Cary Clark <caryclark@google.com>
Reviewed-by: Cary Clark <caryclark@skia.org>
2017-12-01 20:48:40 +00:00
Mike Klein
213d821462 add Load2() to Sk4f
and test it.

Change-Id: Ib0c2cf93c63d8d3c36a7d4d60bbec4ecede29bc7
Reviewed-on: https://skia-review.googlesource.com/78480
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-12-01 19:26:02 +00:00
Chris Dalton
706a6ff60c Add "lazy" texture proxies
Adds ultra-deferred proxies that are instantiated by a user-supplied
callback during flush.

Bug: skia:7190
Change-Id: I75a7ac6dba953c3b0a99febc203a7f4d2f3789fc
Reviewed-on: https://skia-review.googlesource.com/76461
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-11-30 15:37:12 +00:00
Mike Klein
d53f9a1913 bug fix in matrix color filter
The current code for this filter premuls, then clamps.  We should be
clamping, then premulling.

If the matrix makes alpha greater than 1, these two orderings can result
in different color values.  Alpha will clamp to 1 either way, but the
color channels are multiplied by that >1 alpha in one case, and by =1
in the other.

The left column of the gm imagefilterscropexpand demonstrates this.
Its matrix adds 32/255 to alpha and 255/255 to green.  This produces
alpha ~= 1.12.  That's then multiplied by the relatively small red
and blue values in the grey checkerboard, resulting in different
in-range values than the ones we would have gotten if we clamped
alpha first.  Green wasn't affected because it was already fully
saturated.  255 * 1.12 == 255 no matter when we clamp.

Change-Id: I4b30bf64c30fe62526674ad5f32e9ca19ec84714
Reviewed-on: https://skia-review.googlesource.com/77902
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-11-30 14:54:32 +00:00
Brian Salomon
7072e226ab Ignore deserialized path convexity and first direction.
Change-Id: Ib7bfff6225774b83d9b6e9c5baae254aab17353b
Reviewed-on: https://skia-review.googlesource.com/77680
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-11-29 20:38:56 +00:00
Florin Malita
1ba5bfe590 Avoid double-destruction of Sk3DShaderContext-wrapped objects
Sk3DShaderContext creates its nested shader context on a SkArenaAlloc,
which handles destruction when going out of scope.

Hence, the explicit context dtor call in ~Sk3DShaderContext() is
incorrect (likely left over from before SkArenaAlloc).

BUG=chromium:787712

Change-Id: I176222e449151dcce532a839ef9587d06f61d297
Reviewed-on: https://skia-review.googlesource.com/77203
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2017-11-29 02:33:28 +00:00
Chris Dalton
c9c97b7fd5 CCPR: Transform path points before parsing
Transforms a path's points into a local buffer up front, rather than
transforming as we parse. This hopefully gets better vector
performance as well as allowing us to skip the transformation step
for paths that are known to be in device space already.

Introduces a test for parsing empty paths and does general cleanup.

Bug: skia:7190
Change-Id: Ib86d2ffcdef6fa3ec66f6d9ad4b10c0b6d44c0dc
Reviewed-on: https://skia-review.googlesource.com/74621
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2017-11-27 23:17:57 +00:00
Ethan Nicholas
39204fd5dd added SkSL support for all blend mode layouts
Bug: skia:
Change-Id: Id39c068b15d0ae51520dc2169cdbf21402a43f69
Reviewed-on: https://skia-review.googlesource.com/76200
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2017-11-27 18:39:26 +00:00
Mike Klein
c9bc81434a Handle null colorspace in SkToSRGBColorFilter.
This was uncovered by the linked fuzzer issue.

I haven't looked hard at it, but I'd guess it's fuzzed an ICC profile
into one that can't be deserialized, and we get a null in CreateProc().

We could probably restrict the null check to just CreateProc(), but
putting it in Make() and asserting in the constructor feels cozy.

BUG=chromium:787718

Change-Id: Ic4b1dad28c00ee5870f22093eedbf34686c32120
Reviewed-on: https://skia-review.googlesource.com/76080
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Brian Osman <brianosman@google.com>
2017-11-27 18:00:56 +00:00
Brian Salomon
4b0e364f92 Disallow negative radii in deserialized SkRRects
bug= chromium:787124

Change-Id: I232ccd6bdfc2c176f97b97e24eabad6a9ce8e5e2
Reviewed-on: https://skia-review.googlesource.com/73901
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-11-27 14:17:26 +00:00
Ethan Nicholas
e9d172af84 converted ConstColorProcessor to SkSL
Bug: skia:
Change-Id: Ic3b18f82c1ab940637fb26dec1cf376dd859b35d
Reviewed-on: https://skia-review.googlesource.com/73720
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-11-20 20:34:38 +00:00
Greg Daniel
ef59d87ae8 Revert "Revert "Revert "Revert "Revert "Revert "Add private grpixelconfigs for alpha_8 and alpha_half""""""
This reverts commit b092cea5b1.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Revert "Revert "Revert "Revert "Revert "Add private grpixelconfigs for alpha_8 and alpha_half"""""
>
> This reverts commit 68ab18611a.
>
> Reason for revert: Command Buffer bot
>
> Original change's description:
> > Revert "Revert "Revert "Revert "Add private grpixelconfigs for alpha_8 and alpha_half""""
> >
> > This reverts commit 3b2f5b60ff.
> >
> > Reason for revert: more attempts at a fixed version
> >
> > Original change's description:
> > > Revert "Revert "Revert "Add private grpixelconfigs for alpha_8 and alpha_half"""
> > >
> > > This reverts commit b5fb7cf016.
> > >
> > > Reason for revert: breaking more devices
> > >
> > > Original change's description:
> > > > Revert "Revert "Add private grpixelconfigs for alpha_8 and alpha_half""
> > > >
> > > > This reverts commit 0fb6db4be6.
> > > >
> > > > Reason for revert: fixed bug
> > > >
> > > > Original change's description:
> > > > > Revert "Add private grpixelconfigs for alpha_8 and alpha_half"
> > > > >
> > > > > This reverts commit 33d17cbb00.
> > > > >
> > > > > Reason for revert: broke intel bots
> > > > >
> > > > > Original change's description:
> > > > > > Add private grpixelconfigs for alpha_8 and alpha_half
> > > > > >
> > > > > > Bug: skia:
> > > > > > Change-Id: I5191b6e045aea2a5af2b305b5972ad1e638a7ace
> > > > > > Reviewed-on: https://skia-review.googlesource.com/71763
> > > > > > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > > > > > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > > > >
> > > > > TBR=egdaniel@google.com,bsalomon@google.com
> > > > >
> > > > > Change-Id: I6fff9241f7878f1ec7fad2663df9922c9cd8f628
> > > > > No-Presubmit: true
> > > > > No-Tree-Checks: true
> > > > > No-Try: true
> > > > > Bug: skia:
> > > > > Reviewed-on: https://skia-review.googlesource.com/72180
> > > > > Reviewed-by: Greg Daniel <egdaniel@google.com>
> > > > > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > > >
> > > > TBR=egdaniel@google.com,bsalomon@google.com
> > > >
> > > > Change-Id: Ie028961ecbf5934c53cb859e019e548935b3af79
> > > > Reviewed-on: https://skia-review.googlesource.com/72241
> > > > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > > > Reviewed-by: Greg Daniel <egdaniel@google.com>
> > >
> > > TBR=egdaniel@google.com,bsalomon@google.com
> > >
> > > Change-Id: Ieaac3eca2fc4919699c7de61a3c33348e92a7da0
> > > No-Presubmit: true
> > > No-Tree-Checks: true
> > > No-Try: true
> > > Reviewed-on: https://skia-review.googlesource.com/72660
> > > Reviewed-by: Greg Daniel <egdaniel@google.com>
> > > Commit-Queue: Greg Daniel <egdaniel@google.com>
> >
> > TBR=egdaniel@google.com,bsalomon@google.com
> >
> > Change-Id: Ifcf1b97c2a9493ce9a77a8aa0f4e5a8fb393def3
> > Reviewed-on: https://skia-review.googlesource.com/72802
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > Reviewed-by: Greg Daniel <egdaniel@google.com>
>
> TBR=egdaniel@google.com,bsalomon@google.com
>
> Change-Id: Ie2277f59f5a1294392b5d153ce2429c20b3e4182
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/73320
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

TBR=egdaniel@google.com,bsalomon@google.com,brianosman@google.com

Change-Id: Ibba9d2109f35ea710e313d604b3e5ee742916234
Reviewed-on: https://skia-review.googlesource.com/73360
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2017-11-18 13:36:27 +00:00
Brian Osman
b092cea5b1 Revert "Revert "Revert "Revert "Revert "Add private grpixelconfigs for alpha_8 and alpha_half"""""
This reverts commit 68ab18611a.

Reason for revert: Command Buffer bot

Original change's description:
> Revert "Revert "Revert "Revert "Add private grpixelconfigs for alpha_8 and alpha_half""""
> 
> This reverts commit 3b2f5b60ff.
> 
> Reason for revert: more attempts at a fixed version
> 
> Original change's description:
> > Revert "Revert "Revert "Add private grpixelconfigs for alpha_8 and alpha_half"""
> >
> > This reverts commit b5fb7cf016.
> >
> > Reason for revert: breaking more devices
> >
> > Original change's description:
> > > Revert "Revert "Add private grpixelconfigs for alpha_8 and alpha_half""
> > >
> > > This reverts commit 0fb6db4be6.
> > >
> > > Reason for revert: fixed bug
> > >
> > > Original change's description:
> > > > Revert "Add private grpixelconfigs for alpha_8 and alpha_half"
> > > >
> > > > This reverts commit 33d17cbb00.
> > > >
> > > > Reason for revert: broke intel bots
> > > >
> > > > Original change's description:
> > > > > Add private grpixelconfigs for alpha_8 and alpha_half
> > > > >
> > > > > Bug: skia:
> > > > > Change-Id: I5191b6e045aea2a5af2b305b5972ad1e638a7ace
> > > > > Reviewed-on: https://skia-review.googlesource.com/71763
> > > > > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > > > > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > > >
> > > > TBR=egdaniel@google.com,bsalomon@google.com
> > > >
> > > > Change-Id: I6fff9241f7878f1ec7fad2663df9922c9cd8f628
> > > > No-Presubmit: true
> > > > No-Tree-Checks: true
> > > > No-Try: true
> > > > Bug: skia:
> > > > Reviewed-on: https://skia-review.googlesource.com/72180
> > > > Reviewed-by: Greg Daniel <egdaniel@google.com>
> > > > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > >
> > > TBR=egdaniel@google.com,bsalomon@google.com
> > >
> > > Change-Id: Ie028961ecbf5934c53cb859e019e548935b3af79
> > > Reviewed-on: https://skia-review.googlesource.com/72241
> > > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > > Reviewed-by: Greg Daniel <egdaniel@google.com>
> >
> > TBR=egdaniel@google.com,bsalomon@google.com
> >
> > Change-Id: Ieaac3eca2fc4919699c7de61a3c33348e92a7da0
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Reviewed-on: https://skia-review.googlesource.com/72660
> > Reviewed-by: Greg Daniel <egdaniel@google.com>
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> 
> TBR=egdaniel@google.com,bsalomon@google.com
> 
> Change-Id: Ifcf1b97c2a9493ce9a77a8aa0f4e5a8fb393def3
> Reviewed-on: https://skia-review.googlesource.com/72802
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,bsalomon@google.com

Change-Id: Ie2277f59f5a1294392b5d153ce2429c20b3e4182
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/73320
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-11-17 19:15:07 +00:00
Herb Derby
7ceb0b89f4 Remove api call from SkGaussFilter
Simplify the SkGaussFilter API to facilitate using
ranged-for loops.

Change-Id: Id853bd6bfe342ae95b7c6248c459fbf865f75d1e
Reviewed-on: https://skia-review.googlesource.com/73262
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2017-11-17 19:10:16 +00:00
Greg Daniel
68ab18611a Revert "Revert "Revert "Revert "Add private grpixelconfigs for alpha_8 and alpha_half""""
This reverts commit 3b2f5b60ff.

Reason for revert: more attempts at a fixed version

Original change's description:
> Revert "Revert "Revert "Add private grpixelconfigs for alpha_8 and alpha_half"""
>
> This reverts commit b5fb7cf016.
>
> Reason for revert: breaking more devices
>
> Original change's description:
> > Revert "Revert "Add private grpixelconfigs for alpha_8 and alpha_half""
> >
> > This reverts commit 0fb6db4be6.
> >
> > Reason for revert: fixed bug
> >
> > Original change's description:
> > > Revert "Add private grpixelconfigs for alpha_8 and alpha_half"
> > >
> > > This reverts commit 33d17cbb00.
> > >
> > > Reason for revert: broke intel bots
> > >
> > > Original change's description:
> > > > Add private grpixelconfigs for alpha_8 and alpha_half
> > > >
> > > > Bug: skia:
> > > > Change-Id: I5191b6e045aea2a5af2b305b5972ad1e638a7ace
> > > > Reviewed-on: https://skia-review.googlesource.com/71763
> > > > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > > > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > >
> > > TBR=egdaniel@google.com,bsalomon@google.com
> > >
> > > Change-Id: I6fff9241f7878f1ec7fad2663df9922c9cd8f628
> > > No-Presubmit: true
> > > No-Tree-Checks: true
> > > No-Try: true
> > > Bug: skia:
> > > Reviewed-on: https://skia-review.googlesource.com/72180
> > > Reviewed-by: Greg Daniel <egdaniel@google.com>
> > > Commit-Queue: Greg Daniel <egdaniel@google.com>
> >
> > TBR=egdaniel@google.com,bsalomon@google.com
> >
> > Change-Id: Ie028961ecbf5934c53cb859e019e548935b3af79
> > Reviewed-on: https://skia-review.googlesource.com/72241
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > Reviewed-by: Greg Daniel <egdaniel@google.com>
>
> TBR=egdaniel@google.com,bsalomon@google.com
>
> Change-Id: Ieaac3eca2fc4919699c7de61a3c33348e92a7da0
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/72660
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,bsalomon@google.com

Change-Id: Ifcf1b97c2a9493ce9a77a8aa0f4e5a8fb393def3
Reviewed-on: https://skia-review.googlesource.com/72802
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2017-11-17 18:50:46 +00:00
Brian Salomon
55ad774812 Revert "Revert "Add method to sk_gpu_test::TestContext to automatically restore the previous context.""
This reverts commit 1e09e461d2.

Change-Id: I95d5544a7baaa078536790493ce4119816a77e94
Reviewed-on: https://skia-review.googlesource.com/72903
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-11-17 16:22:56 +00:00
Robert Phillips
57e0828fad Add backend GPU objects to fiddle app
TBR=bsalomon@google.com
Change-Id: I8876a4657f837436322150925233e0f36c91e8f0
Reviewed-on: https://skia-review.googlesource.com/72641
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Cary Clark <caryclark@google.com>
2017-11-17 12:53:55 +00:00
Brian Osman
1e09e461d2 Revert "Add method to sk_gpu_test::TestContext to automatically restore the previous context."
This reverts commit 5627d65146.

Reason for revert: Google3

Original change's description:
> Add method to sk_gpu_test::TestContext to automatically restore the previous context.
> 
> The motivation for this is to allow a GM to create a GL context, do some some work in it, and then return to the context that was set when it was invoked.
> 
> Change-Id: Ie8496072a10f8f3ff36a08889e593a6ca961b61a
> Reviewed-on: https://skia-review.googlesource.com/70720
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

TBR=bsalomon@google.com,brianosman@google.com

Change-Id: Ifb79638c9d4500ca3be9a5be39a5ad78b20247c1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/72981
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-11-16 22:31:39 +00:00
Chris Dalton
47c8ed3c06 Reland "Fix precision caps and rrect/ellipse effect precisions"
This is a reland of e421800227
Original change's description:
> Fix precision caps and rrect/ellipse effect precisions
>
> Replaces all the complex precision caps with a single flag that says
> whether "float" == fp32. Updates the ellipse and rrect effects to
> use float coords, and use the scale workaround when float != fp32.
>
> Bug: skia:7190
> Change-Id: Ieccff9f38acd05e5cec78fe90d01a5da901a9307
> Reviewed-on: https://skia-review.googlesource.com/70961
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

TBR=bsalomon@google.com

Bug: skia:7190
Change-Id: I7ced37a64164b83d86f6a957c35e10ce9085aba0
Reviewed-on: https://skia-review.googlesource.com/72760
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2017-11-16 19:29:56 +00:00
Greg Daniel
3b2f5b60ff Revert "Revert "Revert "Add private grpixelconfigs for alpha_8 and alpha_half"""
This reverts commit b5fb7cf016.

Reason for revert: breaking more devices

Original change's description:
> Revert "Revert "Add private grpixelconfigs for alpha_8 and alpha_half""
> 
> This reverts commit 0fb6db4be6.
> 
> Reason for revert: fixed bug
> 
> Original change's description:
> > Revert "Add private grpixelconfigs for alpha_8 and alpha_half"
> >
> > This reverts commit 33d17cbb00.
> >
> > Reason for revert: broke intel bots
> >
> > Original change's description:
> > > Add private grpixelconfigs for alpha_8 and alpha_half
> > >
> > > Bug: skia:
> > > Change-Id: I5191b6e045aea2a5af2b305b5972ad1e638a7ace
> > > Reviewed-on: https://skia-review.googlesource.com/71763
> > > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > > Commit-Queue: Greg Daniel <egdaniel@google.com>
> >
> > TBR=egdaniel@google.com,bsalomon@google.com
> >
> > Change-Id: I6fff9241f7878f1ec7fad2663df9922c9cd8f628
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Bug: skia:
> > Reviewed-on: https://skia-review.googlesource.com/72180
> > Reviewed-by: Greg Daniel <egdaniel@google.com>
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> 
> TBR=egdaniel@google.com,bsalomon@google.com
> 
> Change-Id: Ie028961ecbf5934c53cb859e019e548935b3af79
> Reviewed-on: https://skia-review.googlesource.com/72241
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,bsalomon@google.com

Change-Id: Ieaac3eca2fc4919699c7de61a3c33348e92a7da0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/72660
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-11-16 17:59:33 +00:00
Greg Daniel
b5fb7cf016 Revert "Revert "Add private grpixelconfigs for alpha_8 and alpha_half""
This reverts commit 0fb6db4be6.

Reason for revert: fixed bug

Original change's description:
> Revert "Add private grpixelconfigs for alpha_8 and alpha_half"
>
> This reverts commit 33d17cbb00.
>
> Reason for revert: broke intel bots
>
> Original change's description:
> > Add private grpixelconfigs for alpha_8 and alpha_half
> >
> > Bug: skia:
> > Change-Id: I5191b6e045aea2a5af2b305b5972ad1e638a7ace
> > Reviewed-on: https://skia-review.googlesource.com/71763
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
>
> TBR=egdaniel@google.com,bsalomon@google.com
>
> Change-Id: I6fff9241f7878f1ec7fad2663df9922c9cd8f628
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:
> Reviewed-on: https://skia-review.googlesource.com/72180
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,bsalomon@google.com

Change-Id: Ie028961ecbf5934c53cb859e019e548935b3af79
Reviewed-on: https://skia-review.googlesource.com/72241
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2017-11-16 17:37:12 +00:00
Robert Phillips
eafd48af63 Add overbudget handling to GrResourceAllocator
Change-Id: I5536c908310e907c77b5d55441a0edac6a74bf0e
Reviewed-on: https://skia-review.googlesource.com/71182
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-11-16 16:35:57 +00:00
Brian Salomon
5627d65146 Add method to sk_gpu_test::TestContext to automatically restore the previous context.
The motivation for this is to allow a GM to create a GL context, do some some work in it, and then return to the context that was set when it was invoked.

Change-Id: Ie8496072a10f8f3ff36a08889e593a6ca961b61a
Reviewed-on: https://skia-review.googlesource.com/70720
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2017-11-16 16:30:53 +00:00
Brian Osman
24f9c19172 Revert "Fix precision caps and rrect/ellipse effect precisions"
This reverts commit e421800227.

Reason for revert: Also may be responsible for layout test failures? Playing it safe.

Original change's description:
> Fix precision caps and rrect/ellipse effect precisions
> 
> Replaces all the complex precision caps with a single flag that says
> whether "float" == fp32. Updates the ellipse and rrect effects to
> use float coords, and use the scale workaround when float != fp32.
> 
> Bug: skia:7190
> Change-Id: Ieccff9f38acd05e5cec78fe90d01a5da901a9307
> Reviewed-on: https://skia-review.googlesource.com/70961
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

TBR=egdaniel@google.com,bsalomon@google.com,csmartdalton@google.com,ethannicholas@google.com

Change-Id: Idca2f0390e7a0eb85010255183f2f27332b8d26d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7190
Reviewed-on: https://skia-review.googlesource.com/72540
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-11-16 14:02:23 +00:00
Chris Dalton
e421800227 Fix precision caps and rrect/ellipse effect precisions
Replaces all the complex precision caps with a single flag that says
whether "float" == fp32. Updates the ellipse and rrect effects to
use float coords, and use the scale workaround when float != fp32.

Bug: skia:7190
Change-Id: Ieccff9f38acd05e5cec78fe90d01a5da901a9307
Reviewed-on: https://skia-review.googlesource.com/70961
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-11-16 03:31:45 +00:00
Brian Salomon
dcfca431e3 Use GrContextFactories that produce a single GrContext in unit tests.
This is to alleviate problems due to the command buffer getting bent out of shape when the current
OpenGL context is switched out from under it (because we ran a test with a native GL context). This,
however is not a full solution. More changes will be required to ensure that after running each
command buffer or native test we bind the null context. This does allow us to take a step in that
direction without breaking anything too badly. Moreover, there is no real benefit to reusing a
GrContextFactory.

Modifies DEF_GPUTEST to take GrContextOptions rather than a factory to use. Tests were already using
their own factories anyway.

In tests that use GrContextFactory the factory instance is moved to the inner loop.

Modifies gpucts and skia_test to not use persistent GrContextFactories.

Change-Id: Ie7a36793545c775f2f30653ead6fec93a3d22717
Reviewed-on: https://skia-review.googlesource.com/71861
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-11-15 22:03:07 +00:00
Greg Daniel
0fb6db4be6 Revert "Add private grpixelconfigs for alpha_8 and alpha_half"
This reverts commit 33d17cbb00.

Reason for revert: broke intel bots

Original change's description:
> Add private grpixelconfigs for alpha_8 and alpha_half
> 
> Bug: skia:
> Change-Id: I5191b6e045aea2a5af2b305b5972ad1e638a7ace
> Reviewed-on: https://skia-review.googlesource.com/71763
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,bsalomon@google.com

Change-Id: I6fff9241f7878f1ec7fad2663df9922c9cd8f628
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/72180
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-11-15 20:49:03 +00:00
Vladimir Levin
70fb479ae6 Ensure that removing last extension from GrGLExtension doesn't assert.
This patch fixes an assert that triggers when removing the last
extension in the list, since the index operator goes out of bounds.

Added a test that fails without the code changes and passes with the
changes.

R=bsalomon@chromium.org

Change-Id: I0d561b150899c178f638dde088af773fddf112d9
Reviewed-on: https://skia-review.googlesource.com/72000
Commit-Queue: Vladimir Levin <vmpstr@chromium.org>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-11-15 20:25:42 +00:00
Brian Salomon
559f556d9d Remove support for image load/store
This isn't used and has become a maintenance burden.

Change-Id: I5f3af8f91e5c4f073fe4ea30e0a7f1f61efeea47
Reviewed-on: https://skia-review.googlesource.com/70640
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-11-15 20:06:12 +00:00
Greg Daniel
33d17cbb00 Add private grpixelconfigs for alpha_8 and alpha_half
Bug: skia:
Change-Id: I5191b6e045aea2a5af2b305b5972ad1e638a7ace
Reviewed-on: https://skia-review.googlesource.com/71763
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-11-15 20:02:43 +00:00