Commit Graph

4974 Commits

Author SHA1 Message Date
Greg Daniel
b54bdef86e Go back to using dual source blending for lcd src-over even with non-opaque color
This is change is currently still safe since earlier in Skia we are still requiring
the dst to be opaque. The change is a workaround to spots where trying to read the
dst to do in shader blending is failing for some reason. This also should give back
a little performance since doing dual source blending should be better than shader
blends.

Bug: chromium:732341
Change-Id: I795f8a520f87f3fbf5d63a9509fbd9f394ea2b29
Reviewed-on: https://skia-review.googlesource.com/19703
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-06-14 15:13:58 +00:00
Chris Dalton
3809bab7ed Add GrPrimitiveType::kLinesAdjacency
Converts GrPrimitiveType to an enum class and adds kLinesAdjacency.

Bug: skia:
Change-Id: I3b5e68acfb20476f6c6923968f5a4ac4f73ae12d
Reviewed-on: https://skia-review.googlesource.com/19680
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2017-06-13 18:18:23 +00:00
Robert Phillips
646e4293f0 Retract GrTexture*.h & GrRenderTarget*.h from other headers
This does push some additional work (& includes) into the .cpp files.

Change-Id: I27c847e371802270d13594dcc22aae44039990bb
Reviewed-on: https://skia-review.googlesource.com/19660
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-06-13 17:21:41 +00:00
Ravi Mistry
7cd974fc7d Revert "Add GrPrimitiveType::kLinesAdjacency"
This reverts commit f7eb015083.

Reason for revert: Looks like this is causing build failures:
* https://chromium-swarm.appspot.com/task?id=36baaf4d376bbf10&refresh=10
* https://chromium-swarm.appspot.com/task?id=36baad1f17e93510&refresh=10


Original change's description:
> Add GrPrimitiveType::kLinesAdjacency
> 
> Converts GrPrimitiveType to an enum class and adds kLinesAdjacency.
> 
> Bug: skia:
> Change-Id: If57d26277182aac1375e8181211ddaf7ea6d1e0a
> Reviewed-on: https://skia-review.googlesource.com/19581
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>

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

Change-Id: I37a1c575123b357abd8b9af9eea8871fe199f44b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/19661
Reviewed-by: Ravi Mistry <rmistry@google.com>
Commit-Queue: Ravi Mistry <rmistry@google.com>
2017-06-13 14:45:32 +00:00
Chris Dalton
f7eb015083 Add GrPrimitiveType::kLinesAdjacency
Converts GrPrimitiveType to an enum class and adds kLinesAdjacency.

Bug: skia:
Change-Id: If57d26277182aac1375e8181211ddaf7ea6d1e0a
Reviewed-on: https://skia-review.googlesource.com/19581
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2017-06-13 14:25:21 +00:00
Leon Scroggins III
1f6af6baad Consolidate decoding frames into SkCodec
Add a new private method to SkCodec that handles Options.fFrameIndex:
- Check to ensure the index is valid
- Call onGetFrameCount to force parsing the stream
- Recursively call getPixels (it should be complete, so no need for
  incremental decoding) to decode the prior frame if necessary
- Zero fill a RestoreBGColor frame

Call the method in getPixels and startIncrementalDecode, and remove
duplicate code from GIF and WEBP.

Remove support for scaling frames beyond the first, which is currently
unused.

Preserve the feature of SkGifCodec that it will only parse to the end
of the first frame if the first frame is asked for. (Also note that
when we continue a partial frame, we won't force parsing the full
stream.) If the client only wants the first frame, parsing the rest
would be unnecessary. But if the client wants the second, we assume
they will want any remaining frames, so we parse the remainder of the
stream. This simplifies the code (so SkCodec does not have to ask its
subclass to parse up to a particular frame).

Update tests that relied on the old behavior:
- Codec_partialAnim now hardcodes the bytes needed. Previously it
  relied on the old behavior that GIF only parsed up to the frame being
  decoded.
