Commit Graph

4932 Commits

Author SHA1 Message Date
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
Brian Osman
9f6f41b01b 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>
2017-06-01 15:28:07 +00:00
Mike Klein
5cc9da6bbc raster pipeline sprite blitter
The color in the unit test turned out to be right on the edge
of not round tripping well, and I guess rounding pushed it over
the edge, so I've tweaked it to a new one that seems better.

Change-Id: I46095fafc9d6b68fd417ff9dc32003f42929c5a5
Reviewed-on: https://skia-review.googlesource.com/18238
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-06-01 15:02:08 +00:00
Robert Phillips
8bf1f9ffcf Disable deferred proxies for M60 branch
Bug: 720325
Change-Id: I0529bbcd592bdc5d5a741731af8a66971e485649
Reviewed-on: https://skia-review.googlesource.com/18239
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-05-31 23:12:39 +00:00
Chris Dalton
1d6163577c Add support for instanced draws
Adds an instance buffer to GrMesh and instance attribs to
GrPrimitiveProcessor. Implements support in GL and Vulkan. Adds unit
tests for instanced rendering with GrMesh.

Bug: skia:
Change-Id: If1a9920feb9366f346b8c37cf914713c49129b3a
Reviewed-on: https://skia-review.googlesource.com/16200
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2017-05-31 20:40:20 +00:00
Ethan Nicholas
d9fe700672 fix incorrect variable not assigned error in skslc
Bug: skia:
Change-Id: Id89db8acb0b14024b79b00d98d32f9c10f019537
Reviewed-on: https://skia-review.googlesource.com/18121
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-05-31 19:04:56 +00:00
Herb Derby
84dcac3292 Add aarch64 tail code.
Change-Id: I25f029604a04f5fc6c249a3817b0dd84379071be
Reviewed-on: https://skia-review.googlesource.com/18149
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-05-30 22:04:31 +00:00
Herb Derby
f81c56f3c0 Add arm tail code.
CQ_INCLUDE_TRYBOTS=skia.primary:Test-Android-Clang-Nexus10-CPU-Exynos5250-arm-Release-Android

Change-Id: Ia0e9f32d0324e66c9d4812dbb156a2b858d49a13
Reviewed-on: https://skia-review.googlesource.com/18127
Commit-Queue: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-05-30 19:39:44 +00:00
Chris Dalton
114a3c0b2b Fix glDrawRangeElements
Adds explicit min/max index value fields to GrMesh. This eliminates the
previous assumption that the index values were within the range
[0..vertexCount-1]. In the pattern case we still maintain this
assumption.

Updates GrMesh to hide its fields and handle its new complexity using a
"helper" interface instead.

Adds a unit test for GrMesh.

Bug: skia:
Change-Id: Ia23de72d510f8827cee56072b727fb70a6e46b8d
Reviewed-on: https://skia-review.googlesource.com/17964
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2017-05-30 16:02:36 +00:00
Robert Phillips
bb581ce30f Convert DstTexture to DstProxy (take 2)
The last GrTexture-based TextureSampler::reset call must be removed before the TextureSamplers can become purely GrTextureProxy-backed

Reland of: https://skia-review.googlesource.com/c/16908/ (Convert DstTexture to DstProxy)

Split out of: https://skia-review.googlesource.com/c/10484/ (Omnibus: Push instantiation of GrTextures later (post TextureSampler))

Change-Id: I3a497b6a950fad899f23882c0a9552894ef640f8
Reviewed-on: https://skia-review.googlesource.com/17205
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-05-29 19:26:26 +00:00
Robert Phillips
9bee2e5894 Revise system for checking for uninstantiated proxies
The new pattern is:
  we will "instantiate" pipelines at flush time
  at flush time we will only access the backing GrSurface by peeking

  If instantiation fails we should never try to access the GrSurfaces