- Codec_skipFullParse now only tests the first frame, since that is the
  case where it is important to skip a full parse.

TBR=reed@google.com
No changes to the public API.

Change-Id: Ic2f075452dfeedb4e3e60e6cf4df33ee7bd38495
Reviewed-on: https://skia-review.googlesource.com/19276
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2017-06-12 20:55:59 +00:00
Eric Karl
7a8c84c6c9 Reland DeferredTextureImageData low-bit-depth/dithering support
Cause DeferredTextureImageData functionality to support low bit depth
(4444, 565) image formats (with dithering).

Updated to handle colorspace + 4444 colortype correctly.

Bug: 720105
Change-Id: Ib7e14d937849f4f6b08fda6992a240bb203d0089
Reviewed-on: https://skia-review.googlesource.com/19094
Commit-Queue: Eric Karl <ericrk@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-06-12 18:27:48 +00:00
Matt Sarett
b6759dd16e Revert "Revert "Disable F16-nullptr sources""
This relands the original change with a modification.  We should
not check for non-null pixels because this breaks the Android
hw bitmap use case.

Bug: b/62482405
Change-Id: I081412bb46754d33b69e02e5754f04a082e081ae
Reviewed-on: https://skia-review.googlesource.com/19494
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
2017-06-12 18:09:03 +00:00
Stephen White
e3a0be73a6 GrTessellator: fix two NaN issues.
If a point in the path rounds to +inf/-inf, the intersection code can
produce NaN, which is unsortable. Fix: ignore non-finite intersections.

Quadratic interpolation can sometimes produce NaN, which will never
satisfy the flatness criterion. Abort if any of the interpolated points
are non-finite.

Bug:732023
Change-Id: If5881796e589c75b8f74459f42d00918619713a2
Reviewed-on: https://skia-review.googlesource.com/19467
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2017-06-12 17:44:23 +00:00
Robert Phillips
db4062038c Re-enable deferred proxies in Chrome
Change-Id: I6dad0c1d3ff9f81e13625988b00c3f844128d7e7
Reviewed-on: https://skia-review.googlesource.com/19446
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-06-12 15:59:47 +00:00
Ethan Nicholas
b310fd597f fixed issue with SkSL dead code elimination
Bug: skia:6747
Change-Id: I8566f0f6822a452167079cca004730ec0db318a8
Reviewed-on: https://skia-review.googlesource.com/19275
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-06-12 14:32:40 +00:00
Matt Sarett
69d1469654 Revert "Disable F16-nullptr sources"
Manual revert: failing ui rendering cts tests

Bug: b/62482405
Change-Id: I652ec8dce482d303437835a27c50a22248afd955
Reviewed-on: https://skia-review.googlesource.com/19360
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2017-06-09 19:29:13 +00:00
Robert Phillips
d9d84858bf Retract GrTexture.h a bit
This began as cleaning up SkSpecialImage.h & spiraled out of control from there.

Change-Id: I9a570ecd2a7af9ee724ebfebe4e9185748f38bbc
Reviewed-on: https://skia-review.googlesource.com/19290
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-06-09 17:29:09 +00:00
Stephen White
019f6c0bcf GrTessellator: fix logging; fix test comment.
Change-Id: Iaded9025a1518d8c69dbe366deb1035e0bd4295b
Reviewed-on: https://skia-review.googlesource.com/19289
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2017-06-09 17:24:04 +00:00
Yuqian Li
d0dbee6559 Add comments support for PNG encoder
Bug: skia:6689
Change-Id: I6ccac8890f44724ccd6e20c8f4ea80bc99f9fa58
Reviewed-on: https://skia-review.googlesource.com/19080
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Yuqian Li <liyuqian@google.com>
2017-06-09 17:24:03 +00:00
Chris Dalton
febbffad1c Improve cubic KLM accuracy
Moves cubic root finding logic out of GrPathUtils and
PathOpsCubicIntersectionTest, and unifies it in SkGeometry.

"Normalizes" the homogeneous parameter values of the roots, rather
than the cubic inflection function. Does this normalization by
twiddling the exponents instead of division (which causes a loss of
precision).

Abandons the built-in derivatives in GrCubicEffect. These don't have
high enough precision on many mobile gpus. Instead we pass the KLM
matrix to the vertex shader via uniform, where we can use it to set up
new linear functionals from which the fragment shader can calculate
the gradient of the implicit function.

Bug: skia:4410
Change-Id: Ibd64e999520adc8cdef7803a492d3699995aef5a
Reviewed-on: https://skia-review.googlesource.com/19017
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2017-06-09 17:13:54 +00:00
Robert Phillips
fee2b4ed0f Create a new HDC for each ANGLE context
Bug: skia:6711
Change-Id: I9c4720a8dbad4c6b18efe73e0e61afbdc19627bc
Reviewed-on: https://skia-review.googlesource.com/19090
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-06-09 00:39:00 +00:00
Robert Phillips
eb4f186779 Disable ReadPixels_Texture & ReadPixels_Gpu on ANGLE
Depends on https://skia-review.googlesource.com/c/19101/ (Store context type (rather than backend type) in ContextInfo)

Bug: skia:6742
Change-Id: I321c01838acf93ad28a17d8e97aa1bf594425502
Reviewed-on: https://skia-review.googlesource.com/19077
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-06-08 21:07:37 +00:00
Robert Phillips
cdabbcc3b5 Store context type (rather than backend type) in ContextInfo
Change-Id: I7dbfb735f1f094fa0a025b84f69e06a3533f2815
Reviewed-on: https://skia-review.googlesource.com/19101
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-06-08 20:29:44 +00:00
Stephen White
0cb31675f3 GrTessellator: fix intersection above the first vertex.
Handle the case where the an intersection falls not only above both
edge endpoints, but above the first vertex in the mesh. This requires
passing the mesh into check_for_intersection(), in order to modify the
head. We also need to rewind the mesh after insertion, since we need
to rewind to the newly-inserted vertex.

This also cleans up vertex ID computation a little (for logging), so
that vertices before the first vertex or after the last have a
reasonable ID. It also cleans up the intersection-on-endpoint 
special cases by refactoring the calls to split_edge().

BUG=730687

Change-Id: Idea736eca7b7c3c5d8a470b1373a16ad8e649e80
Reviewed-on: https://skia-review.googlesource.com/19069
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2017-06-08 20:07:04 +00:00
Matt Sarett
dc79270101 Draw time color xform API for Android
Will do a lazy color xform to the dst color space at GPU upload time.

I've included the capability to control the gen id of the output
image.  This will allow us to reuse images in the Ganesh cache.
This should only be temporary.  When Android is able to cache the
actual SkImage object, we won't need to expose this anymore.

Bug: b/62347704
Change-Id: I93b950ef680f6bbdd7eb6a2ec6f50195dbb78311
Reviewed-on: https://skia-review.googlesource.com/16440
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Yuqian Li <liyuqian@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2017-06-08 19:07:54 +00:00
Matt Sarett
d21fd4b336 Disable F16-nullptr sources
Also includes the refactor that triggered this change - stricter
checking on creation on raster SkImages.

Bug: skia:
Change-Id: Ie3216ac3f5307de4b78792b472676faa51e5459d
Reviewed-on: https://skia-review.googlesource.com/19040
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2017-06-08 14:05:39 +00:00
Brian Salomon
7fbeb5acdd Revert "Revert "Revert "DeferredTextureImageData low-bit-depth/dithering support"""
This reverts commit 840ff8837b.

Reason for revert: Not obvious to me how to fix, reverting the chrome CL that was dependent on this.