Change-Id: I87f7ff41bd0e84d9ca3dbdd61d3361d3d4ceefd6
Reviewed-on: https://skia-review.googlesource.com/17932
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-05-29 17:04:51 +00:00
Herb Derby
d1f08302aa Add tests for tail handling in SkJumper.
Change-Id: Ib4ecc33dc9552c16b5530359cd3649487e70bbed
Reviewed-on: https://skia-review.googlesource.com/18067
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2017-05-26 20:41:04 +00:00
Brian Osman
988adb495d Reduce tree depth on iOS too
Bug: skia:6627
Change-Id: Ib92b62bf1191170a46e63f61fa9502ca2f9ee771
Reviewed-on: https://skia-review.googlesource.com/18072
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-05-26 20:40:22 +00:00
Brian Osman
4e1868c7f7 Really work around iOS varying limit in GLPrograms test
Bug: skia:6627
Change-Id: I80142f5288e1c6f59f6add3a5a71ab90da90d3cc
Reviewed-on: https://skia-review.googlesource.com/18069
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-05-26 20:01:31 +00:00
Derek Sollenberger
5480a18d87 Add method to GrContext to purge unlocked resources.
Beyond setting the total cache limits this method enables clients to
request to purge a specific number of bytes, as well as specify their
preference to purge scratch resources over resources of other types.

Change-Id: I9259d5544d34251575d77eebe599388f213ff3ce
Reviewed-on: https://skia-review.googlesource.com/17987
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
2017-05-26 18:14:33 +00:00
Herb Derby
e7ba8b05d2 Add tail handling for SSE* to SkJumper.
Change-Id: Icb9d385333082de2f99b7a25cfd7251717e3f663
Reviewed-on: https://skia-review.googlesource.com/17580
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Herb Derby <herb@google.com>
2017-05-25 20:42:08 +00:00
Stephen White
6eca90fea6 GrTessellator: fix for three edges becoming collinear after splitting.
In rare cases, a single edge can become collinear with two adjacent
neighbour edges after it's split. The solution is to continue to merge
until no collinear edges are found.

BUG=722000

Change-Id: Ia5dd212b7acfb40ed1d6c74ebfa9e4a4746fe40a
Reviewed-on: https://skia-review.googlesource.com/17963
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2017-05-25 19:33:17 +00:00
Florin Malita
4aed13889b Reland of SkShaderBase
Introduce a private base class (SkShaderBase), to hide
implementation details from the public interface (SkShader).

Change-Id: Ib1d76cde880bd51868b97408710f8bb38128e536
Reviewed-on: https://skia-review.googlesource.com/17925
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2017-05-25 14:59:07 +00:00
Robert Phillips
3b3307f2b1 Disable MSAA for Intel GPUs and re-enable GrSurfaceRenderability test
This CL replaces: https://skia-review.googlesource.com/c/17710/ (Re-enable GrSurfaceRenderability test)

Change-Id: I5626e4fc3581cd2b17fe0f0ad3a9e9bc35b7aa4c
Reviewed-on: https://skia-review.googlesource.com/17764
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-05-25 13:40:16 +00:00
Mike Klein
c998f733e3 make sure to_srgb maps 1 to 1
CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Release-SK_CPU_LIMIT_SSE2,Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Release-SK_CPU_LIMIT_SSE41,Test-Android-Clang-Nexus10-CPU-Exynos5250-arm-Release-Android,Test-Android-Clang-PixelC-CPU-TegraX1-arm64-Release-Android,Test-Android-Clang-Ci20-CPU-IngenicJZ4780-mipsel-Release-Android

BUG=skia:6678,skia:6683

Change-Id: I217084fa0a11ad661a8751f0c3b1cade5cc52473
Reviewed-on: https://skia-review.googlesource.com/17902
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-05-25 13:25:47 +00:00
Florin Malita
d93e11ceb4 Revert "SkShaderBase"
This reverts commit 58a756435c.

Reason for revert: g3, Android borkage.

Original change's description:
> SkShaderBase
> 
> Introduce a private base class (SkShaderBase), to hide
> implementation details from the public interface (SkShader).
> 
> Change-Id: If3ec26ca6abc9da20e3f139c11fdc023bdd85176
> Reviewed-on: https://skia-review.googlesource.com/17241
> Commit-Queue: Florin Malita <fmalita@chromium.org>
> Reviewed-by: Mike Reed <reed@google.com>
> 