Original change's description:
> Revert "Revert "DeferredTextureImageData low-bit-depth/dithering support""
> 
> This reverts commit d7c681d6a7.
> 
> Reason for revert: New param already used in Chrome
> 
> Original change's description:
> > Revert "DeferredTextureImageData low-bit-depth/dithering support"
> > 
> > This reverts commit 2c075e749d.
> > 
> > Reason for revert: Breaking tests. e.g.: https://chromium-swarm.appspot.com/task?id=369dc44f62ce9510&refresh=10
> > 
> > Original change's description:
> > > DeferredTextureImageData low-bit-depth/dithering support
> > > 
> > > Cause DeferredTextureImageData functionality to support low bit depth
> > > (4444, 565) image formats (with dithering).
> > > 
> > > Bug: 720105
> > > Change-Id: Ie3b5768ebc393d9b0a5322461c722bf37c80b791
> > > Reviewed-on: https://skia-review.googlesource.com/18945
> > > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > > Commit-Queue: Eric Karl <ericrk@chromium.org>
> > 
> > TBR=bsalomon@google.com,ericrk@chromium.org
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Bug: 720105
> > 
> > Change-Id: I07aec722425efc62bc54f82cee9a19a9bf339f7b
> > Reviewed-on: https://skia-review.googlesource.com/19039
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Commit-Queue: Brian Salomon <bsalomon@google.com>
> 
> TBR=bsalomon@google.com,reviews@skia.org,ericrk@chromium.org
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: 720105
> 
> Change-Id: I91e690d0564f04209a2bd677de9ae9eb9c0f90d3
> Reviewed-on: https://skia-review.googlesource.com/19041
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

TBR=bsalomon@google.com,reviews@skia.org,ericrk@chromium.org
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 720105

Change-Id: I63eb0051964ce99e187b4e4943ea79bc22d392d2
Reviewed-on: https://skia-review.googlesource.com/19046
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-06-08 14:02:20 +00:00
Brian Salomon
840ff8837b Revert "Revert "DeferredTextureImageData low-bit-depth/dithering support""
This reverts commit d7c681d6a7.

Reason for revert: New param already used in Chrome

Original change's description:
> Revert "DeferredTextureImageData low-bit-depth/dithering support"
> 
> This reverts commit 2c075e749d.
> 
> Reason for revert: Breaking tests. e.g.: https://chromium-swarm.appspot.com/task?id=369dc44f62ce9510&refresh=10
> 
> Original change's description:
> > DeferredTextureImageData low-bit-depth/dithering support
> > 
> > Cause DeferredTextureImageData functionality to support low bit depth
> > (4444, 565) image formats (with dithering).
> > 
> > Bug: 720105
> > Change-Id: Ie3b5768ebc393d9b0a5322461c722bf37c80b791
> > Reviewed-on: https://skia-review.googlesource.com/18945
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Commit-Queue: Eric Karl <ericrk@chromium.org>
> 
> TBR=bsalomon@google.com,ericrk@chromium.org
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: 720105
> 
> Change-Id: I07aec722425efc62bc54f82cee9a19a9bf339f7b
> Reviewed-on: https://skia-review.googlesource.com/19039
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

TBR=bsalomon@google.com,reviews@skia.org,ericrk@chromium.org
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 720105

Change-Id: I91e690d0564f04209a2bd677de9ae9eb9c0f90d3
Reviewed-on: https://skia-review.googlesource.com/19041
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-06-08 13:32:30 +00:00
Brian Salomon
d7c681d6a7 Revert "DeferredTextureImageData low-bit-depth/dithering support"
This reverts commit 2c075e749d.

Reason for revert: Breaking tests. e.g.: https://chromium-swarm.appspot.com/task?id=369dc44f62ce9510&refresh=10