TBR=mtklein@google.com,fmalita@chromium.org,reed@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I32b012ee466dd006c074593f211f43ed602f1078
Reviewed-on: https://skia-review.googlesource.com/17845
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2017-05-24 21:15:57 +00:00
Florin Malita
58a756435c SkShaderBase
Introduce a private base class (SkShaderBase), to hide
implementation details from the public interface (SkShader).

Change-Id: If3ec26ca6abc9da20e3f139c11fdc023bdd85176
Reviewed-on: https://skia-review.googlesource.com/17241
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
2017-05-24 19:56:15 +00:00
Florin Malita
14a6430b7b SkSTArenaAlloc
Syntactic sugar, gets rid of some boilerplate.

Change-Id: Ibdb28b7a8f1d5e4a4e18c12d423b987d7194e340
Reviewed-on: https://skia-review.googlesource.com/17837
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
2017-05-24 19:20:45 +00:00
Mike Reed
176f19cce5 Use rasterpipeline for drawVertices
Bug: skia:
Change-Id: If6da119ee98f26981cef9373162ddb526db77be5
Reviewed-on: https://skia-review.googlesource.com/17422
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Klein <mtklein@google.com>
2017-05-24 18:43:05 +00:00
Derek Sollenberger
ee47914ae5 Add GrContext API to report the number of purgeable bytes in the cache.
Change-Id: I1457eec9831736f386e3b3b80d9eac8dbb337a9b
Reviewed-on: https://skia-review.googlesource.com/17829
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
2017-05-24 17:08:45 +00:00
Mike Klein
b24704d35f SkRasterPipeline in SkArenaAlloc
Bug: skia:6673

Change-Id: Ia2bae4f6a9039a007a10b6b45bcf2f0854bf6e5c
Reviewed-on: https://skia-review.googlesource.com/17794
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-05-24 14:54:15 +00:00
Brian Salomon
d17b4a678b Revert "Revert "Add a flag to GrSurfaceFlags that requires the texture to be cleared upon creation. ""
This reverts commit a9e795eab5.

Bug: skia:
Change-Id: Ibfc51497ae99f332f8f72a799393a1b2996f7f3f
Reviewed-on: https://skia-review.googlesource.com/17767
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-05-23 21:38:38 +00:00
Brian Salomon
a9e795eab5 Revert "Add a flag to GrSurfaceFlags that requires the texture to be cleared upon creation. "
This reverts commit 45e5068a6d.

Reason for revert: :'(

Original change's description:
> Add a flag to GrSurfaceFlags that requires the texture to be cleared upon creation. 
> 
> Bug: chromium:656320
> 
> Change-Id: I940bfa24540516ab83a2ed52f761b96eb6ad19f1
> Reviewed-on: https://skia-review.googlesource.com/17391
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> 

TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Bug: chromium:656320

Change-Id: I8a4f71537e45f3c4cf37b10b2dc8ee38fe6959ba
Reviewed-on: https://skia-review.googlesource.com/17765
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-05-23 19:03:01 +00:00
Brian Salomon
45e5068a6d Add a flag to GrSurfaceFlags that requires the texture to be cleared upon creation.
Bug: chromium:656320

Change-Id: I940bfa24540516ab83a2ed52f761b96eb6ad19f1
Reviewed-on: https://skia-review.googlesource.com/17391
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-05-23 18:07:25 +00:00
Leon Scroggins III
557fbbe05b Add animation support to SkWebpCodec
TBR=reed@google.com
(No change to the public API, but changed a header file)

SkWebpCodec:
- Implement onGetFrameCount, onGetFrameInfo, and onGetRepetitionCount
- Respect the alpha reported by libwebp. Although the spec states that
  it is only a hint, the libwebp encoder uses it properly. Respecting
  allows us to draw opaque images faster and decode them to 565. This
  also matches other SkCodecs (and Chromium).
- onGetPixels:
  - Decode the frame requested, recursively decoding required frame if
    necessary
  - When blending with a prior frame, use SkRasterPipeline

SkCodec:
- Move check for negative index to getFrameInfo
- Reset the colorXform if one is not needed

SkCodecAnimation:
- Add new blend enum, for WebP's (and APNG's) non-blending option

SkFrameHolder:
- New base classes for frames and the owner of the frames, allowing
  code sharing between SkWebpCodec and SkGifCodec (particularly for
  determining whether a frame has alpha and what frame it depends on)