Original change's description:
> DeferredTextureImageData low-bit-depth/dithering support
> 
> Cause DeferredTextureImageData functionality to support low bit depth
> (4444, 565) image formats (with dithering).
> 
> Bug: 720105
> Change-Id: Ie3b5768ebc393d9b0a5322461c722bf37c80b791
> Reviewed-on: https://skia-review.googlesource.com/18945
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Eric Karl <ericrk@chromium.org>

TBR=bsalomon@google.com,ericrk@chromium.org
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 720105

Change-Id: I07aec722425efc62bc54f82cee9a19a9bf339f7b
Reviewed-on: https://skia-review.googlesource.com/19039
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-06-08 13:03:50 +00:00
Mike Reed
cde9031a5a remove unused xfermode methods
Bug: skia:
Change-Id: Ib0dfa7bbf3d4e73aab355df4d5f5e2a53f653809
Reviewed-on: https://skia-review.googlesource.com/19035
Reviewed-by: Mike Reed <reed@google.com>
2017-06-08 03:57:48 +00:00
Florin Malita
d1aeddeb8a Remove SkLinearGradient::kForce4fContext_PrivateFlag
... and related tests/gms.

We now exercise the 4f impl with raster-pipeline/burst, no need for a
special test flag.

Change-Id: If67684d2d8840b3c413db9eeebb051f59cbc5a34
Reviewed-on: https://skia-review.googlesource.com/19025
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2017-06-07 20:24:51 +00:00
Eric Karl
2c075e749d DeferredTextureImageData low-bit-depth/dithering support
Cause DeferredTextureImageData functionality to support low bit depth
(4444, 565) image formats (with dithering).

Bug: 720105
Change-Id: Ie3b5768ebc393d9b0a5322461c722bf37c80b791
Reviewed-on: https://skia-review.googlesource.com/18945
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Eric Karl <ericrk@chromium.org>
2017-06-07 20:19:46 +00:00
Leon Scroggins III
33deb7ed4d Make SkCodec more flexible about its required frame
SkCodec sets fRequiredFrame to be the earliest possible frame that a
given frame can depend on. e.g.

- Frame A fills the screen, Keep
- Frame B does not cover A, Keep
- Frame C covers B but not A, and is opaque

Frame C can depend on either A or B. SkCodec already reports that C
depends on A. This CL allows a client of SkCodec to use either A or
B to create C.

Also expose the DisposalMethod. Since any frame between A and C can
be used to create C except for DisposePrevious frames, the client
needs to be able to know the disposal method so they do not try to
use such a frame to create C.

Further, the disposal method can be used to give the client a better
idea whether they will continue to need a frame. (e.g. if frame i is
DisposePrevious and depends on i-1, the client may not want to steal
i-1 to create i, since i+1 may also depend on i-1.)

TODO: Share code for decoding prior frames between GIF and WEBP

Change-Id: I91a5ae22ba3d8dfbe0bde833fa67ae3da0d81ed6
Reviewed-on: https://skia-review.googlesource.com/13722
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Chris Blume <cblume@chromium.org>
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2017-06-07 20:15:17 +00:00
Chris Dalton
46983b7dd8 Introduce dynamic pipeline state
Adds a DynamicState struct to GrPipeline that has a field for the
scissor rect. Eventually this should become the only way to specify a
scissor rectangle and may grow to contain more fields. Adds an array of
DynamicStates to GrGpuCommandBuffer::draw and implements support in GL
and Vulkan.

Bug: skia:
Change-Id: If5aebbf9da5d192acf7e68e7def4674ffc7ec310
Reviewed-on: https://skia-review.googlesource.com/18510
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2017-06-07 18:26:11 +00:00
Leon Scroggins III
91f0f7332f Fix alpha issues in SkGifCodec
- Call conversion_possible with the proper alpha type for the frame.
- Always use kUnpremul for the transform. Previously we used the alpha
  type for the first frame. If it was opaque and a later frame was not,
  this would be incorrect.