- When moving items from SkGIFFrameContext, use Skia conventions (i.e.
  int instead of unsigned)
- Rename "delay time" to "duration", to match e.g. SkFrameInfo::
  fDuration

SkGifImageReader:
- Move pieces to SkFrameHolder, and adapt to changes made in the
  process
- Make setAlphaAndRequiredFrame (now on the base class SkFrameHolder)
  more general to support webp, and add support for frames that do not
  blend
- Change SkGIFFrameContext from a struct to a class, to match how we
  use the distinction elsewhere (i.e. struct is a small object with
  public fields)
- Rework hasTransparentPixel (now hasTransparency, since it returns true
  in some cases where there is not a transparent pixel) to better fit
  with the modified setAlphaAndRequiredFrame. Also be more consistent
  when there is no transparent pixel but no color map.
- Simplify an if condition that was previously simplified in 2d61e717
  but accidentally got reverted in a4db9be6

CodecAnimTest:
- Test new animated webp files
- Rearrange the test to more cleanly print alpha type mismatches for
  the first frame

resources:
- webp-animated.webp
  - animated webp from Chromium
- blendBG.webp
  - new webp file using bits of webp-animated-semitransparent4.webp
    from Chromium
  - tests required frame and alpha when using the non-blending mode
  - frames have the following properties:
    - Frame 0: no alpha, fills screen
    - Frame 1: alpha, fills screen
    - Frame 2: no alpha, fills screen
    - Frame 3: alpha, fills screen, blendBG
    - Frame 4: no alpha, fills screen, blendBG
    - Frame 5: alpha, blendBG
    - Frame 6: covers 4, has alpha, blendBG
  - also used to test decoding to 565 if the new frame data has alpha
    but blends onto an opaque frame

DM.cpp:
- Test animated images to non-native 8888 and unpremul

DMSrcSink.cpp:
- Do not test non-native 8888 decodes to f16 dst
- Test unpremul decodes to f16
- Copy a frame of an animated image prior to drawing, since in unpremul
  mode, the DM code will premultiply first.

Bug: skia: 3315
Change-Id: I4e55ae2ee5bc095b37a743bdcfac644be603b980
Reviewed-on: https://skia-review.googlesource.com/16707
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
2017-05-23 15:28:37 +00:00
Robert Phillips
92de631edd Remove compressed (ETC1) texture support from Ganesh (take 2)
Reland of https://skia-review.googlesource.com/c/17456/ (Remove compressed (ETC1) texture support from Ganesh) but w/o removing third_part\etc1 files

TBR=bsalomon@google.com
Change-Id: I8ec4b7e3ddf47d213cb24c382731c050ffb8847f
Reviewed-on: https://skia-review.googlesource.com/17700
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-05-23 12:45:21 +00:00
Greg Daniel
79cdf28c51 Fix to lcd blending in ganesh
This fixes the bug where a src color may originally be opaque but after
blending it is no longer opaque. We need to know the opacity after the
blend so this restricts us on which blend modes even work this way.

Bug: skia:
Change-Id: Ib3208887d718e5f25272ed7b0bf44683d04884d7
Reviewed-on: https://skia-review.googlesource.com/17488
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-05-22 20:35:17 +00:00
Brian Osman
bc262e110a Revert "Remove compressed (ETC1) texture support from Ganesh"
This reverts commit ee26363aaa.

Reason for revert: Failing Google 3 roll.

Original change's description:
> Remove compressed (ETC1) texture support from Ganesh
> 
> Change-Id: If4cf286df87ea87338aba47001d90a5fcc4f2667
> Reviewed-on: https://skia-review.googlesource.com/17456
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> 

TBR=bsalomon@google.com,robertphillips@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: Ie1a57187287e03600a69e374501478e93c41415c
Reviewed-on: https://skia-review.googlesource.com/17527
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-05-22 20:14:50 +00:00
Brian Salomon
7128fdd82d Remove kZeroCopy_GrSurfaceFlag
Change-Id: I2869f97a14f3a1363ebfef5d657bd6468fc991f7
Reviewed-on: https://skia-review.googlesource.com/17491
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-05-22 18:50:58 +00:00
Robert Phillips
ee26363aaa Remove compressed (ETC1) texture support from Ganesh
Change-Id: If4cf286df87ea87338aba47001d90a5fcc4f2667
Reviewed-on: https://skia-review.googlesource.com/17456
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-05-22 18:02:52 +00:00
Robert Phillips
b7b7e5fba0 Add fixes & test for isConfigTexturable and isConfigRenderable
This CL fixes:
  isConfigTexturable was returning true for:
            kRG_float for ANGLE ES2 configs
  isConfigRenderable was returning true for:
            kAlpha_8 for ANGLE ES2 configs
  isConfigTexturable and isConfigRenderable were returning true for:
            SBGRA on ES2
  The NexusPlayer was marking RGBA & RG float configs as renderable but not textureable

Bug: 720325

Change-Id: If21361870dbdde8f3e09bc9dff3a394f2a329157
Reviewed-on: https://skia-review.googlesource.com/17387
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-05-22 17:55:48 +00:00
Matt Sarett
2f68787783 SkWebpEncoder: use bgra for lossless and yuv for lossy
Previosuly, we would (accidentally) always use just yuv.

Bug: 713862
Change-Id: I00acc6ca2841ba0636494119b7b4f46a9deee401
Reviewed-on: https://skia-review.googlesource.com/17406
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
2017-05-19 23:35:46 +00:00
Greg Daniel
6ebe4b9dbe Fix gpu lcd blending to semi-correctly handle alpha coverage
Bug: skia:6606
Change-Id: I16ccd97f5d047eb7fddfed5310bf669e7435ccdd
Reviewed-on: https://skia-review.googlesource.com/17370
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-05-19 17:20:33 +00:00
Brian Salomon
bb5711a5e4 Remove GrSurfaceDesc member from GrSurfaceProxy.
Stores the config, origin, and dimensions in GrSurfaceProxy, sample count in GrRenderTargetProxy, and "was constructed with mip maps" in GrTextureProxy.

Change-Id: Iee058674dce49107a991cca9d083cd33e3572809
Reviewed-on: https://skia-review.googlesource.com/17209
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-05-17 18:17:50 +00:00
Ethan Nicholas
4b330dfd33 skslc comma operator and optimizer fixes
Bug: skia:
Change-Id: I732d4fba843c06af570d4a56cadfaa1cc565808c
Reviewed-on: https://skia-review.googlesource.com/17125
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
2017-05-17 15:22:05 +00:00
Robert Phillips
c375704a20 Revert "Convert DstTexture to DstProxy"
This reverts commit 87f7f1c3ce.

Reason for revert: grumble, grumble

Original change's description:
> Convert DstTexture to DstProxy
> 
> The last GrTexture-based TextureSampler::reset call must be removed before the TextureSamplers can become purely GrTextureProxy-backed
> 
> Split out of: https://skia-review.googlesource.com/c/10484/ (Omnibus: Push instantiation of GrTextures later (post TextureSampler))
> 
> Change-Id: Ic1435177d8b5d9bd3fc38b4903c9baae8205cfb0
> Reviewed-on: https://skia-review.googlesource.com/16908
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> 

TBR=egdaniel@google.com,robertphillips@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I9af52bb222bd2d8cc696250a9efb62afb80edba1
Reviewed-on: https://skia-review.googlesource.com/17203
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-05-17 13:00:27 +00:00
Robert Phillips
87f7f1c3ce Convert DstTexture to DstProxy
The last GrTexture-based TextureSampler::reset call must be removed before the TextureSamplers can become purely GrTextureProxy-backed

Split out of: https://skia-review.googlesource.com/c/10484/ (Omnibus: Push instantiation of GrTextures later (post TextureSampler))

Change-Id: Ic1435177d8b5d9bd3fc38b4903c9baae8205cfb0
Reviewed-on: https://skia-review.googlesource.com/16908
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-05-17 12:17:03 +00:00
Matt Sarett
d5a16911bb Add support for webp lossless compression
Bug: 713862
Change-Id: I8dcc6506338f3c54fb14a78620e7daaadadfedde
Reviewed-on: https://skia-review.googlesource.com/17073
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2017-05-17 02:24:29 +00:00