Also fix Codec_frames test. Most of the tests were not running due to
a return statement in a loop. Change that to continue, and correct
errors in the test. Provide better debugging information.

Change-Id: Icd40c09526b1d599168bfe90d93d8ddcdd9ca20f
Reviewed-on: https://skia-review.googlesource.com/18935
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2017-06-07 15:43:07 +00:00
Mike Reed
89c8fecb62 move SkPathRef.h into private
Bug: skia:
Change-Id: I3370c594301ae833ec1fe3cb16ac544e5b2128e8
Reviewed-on: https://skia-review.googlesource.com/18982
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-06-07 15:24:46 +00:00
Chris Dalton
348060fa82 Fix GrReducedClip.cpp: assertion failure surrounding tiny query bounds
Some assertions cannot be relied upon due to FP error.

Bug: skia:5990
Change-Id: I32445b320b9100ae2f80d2f762707d823da77805
Reviewed-on: https://skia-review.googlesource.com/18602
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2017-06-05 19:53:06 +00:00
Leon Scroggins III
12a4dc985b Defend against ICOs with large BMPs embedded
If the ICO reports that it has a large BMP file embedded, do not
crash if we attempt to allocate too much memory.

Bug: b/38116746
Change-Id: I70eb66f5e4ffc15587007b398bbe843665eae500
Reviewed-on: https://skia-review.googlesource.com/18447
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2017-06-05 18:28:19 +00:00
Robert Phillips
67d52cf0d8 sk_sp-ify GrResourceProvider some more
I believe this addresses the concerns of this particular bug (although more remains to be done)

Bug: skia:5327
Change-Id: Ie82f08f87b3cf3d7986fe4eeb16a5d2553173913
Reviewed-on: https://skia-review.googlesource.com/18599
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-06-05 18:07:05 +00:00
Brian Salomon
28207df02b Make GrSimpleMeshDrawOpHelper record whether coverage can be implemented as alpha
This also makes the blend table entry for opaque src over indicate a blend of (1, ISA) rather than (1, 0) to match the actual implementation of the global src-over XP.
Change-Id: I1b1f64d2546e4f0cf03c0239ce674d1baad655f6
Reviewed-on: https://skia-review.googlesource.com/18521
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-06-05 16:47:45 +00:00
Robert Phillips
eee4d6e4e8 Make instantiate return a Boolean
From an off-line conversation:
The longer term idea will be to create a helper class isolates the
ability to instantiate proxies until flush time. The peek* methods
could then be moved to GrSurfaceProxy.

Change-Id: I8e8c02c098475b77d515791c0d6b81f7e4a327dd
Reviewed-on: https://skia-review.googlesource.com/18076
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-06-05 14:03:10 +00:00
Mike Klein
bba02c2031 start on SkJumper lowp mode
Just 3 stages implemented so far:

  load_8888
  swap_rb
  store_8888

That's enough to make the shortest non-trivial pipeline
that you see in the new unit test.

Change-Id: Iabf90866ab452f7183d8c8dec1405ece2db695dc
Reviewed-on: https://skia-review.googlesource.com/18458
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
2017-06-04 22:50:14 +00:00
Brian Salomon
e23bffd65b Remove support in GPU backend for distance vector field.
Also, remvoes SkNormalBevelSource as this was the last use case for the distance vector field.

Change-Id: Ib0176c78e500e6b5130310934253a75860245812
Reviewed-on: https://skia-review.googlesource.com/18482
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-06-02 19:44:18 +00:00
Robert Phillips
e4d45bf5ba Remove accessRenderTarget call from Clear tests
In the split-opList world the full screen clear optimization no longer relies on the rendertarget ID.

Change-Id: Ifc7bf10753355a18507998e30f9de7e8c1eb57c1
Reviewed-on: https://skia-review.googlesource.com/18497
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-06-02 19:21:37 +00:00
Ethan Nicholas
b4dc419f0b Re-land "Fixed an issue with sksl variable declarations"
This reverts commit affa6a3da8.

Bug: skia:
Change-Id: I5864830e31acbf786f3ea7ae91f42f10aae6d855
Reviewed-on: https://skia-review.googlesource.com/18459
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-06-02 15:11:19 +00:00
Ethan Nicholas
affa6a3da8 Revert "Fixed an issue with sksl variable declarations"
This reverts commit 88bd8edcff.

Reason for revert: unhappy bots

Original change's description:
> Fixed an issue with sksl variable declarations
> 
> There was an issue where multiple variables defined in the same
> declaration were not being sequenced appropriately during analysis, so
> 'int x = 0, y = x + 1' would report that x was undefined.
> 
> Bug: skia:
> Change-Id: I882f7e216467306f6a6013a0a34aac30a4c60744
> Reviewed-on: https://skia-review.googlesource.com/18313
> Reviewed-by: Chris Dalton <csmartdalton@google.com>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
> 

TBR=csmartdalton@google.com,ethannicholas@google.com
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Change-Id: Ibc68674289dce70b6173a347a0e78bb0f1e6db1b
Reviewed-on: https://skia-review.googlesource.com/18457
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2017-06-02 13:57:39 +00:00
Ethan Nicholas
88bd8edcff Fixed an issue with sksl variable declarations
There was an issue where multiple variables defined in the same
declaration were not being sequenced appropriately during analysis, so
'int x = 0, y = x + 1' would report that x was undefined.

Bug: skia:
Change-Id: I882f7e216467306f6a6013a0a34aac30a4c60744
Reviewed-on: https://skia-review.googlesource.com/18313
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-06-02 13:23:36 +00:00
Brian Osman
48c9919335 Expand texturability testing to cover mip-mapped textures, and fix iOS
Don't allow creation of mip-mapped textures when caps says we don't
support mip-mapping.

Skip testing of mip-mapped resources in the resource size test,
when creation will fail.

For iOS devices with ES2, the APPLE BGRA8888 extension is more
trouble than it's worth. Even though it lets the internal and
external formats not match, it appears that the driver remembers
the first external format, so subsequent attempts to upload with
the other swizzle will fail. Up until now, creation of these
textures was failing anyway, so now just make it more explicit
that we don't support BGRA in this situation.

Now that we're testing our TexStorage path, fix a few other problems
that showed  up:
- Command Buffer doesn't like extension formats.
- X86 PowerVR and Adreno devices don't like BGRA.

Re-land of   : https://skia-review.googlesource.com/18382
Re-re-land of: https://skia-review.googlesource.com/18261

BUG=skia:

Change-Id: Ie12793549a6807300d6ece68cd6b92495e85c3fe
Reviewed-on: https://skia-review.googlesource.com/18403
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-06-02 13:12:17 +00:00
Robert Phillips
18166eeaf2 Omnibus: Push instantiation of GrTextures later (post TextureSampler)
Split into:
   https://skia-review.googlesource.com/c/10485/ (More GrSurfaceProxy-clean up)
   https://skia-review.googlesource.com/c/15819/ (Expand GrTextureProxy to handle highestFilterMode)
   https://skia-review.googlesource.com/c/16714/ (Switch ImageStorageAccess over to GrTextureProxies)
   https://skia-review.googlesource.com/c/16908/ (Convert DstTexture to DstProxy)

Change-Id: I6cf3ba0f3bf0e1908d36749bc83571c066ddd568
Reviewed-on: https://skia-review.googlesource.com/10484
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-06-02 11:46:40 +00:00
Brian Osman
842a560470 Revert "Expand texturability testing to cover mip-mapped textures, and fix iOS"
This reverts commit c2b5175e99.

Reason for revert: Nexus 5

Original change's description:
> Expand texturability testing to cover mip-mapped textures, and fix iOS
> 
> Don't allow creation of mip-mapped textures when caps says we don't
> support mip-mapping.
> 
> Skip testing of mip-mapped resources in the resource size test,
> when creation will fail.
> 
> For iOS devices with ES2, the APPLE BGRA8888 extension is more
> trouble than it's worth. Even though it lets the internal and
> external formats not match, it appears that the driver remembers
> the first external format, so subsequent attempts to upload with
> the other swizzle will fail. Up until now, creation of these
> textures was failing anyway, so now just make it more explicit
> that we don't support BGRA in this situation.
> 
> Re-land of: https://skia-review.googlesource.com/18261
> 
> BUG=skia:
> 
> Change-Id: I910ffab0aa735647dce910d9054696c385f94933
> Reviewed-on: https://skia-review.googlesource.com/18382
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>
> 

TBR=bsalomon@google.com,robertphillips@google.com,brianosman@google.com
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
BUG=skia:

Change-Id: I8f0fd87678cc584ad37b2a93a859bd4ef38c8092
Reviewed-on: https://skia-review.googlesource.com/18401
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-06-01 18:00:41 +00:00
Brian Osman
c2b5175e99 Expand texturability testing to cover mip-mapped textures, and fix iOS
Don't allow creation of mip-mapped textures when caps says we don't
support mip-mapping.

Skip testing of mip-mapped resources in the resource size test,
when creation will fail.

For iOS devices with ES2, the APPLE BGRA8888 extension is more
trouble than it's worth. Even though it lets the internal and
external formats not match, it appears that the driver remembers
the first external format, so subsequent attempts to upload with
the other swizzle will fail. Up until now, creation of these
textures was failing anyway, so now just make it more explicit
that we don't support BGRA in this situation.

Re-land of: https://skia-review.googlesource.com/18261

BUG=skia:

Change-Id: I910ffab0aa735647dce910d9054696c385f94933
Reviewed-on: https://skia-review.googlesource.com/18382
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-06-01 17:11:42 +00:00
Mike Klein
761d27c4d7 update SkRasterPipeline::run() to also take y
y isn't used yet.  This is just a warmup that updates the callers.

Change-Id: I78f4f44e2b82f72b3a39fa8a8bdadef1d1b8a99e
Reviewed-on: https://skia-review.googlesource.com/18381
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-06-01 17:05:13 +00:00
Brian Osman
c674e26950 Revert "Expand texturability testing to cover mip-mapped textures, and fix iOS"
This reverts commit 9f6f41b01b.

Reason for revert: Command Buffer and ANGLE failures.

Original change's description:
> Expand texturability testing to cover mip-mapped textures, and fix iOS
> 
> Don't allow creation of mip-mapped textures when caps says we don't
> support mip-mapping.
> 
> Skip testing of mip-mapped resources in the resource size test,
> when creation will fail.
> 
> For iOS devices with ES2, the APPLE BGRA8888 extension is more
> trouble than it's worth. Even though it lets the internal and
> external formats not match, it appears that the driver remembers
> the first external format, so subsequent attempts to upload with
> the other swizzle will fail. Up until now, creation of these
> textures was failing anyway, so now just make it more explicit
> that we don't support BGRA in this situation.
> 
> BUG=skia:
> 
> Change-Id: Ic2e3ba1673398d542edd46a555ef47b5d0979c01
> Reviewed-on: https://skia-review.googlesource.com/18261
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> 

TBR=bsalomon@google.com,robertphillips@google.com,brianosman@google.com
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
BUG=skia:

Change-Id: I68f6bb3be9fbafa7366ef5611a12e372274aa648
Reviewed-on: https://skia-review.googlesource.com/18380
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-06-01 16:22:44 +00:00
Florin Malita
69270fbb2b Add smartptr SkRWBuffer snapshot methods
Change-Id: Id816a38213a86bf090230ebaaef00d98a9487965
Reviewed-on: https://skia-review.googlesource.com/18266
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2017-06-01 16:00:45 +00:00