Commit Graph

8075 Commits

Author SHA1 Message Date
Robert Phillips
f2ec024c44 Make use of the buffer data null hint a GrContextOption
TBR=bsalomon@google.com
Change-Id: I5a3fd18479ca8c95e1bc8c087c28346264049eb0
Reviewed-on: https://skia-review.googlesource.com/111604
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2018-03-02 12:11:05 +00:00
Greg Daniel
a17729f36b Add ctor to GrVkAlloc
TBR=bsalomon@google.com

Bug: skia:
Change-Id: I7b4b372674df6ff43f737ac1b3f2f63b87719b6a
Reviewed-on: https://skia-review.googlesource.com/111660
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-03-02 01:15:34 +00:00
Hal Canary
ee08b4a2e9 SkString: remove externally unused ::setUTF16() from API
Moved to SkStringUtils in src/

Change-Id: I026e3a325570bbf34e90797d921cb2f05b9a29f6
Reviewed-on: https://skia-review.googlesource.com/111602
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2018-03-01 22:16:34 +00:00
Brian Osman
ded47a5014 Revert "Add 1010102 support to Ganesh"
This reverts commit 44b61204d9.

Reason for revert: TSAN bot crashing

Original change's description:
> Add 1010102 support to Ganesh
> 
> Adds gl1010102, gles1010102, vk1010102, and mtl1010102
> configs to DM.
> 
> This uses the same saveLayer approach as CPU, switching
> to 8888 so that we have enough alpha precision.
> 
> Change-Id: I9f5b63747ec01031c8db97dadfc42f77e4863ccb
> Reviewed-on: https://skia-review.googlesource.com/110500
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

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

Change-Id: I782e740763044c1ae78fb219161e37eec7617c74
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/111580
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-03-01 20:10:15 +00:00
Robert Phillips
1056eb821f Move atlas manager creation to GrContext derived classes (take 2)
TBR=bsalomon@google.com
Change-Id: Ie10b7e770e24104d10c36ce7882126dd8551a8ba
Reviewed-on: https://skia-review.googlesource.com/110822
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-03-01 19:41:04 +00:00
Robert Phillips
c4039ea466 Fission GrAtlasGlyphCache in two (take 2)
Reland all the things

This CL splits the old GrAtlasGlyphCache into a GrAtlasGlyphCache and an GrAtlasManager.

The GrAtlasManager itself is split into a rather limited base class (GrRestrictedAtlasManager)
and the all powerful GrAtlasManager. The GrRestrictedAtlasManager is available at op creation
time and provides access to the proxies backing the atlases. The full GrAtlasManager is
only available at flush time and allows instantiation of the proxies and uploading to them.

In the DDL world all of the DDL Contexts will receive a GrRestrictedAtlasManager-version of the
GrAtlasManager in the main thread. This future atlas manager will have had all of its
GrDrawOpAtlases created (but not instantiated) so there should be no race conditions.

TBR=jvanverth@google.com
Change-Id: I05c6cd8d301bf2decca39765e5cae62993d9da04
Reviewed-on: https://skia-review.googlesource.com/111362
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-03-01 19:09:14 +00:00
Brian Osman
44b61204d9 Add 1010102 support to Ganesh
Adds gl1010102, gles1010102, vk1010102, and mtl1010102
configs to DM.

This uses the same saveLayer approach as CPU, switching
to 8888 so that we have enough alpha precision.

Change-Id: I9f5b63747ec01031c8db97dadfc42f77e4863ccb
Reviewed-on: https://skia-review.googlesource.com/110500
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-03-01 18:34:35 +00:00
Robert Phillips
4bc7011802 Separate creation time & flush time behavior in GrDrawOpAtlas (take 3)
This CL clarifies what is going on in the GrDrawOpAtlas and GrAtlasGlyphCache.

For the GrDrawOpAtlas:
  At creation time all the allowed pages are created (with their backing GrTextureProxies) but they aren't instantiated.

  The GrDrawOpAtlas::instantiate call is called in preFlushCB and allocates any pages known to be needed at the start of flush

  GrDrawOpAtlas::addToAtlas is called at flush time and, if a new page is activated, will instantiated it at that time.

  During compaction, an unused page will be deInstantiated but its Plots and backing GrTextureProxy will remain alive.

The GrAtlasGlyphCache reflects the changes to the GrDrawOpAtlas
  It now carries a GrProxyProvider for when it needs to create an atlas
  It passes in a GrResourceProvider* at flush time to allow instantiation.

  It does not, yet, allocate that GrDrawOpAtlases it might ever require.

TBR=bsalomon@google.com
Change-Id: I276d339d81e7b709140e082a7b58c5584f73ab70
Reviewed-on: https://skia-review.googlesource.com/111100
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2018-03-01 15:47:34 +00:00
Cary Clark
65e409faca make SkDestinationSurfaceColorMode private
R=brianosman@google.com, reed@google.com
Bug: skia:
Change-Id: Ibbf91a664cc504737137717d9170ce4de09b017c
Reviewed-on: https://skia-review.googlesource.com/111161
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
2018-02-28 20:31:33 +00:00
Jim Van Verth
a556684b10 Remove deprecated drawShadow interfaces
Bug: skia:7263
Change-Id: I90fcc35e8d070b324287139ebecc3d15dbec0137
Reviewed-on: https://skia-review.googlesource.com/109164
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2018-02-28 19:07:29 +00:00
Robert Phillips
ba7a165194 Revert "Revert "Revert "Separate creation time & flush time behavior in GrDrawOpAtlas (take 2)"""
This reverts commit 934c3d0c54.

Reason for revert: Chrome

Original change's description:
> Revert "Revert "Separate creation time & flush time behavior in GrDrawOpAtlas (take 2)""
> 
> This reverts commit 84d823a5e2.
> 
> Reason for revert: The DFT diffs don't repro on Windows so I'm chalking it up to minor device differences
> 
> Original change's description:
> > Revert "Separate creation time & flush time behavior in GrDrawOpAtlas (take 2)"
> > 
> > This reverts commit 96165ebeaa.
> > 
> > Reason for revert: DFT GMs w/ LCD text are slightly different
> > 
> > Original change's description:
> > > Separate creation time & flush time behavior in GrDrawOpAtlas (take 2)
> > > 
> > > This CL clarifies what is going on in the GrDrawOpAtlas and GrAtlasGlyphCache.
> > > 
> > > For the GrDrawOpAtlas:
> > >   At creation time all the allowed pages are created (with their backing GrTextureProxies) but they aren't instantiated.
> > > 
> > >   The GrDrawOpAtlas::instantiate call is called in preFlushCB and allocates any pages known to be needed at the start of flush
> > > 
> > >   GrDrawOpAtlas::addToAtlas is called at flush time and, if a new page is activated, will instantiated it at that time.
> > > 
> > >   During compaction, an unused page will be deInstantiated but its Plots and backing GrTextureProxy will remain alive.
> > > 
> > > The GrAtlasGlyphCache reflects the changes to the GrDrawOpAtlas
> > >   It now carries a GrProxyProvider for when it needs to create an atlas
> > >   It passes in a GrResourceProvider* at flush time to allow instantiation.
> > > 
> > >   It does not, yet, allocate that GrDrawOpAtlases it might ever require.
> > > 
> > > Change-Id: Ie9b64b13e261b01ee14be09fbf7e17841b7781dc
> > > Reviewed-on: https://skia-review.googlesource.com/109749
> > > Reviewed-by: Jim Van Verth <jvanverth@google.com>
> > > Commit-Queue: Robert Phillips <robertphillips@google.com>
> > 
> > TBR=jvanverth@google.com,robertphillips@google.com
> > 
> > Change-Id: I62efc61c8394477e54d6e79fa2f65180c91a4515
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Reviewed-on: https://skia-review.googlesource.com/110220
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
> > Commit-Queue: Robert Phillips <robertphillips@google.com>
> 
> TBR=jvanverth@google.com,robertphillips@google.com
> 
> Change-Id: I7c87b4523f9b53285f0de5c2d741a25893522d9a
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/110221
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

TBR=jvanverth@google.com,robertphillips@google.com

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

Change-Id: I7dd73ab0159f38595f21b21eef3becc10aa0934d
Reviewed-on: https://skia-review.googlesource.com/111080
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-02-28 17:42:11 +00:00
Robert Phillips
5c56af1790 Revert "Fission GrAtlasGlyphCache in two"
This reverts commit acf17904d6.

Reason for revert: Chrome

Original change's description:
> Fission GrAtlasGlyphCache in two
> 
> This CL splits the old GrAtlasGlyphCache into a GrAtlasGlyphCache and an GrAtlasManager.
> 
> The GrAtlasManager itself is split into a rather limited base class (GrRestrictedAtlasManager)
> and the all powerful GrAtlasManager. The GrRestrictedAtlasManager is available at op creation
> time and provides access to the proxies backing the atlases. The full GrAtlasManager is
> only available at flush time and allows instantiation of the proxies and uploading to them.
> 
> In the DDL world all of the DDL Contexts will receive a GrRestrictedAtlasManager-version of the
> GrAtlasManager in the main thread. This future atlas manager will have had all of its
> GrDrawOpAtlases created (but not instantiated) so there should be no race conditions.
> 
> Change-Id: I9967d3a4116af50128f390c5039a712b8cd4db08
> Reviewed-on: https://skia-review.googlesource.com/108001
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Jim Van Verth <jvanverth@google.com>

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

Change-Id: I7c760ea1a9f041a310b96d552aa1497ee5902cd8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/111040
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-02-28 16:37:47 +00:00
Robert Phillips
0551818a01 Revert "Move atlas manager creation to GrContext derived classes"
This reverts commit e5b7ceeac8.

Reason for revert: Breaking Mus/Viz tests in Chrome roll

Original change's description:
> Move atlas manager creation to GrContext derived classes
> 
> This CL relies on: https://skia-review.googlesource.com/c/skia/+/108001 (Fission GrAtlasGlyphCache in two)
> 
> TBR=bsalomon@google.com
> Change-Id: Ic3f91cea2238221b970f8ebbda99b10202925cd8
> Reviewed-on: https://skia-review.googlesource.com/110621
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>

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

Change-Id: I3973463b7b837145d9732171a91d82f0f0cea148
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/110821
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-02-28 14:19:16 +00:00
Brian Salomon
3d86a19f42 Refactor GrCaps::renderTargetWritePixelsSupported to support for some GL workarounds
Make indirect path in writeSurfacePixels2 use a copy rather than a draw.

Fix issue in GrVkGpu where render target dirty region is not updated after copy-as-draw

Remove unnecessary resolve of MSAA RT in GrVkCopyManager.

Splits WritePixelsNonTexture_Gpu test into MSAA and non-MSAA variants. MSAA variant blacklisted
on Adreno because of:

Bug: skia:7663

~~~~~~AND~~~~~~~

Revert "Suppress CopySurface test on Nexus 7"

This reverts commit b42b6169d5.

Bug: skia:7658
Change-Id: I8337d718efb41e266537744bbf5ff8b1545322a7
Reviewed-on: https://skia-review.googlesource.com/110700
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-02-28 03:14:25 +00:00
Robert Phillips
e5b7ceeac8 Move atlas manager creation to GrContext derived classes
This CL relies on: https://skia-review.googlesource.com/c/skia/+/108001 (Fission GrAtlasGlyphCache in two)

TBR=bsalomon@google.com
Change-Id: Ic3f91cea2238221b970f8ebbda99b10202925cd8
Reviewed-on: https://skia-review.googlesource.com/110621
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2018-02-28 00:20:06 +00:00
Robert Phillips
acf17904d6 Fission GrAtlasGlyphCache in two
This CL splits the old GrAtlasGlyphCache into a GrAtlasGlyphCache and an GrAtlasManager.

The GrAtlasManager itself is split into a rather limited base class (GrRestrictedAtlasManager)
and the all powerful GrAtlasManager. The GrRestrictedAtlasManager is available at op creation
time and provides access to the proxies backing the atlases. The full GrAtlasManager is
only available at flush time and allows instantiation of the proxies and uploading to them.

In the DDL world all of the DDL Contexts will receive a GrRestrictedAtlasManager-version of the
GrAtlasManager in the main thread. This future atlas manager will have had all of its
GrDrawOpAtlases created (but not instantiated) so there should be no race conditions.

Change-Id: I9967d3a4116af50128f390c5039a712b8cd4db08
Reviewed-on: https://skia-review.googlesource.com/108001
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2018-02-27 22:05:55 +00:00
Mike Reed
bb586b2eeb fix crasher in path-->region
Bug: skia:7491
Change-Id: I7e8b9fbe43098094d5935331107c3f40fb6971ec
Reviewed-on: https://skia-review.googlesource.com/110721
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Cary Clark <caryclark@google.com>
Reviewed-by: Yuqian Li <liyuqian@google.com>
2018-02-27 21:03:49 +00:00
Cary Clark
7595939168 updated includes
update includes to latest
bookmaker docs

TBR=reed@google.com
Bug: skia:6898
Change-Id: If42ab25f98a0f0d8b410ae30ca1cd641e19ce89f
Reviewed-on: https://skia-review.googlesource.com/107021
Commit-Queue: Cary Clark <caryclark@skia.org>
Reviewed-by: Cary Clark <caryclark@skia.org>
2018-02-27 16:37:39 +00:00
Brian Salomon
5f33a8ccac Start on new GPU pixel ops implementation.
The new ops attempt to be less optimal by falling back to CPU conversions
rather than relying on intermediate draws and complex coordination between
GrContext and GrGpu to determine how conversions are performed.

This adds the new writePixels implementation.

Change-Id: I7496d86d5a40277ed2ca63668881c160e54d80d3
Reviewed-on: https://skia-review.googlesource.com/109880
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-02-26 20:43:18 +00:00
Jim Van Verth
a947e29bfd Add some additional checks for shadow generation
Change-Id: I4dae4173ad879827e4e1fa3ad12aa0447d1df252
Reviewed-on: https://skia-review.googlesource.com/110360
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2018-02-26 20:02:38 +00:00
Greg Daniel
8385a8a44b Revert "Revert "Fixes to alignment issues with regards to mapped vulkan memory.""
This reverts commit 88fdee9bde.

Reason for revert: Pre Fixes landed in other repos

Original change's description:
> Revert "Fixes to alignment issues with regards to mapped vulkan memory."
> 
> This reverts commit 9fb6cf4c49.
> 
> Reason for revert: breaks fuchsia
> 
> Original change's description:
> > Fixes to alignment issues with regards to mapped vulkan memory.
> > 
> > Bug: skia:
> > Change-Id: Ida9813fe774580a6d157b8eb8d330488c8e8c4bc
> > Reviewed-on: https://skia-review.googlesource.com/109483
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > Reviewed-by: Jim Van Verth <jvanverth@google.com>
> 
> TBR=djsollen@google.com,egdaniel@google.com,jvanverth@google.com
> 
> # Not skipping CQ checks because original CL landed > 1 day ago.
> 
> Bug: skia:
> Change-Id: If1223313cab27737ada401d1f3fe4b7ab849d03f
> Reviewed-on: https://skia-review.googlesource.com/110040
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

Bug: skia:
Change-Id: Ifeebf535c3617674846f7ef25e686ee11ceee65c
Reviewed-on: https://skia-review.googlesource.com/110160
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-02-26 18:59:38 +00:00
Robert Phillips
934c3d0c54 Revert "Revert "Separate creation time & flush time behavior in GrDrawOpAtlas (take 2)""
This reverts commit 84d823a5e2.

Reason for revert: The DFT diffs don't repro on Windows so I'm chalking it up to minor device differences

Original change's description:
> Revert "Separate creation time & flush time behavior in GrDrawOpAtlas (take 2)"
> 
> This reverts commit 96165ebeaa.
> 
> Reason for revert: DFT GMs w/ LCD text are slightly different
> 
> Original change's description:
> > Separate creation time & flush time behavior in GrDrawOpAtlas (take 2)
> > 
> > This CL clarifies what is going on in the GrDrawOpAtlas and GrAtlasGlyphCache.
> > 
> > For the GrDrawOpAtlas:
> >   At creation time all the allowed pages are created (with their backing GrTextureProxies) but they aren't instantiated.
> > 
> >   The GrDrawOpAtlas::instantiate call is called in preFlushCB and allocates any pages known to be needed at the start of flush
> > 
> >   GrDrawOpAtlas::addToAtlas is called at flush time and, if a new page is activated, will instantiated it at that time.
> > 
> >   During compaction, an unused page will be deInstantiated but its Plots and backing GrTextureProxy will remain alive.
> > 
> > The GrAtlasGlyphCache reflects the changes to the GrDrawOpAtlas
> >   It now carries a GrProxyProvider for when it needs to create an atlas
> >   It passes in a GrResourceProvider* at flush time to allow instantiation.
> > 
> >   It does not, yet, allocate that GrDrawOpAtlases it might ever require.
> > 
> > Change-Id: Ie9b64b13e261b01ee14be09fbf7e17841b7781dc
> > Reviewed-on: https://skia-review.googlesource.com/109749
> > Reviewed-by: Jim Van Verth <jvanverth@google.com>
> > Commit-Queue: Robert Phillips <robertphillips@google.com>
> 
> TBR=jvanverth@google.com,robertphillips@google.com
> 
> Change-Id: I62efc61c8394477e54d6e79fa2f65180c91a4515
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/110220
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

TBR=jvanverth@google.com,robertphillips@google.com

Change-Id: I7c87b4523f9b53285f0de5c2d741a25893522d9a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/110221
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-02-26 16:49:28 +00:00
Robert Phillips
84d823a5e2 Revert "Separate creation time & flush time behavior in GrDrawOpAtlas (take 2)"
This reverts commit 96165ebeaa.

Reason for revert: DFT GMs w/ LCD text are slightly different

Original change's description:
> Separate creation time & flush time behavior in GrDrawOpAtlas (take 2)
> 
> This CL clarifies what is going on in the GrDrawOpAtlas and GrAtlasGlyphCache.
> 
> For the GrDrawOpAtlas:
>   At creation time all the allowed pages are created (with their backing GrTextureProxies) but they aren't instantiated.
> 
>   The GrDrawOpAtlas::instantiate call is called in preFlushCB and allocates any pages known to be needed at the start of flush
> 
>   GrDrawOpAtlas::addToAtlas is called at flush time and, if a new page is activated, will instantiated it at that time.
> 
>   During compaction, an unused page will be deInstantiated but its Plots and backing GrTextureProxy will remain alive.
> 
> The GrAtlasGlyphCache reflects the changes to the GrDrawOpAtlas
>   It now carries a GrProxyProvider for when it needs to create an atlas
>   It passes in a GrResourceProvider* at flush time to allow instantiation.
> 
>   It does not, yet, allocate that GrDrawOpAtlases it might ever require.
> 
> Change-Id: Ie9b64b13e261b01ee14be09fbf7e17841b7781dc
> Reviewed-on: https://skia-review.googlesource.com/109749
> Reviewed-by: Jim Van Verth <jvanverth@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

TBR=jvanverth@google.com,robertphillips@google.com

Change-Id: I62efc61c8394477e54d6e79fa2f65180c91a4515
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/110220
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-02-26 16:03:58 +00:00
Robert Phillips
96165ebeaa Separate creation time & flush time behavior in GrDrawOpAtlas (take 2)
This CL clarifies what is going on in the GrDrawOpAtlas and GrAtlasGlyphCache.

For the GrDrawOpAtlas:
  At creation time all the allowed pages are created (with their backing GrTextureProxies) but they aren't instantiated.

  The GrDrawOpAtlas::instantiate call is called in preFlushCB and allocates any pages known to be needed at the start of flush

  GrDrawOpAtlas::addToAtlas is called at flush time and, if a new page is activated, will instantiated it at that time.

  During compaction, an unused page will be deInstantiated but its Plots and backing GrTextureProxy will remain alive.

The GrAtlasGlyphCache reflects the changes to the GrDrawOpAtlas
  It now carries a GrProxyProvider for when it needs to create an atlas
  It passes in a GrResourceProvider* at flush time to allow instantiation.

  It does not, yet, allocate that GrDrawOpAtlases it might ever require.

Change-Id: Ie9b64b13e261b01ee14be09fbf7e17841b7781dc
Reviewed-on: https://skia-review.googlesource.com/109749
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-02-26 14:56:17 +00:00
Greg Daniel
88fdee9bde Revert "Fixes to alignment issues with regards to mapped vulkan memory."
This reverts commit 9fb6cf4c49.

Reason for revert: breaks fuchsia

Original change's description:
> Fixes to alignment issues with regards to mapped vulkan memory.
> 
> Bug: skia:
> Change-Id: Ida9813fe774580a6d157b8eb8d330488c8e8c4bc
> Reviewed-on: https://skia-review.googlesource.com/109483
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Jim Van Verth <jvanverth@google.com>

TBR=djsollen@google.com,egdaniel@google.com,jvanverth@google.com

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

Bug: skia:
Change-Id: If1223313cab27737ada401d1f3fe4b7ab849d03f
Reviewed-on: https://skia-review.googlesource.com/110040
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-02-25 14:00:39 +00:00
Greg Daniel
9fb6cf4c49 Fixes to alignment issues with regards to mapped vulkan memory.
Bug: skia:
Change-Id: Ida9813fe774580a6d157b8eb8d330488c8e8c4bc
Reviewed-on: https://skia-review.googlesource.com/109483
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2018-02-23 20:17:16 +00:00
Chris Dalton
2612baecd8 ccpr: Prefer atlas sizes under 4k on ARM
Bug: skia:
Change-Id: Ib5afb84647efe2e64a3ec2f9da422b39228431e9
Reviewed-on: https://skia-review.googlesource.com/108871
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-02-22 21:06:05 +00:00
Mike Reed
242135a402 move some RRect methods into priv
also, return radii by value instead of reference, in possible prep for changing underlying representation

Bug: skia:7649
Change-Id: Iff42a49c53cc48171fc63462be366cc3500b2273
Reviewed-on: https://skia-review.googlesource.com/109385
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-02-22 19:09:10 +00:00
Robert Phillips
59ddc6d5ee Revert "Separate creation time & flush time behavior in GrDrawOpAtlas"
This reverts commit 056c1a821a.

Reason for revert: GM issues

Original change's description:
> Separate creation time & flush time behavior in GrDrawOpAtlas
> 
> This CL clarifies what is going on in the GrDrawOpAtlas and GrAtlasGlyphCache.
> 
> For the GrDrawOpAtlas:
>   At creation time all the allowed pages are created (with their backing GrTextureProxies) but they aren't instantiated.
> 
>   The GrDrawOpAtlas::instantiate call is called in preFlushCB and allocates any pages known to be needed at the start of flush
> 
>   GrDrawOpAtlas::addToAtlas is called at flush time and, if a new page is activated, will instantiated it at that time.
> 
>   During compaction, an unused page will be deInstantiated but its Plots and backing GrTextureProxy will remain alive.
> 
> The GrAtlasGlyphCache reflects the changes to the GrDrawOpAtlas
>   It now carries a GrProxyProvider for when it needs to create an atlas
>   It passes in a GrResourceProvider* at flush time to allow instantiation.
> 
>   It does not, yet, allocate that GrDrawOpAtlases it might ever require.
> 
> Change-Id: I54909b7a3ba4bec2db5f1218f6a2a3a1636f66d6
> Reviewed-on: https://skia-review.googlesource.com/108520
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Jim Van Verth <jvanverth@google.com>

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

Change-Id: I36eafe46209380f533aa84e831d1c9d18844b6be
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/109280
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-02-21 21:56:47 +00:00
Mike Reed
267ecccfed change path serialization version to 4
New format should be much simpler:
- only store public data (e.g. points, verbs, filltype)
- deserialize just uses public APIs

Refactor reading code to manage different (older) versions, to make
it clear (hopefully) what we can delete when we can abandon version
3 support.

Bug: skia:
Change-Id: I30465f891cba3f044ae1cb2c13c04f04fdc9da78
Reviewed-on: https://skia-review.googlesource.com/109160
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2018-02-21 21:22:37 +00:00
Peng Huang
df285ce3be Fix the link error for component build
Bug: skia:
Change-Id: I670eeee09547edb46db498a9439c5d6066c6fe55
Reviewed-on: https://skia-review.googlesource.com/109106
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-02-21 19:49:16 +00:00
Robert Phillips
056c1a821a Separate creation time & flush time behavior in GrDrawOpAtlas
This CL clarifies what is going on in the GrDrawOpAtlas and GrAtlasGlyphCache.

For the GrDrawOpAtlas:
  At creation time all the allowed pages are created (with their backing GrTextureProxies) but they aren't instantiated.

  The GrDrawOpAtlas::instantiate call is called in preFlushCB and allocates any pages known to be needed at the start of flush

  GrDrawOpAtlas::addToAtlas is called at flush time and, if a new page is activated, will instantiated it at that time.

  During compaction, an unused page will be deInstantiated but its Plots and backing GrTextureProxy will remain alive.

The GrAtlasGlyphCache reflects the changes to the GrDrawOpAtlas
  It now carries a GrProxyProvider for when it needs to create an atlas
  It passes in a GrResourceProvider* at flush time to allow instantiation.

  It does not, yet, allocate that GrDrawOpAtlases it might ever require.

Change-Id: I54909b7a3ba4bec2db5f1218f6a2a3a1636f66d6
Reviewed-on: https://skia-review.googlesource.com/108520
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2018-02-21 19:46:56 +00:00
Mike Reed
cbb85a7275 remove deprecated method
Bug: skia:
Change-Id: Icd5c3b83c97f5039a530f87a3a813e4d9e9f8833
Reviewed-on: https://skia-review.googlesource.com/108662
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2018-02-20 21:41:44 +00:00
Robert Phillips
f3690dd416 Change signature of GrAtlasGlyphCache::getProxies
Split out of https://skia-review.googlesource.com/c/skia/+/108001 (Fission GrAtlasGlyphCache in two)

TBR=bsalomon@google.com
Change-Id: I573730fdeddf178915eb5f5b8cf59a3ab29e0654
Reviewed-on: https://skia-review.googlesource.com/108441
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-02-20 21:16:53 +00:00
Mike Reed
0c3137c4f4 hide complex versions of isOval and isRRect
Bug: skia:
Change-Id: I9fa899d409470f424fdfbef5b0c3bb528bcce40e
Reviewed-on: https://skia-review.googlesource.com/108660
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-02-20 19:33:53 +00:00
Brian Salomon
c320b15768 Introduce GrColorType
This begins the journey towards using different types to refer to CPU data and GPU texture formats. This is one part of removing GrPixelConfig and more directly using GL/VK texture formats

GrColorType represents a particular layout of color/gray/alpha channels in CPU memory. It does not refer to texture formats or sRGB-encoding. It is basically SkColorType specialized to the GPU backend with some formats added and some removed.

Read/WritePixel interfaces use GrColorType to describe the CPU side of the transaction.

There's still a lot of punting to GrPixelConfig in API-specific code. There's a lot more to be done.

Bug: 6718
Bug: 7580

Change-Id: I8d813ae9a4416a06596f22a4b87da02091989718
Reviewed-on: https://skia-review.googlesource.com/107264
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-02-20 19:30:13 +00:00
Florin Malita
eb420457fd Add SkRect::contains(SkScalar x, SkScalar y)
Similar to its SkIRect counterpart.

Change-Id: I6872694d8602ed4181a1a15b4cd1c2c32aeab3f9
Reviewed-on: https://skia-review.googlesource.com/108506
Reviewed-by: Cary Clark <caryclark@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-02-20 17:57:53 +00:00
Chris Dalton
535ba8d2b8 Drop unused support for MSAA sample locations
Bug: skia:
Change-Id: I96f0c25732d79c5881e400b121e81c5696a747a6
Reviewed-on: https://skia-review.googlesource.com/107441
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2018-02-20 17:19:13 +00:00
Chris Dalton
7fe33c0a42 Drop unused shader support for multisample interpolation
Bug: skia:
Change-Id: Ie19f13877bf6828ab94ffbb20e6f74e0e376f6cb
Reviewed-on: https://skia-review.googlesource.com/107359
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-02-20 16:41:43 +00:00
Greg Daniel
2a30390ce6 Update createWrappedRenderTargetProxy with BackendRT to work with lazy proxies.
This change also triggered a bunch of side changes thanks to WrappedProxyTest
fixing/improving how we handle wrapped proxies in genernal.

Bug: skia:
Change-Id: I743a458923cff1c2e947627d0e9154a4c808a668
Reviewed-on: https://skia-review.googlesource.com/108102
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-02-20 15:32:33 +00:00
Mike Reed
a3d9e21f04 don't trust stored segment mask
Bug: skia:7604
Change-Id: I508bbdc006e1c6edce2006be0c43b037038c876b
Reviewed-on: https://skia-review.googlesource.com/108360
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2018-02-20 15:13:23 +00:00
Mike Reed
19d7bd6504 hide virtual and rename to onMakeComposed
Bug: skia:
Change-Id: Ic18ee2af3273f81ebec9c9031162e808186c0acd
Reviewed-on: https://skia-review.googlesource.com/108300
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-02-19 19:40:14 +00:00
Mike Reed
dfc0e910df add decal tilemode to shaders
Plenty more to follow-up:
- gradients
- gpu impl

Bug: skia:7638
Change-Id: I8e54fd0e24921f040f178c793b36c7fb855b136e
Reviewed-on: https://skia-review.googlesource.com/107420
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2018-02-16 23:19:47 +00:00
Chris Dalton
46563d1d91 Forward internal_private_accessTopLayerRenderTargetContext from SkPaintFilterCanvas
Fixes viewer slides that need direct access to Ganesh.

Bug: skia:
Change-Id: Icfdd814e53ce333f4a20353e8bc4dddde3cc72df
Reviewed-on: https://skia-review.googlesource.com/108020
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2018-02-16 20:10:47 +00:00
Greg Daniel
f6f7b67ac2 When creating emptyp MipMap proxies, don't instantiate them immediately. Attempt 3
original: https://skia-review.googlesource.com/106966

Bug: skia:
Change-Id: I779985cef2d3c4f36a0129d8ecedd12e510bec7e
Reviewed-on: https://skia-review.googlesource.com/107781
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-02-15 20:13:32 +00:00
Chris Dalton
602836138e Drop unused shader support for sample variables
Bug: skia:
Change-Id: I9e2b7da8c916703027d8dd4303ae67f4e69bcf87
Reviewed-on: https://skia-review.googlesource.com/107356
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2018-02-15 19:37:52 +00:00
Mike Reed
36c0b57698 use safe increment for edge walker
Bug: oss-fuzz:6126
Change-Id: I8f6865cbbbfbe37acf940cc2d4ae93204ba7168d
Reviewed-on: https://skia-review.googlesource.com/107783
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2018-02-15 17:14:19 +00:00
Greg Daniel
7080a431a7 Revert "Revert "Revert "When creating emptyp MipMap proxies, don't instantiate them immediately."""
This reverts commit 95edb43251.

Reason for revert: breaking Ubuntu Linux GMs

Original change's description:
> Revert "Revert "When creating emptyp MipMap proxies, don't instantiate them immediately.""
> 
> This reverts commit 0ee866dac7.
> 
> Reason for revert: <INSERT REASONING HERE>
> 
> Original change's description:
> > Revert "When creating emptyp MipMap proxies, don't instantiate them immediately."
> > 
> > This reverts commit 8242c5c199.
> > 
> > Reason for revert: Hitting assert on intel bots on skbug6850overlay2.skp, SkASSERT(proxy->getUniqueKey().isValid()); in processInvalidProxyUniqueKey
> > 
> > Original change's description:
> > > When creating emptyp MipMap proxies, don't instantiate them immediately.
> > > 
> > > This chnages makes it match how we handle non mipped proxies where we
> > > don't actually instantiate them until we need to.
> > > 
> > > Bug: skia:
> > > Change-Id: Id0c50eefce43ef1458a3ff0bb1881a817b045279
> > > Reviewed-on: https://skia-review.googlesource.com/106966
> > > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > > Reviewed-by: Robert Phillips <robertphillips@google.com>
> > 
> > TBR=egdaniel@google.com,robertphillips@google.com
> > 
> > Change-Id: I1fa6165b69c5bbb1d6bb10abba33dcdb55a27ba3
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Bug: skia:
> > Reviewed-on: https://skia-review.googlesource.com/107263
> > Reviewed-by: Greg Daniel <egdaniel@google.com>
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> 
> TBR=egdaniel@google.com,robertphillips@google.com
> 
> Bug: skia:
> Change-Id: Ice34283f9ac183faed6e061d8162cf2226b18289
> Reviewed-on: https://skia-review.googlesource.com/107320
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

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

Change-Id: I53f166d508cc8ccd71e7473934a12a52f2eba7bb
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/107321
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-02-14 21:10:15 +00:00
Brian Salomon
9b009bb069 Prepare sRGB encoding conversion for the removal of GrPixelConfig
Standardizes that GrGpu subclass's onRead/WritePixels never do sRGB<->linear conversion. This means that they can eventually take a color type rather than config. It also means direct callers of GrGpu::read/writePixels can never expect conversion (which in practice is no change).

Consolidate logic about whether to do sRGB<->linear encoding conversions in GrContext::read/writeSurfacePixels helpers. No change in when conversions are done (yet). This prepares this logic to operate on SkColorSpace and color type rather than config WRT the CPU data.

Bug: skia:6718
Change-Id: I346d669624861578f1bb9ea465a7ab4b549117fa
Reviewed-on: https://skia-review.googlesource.com/105286
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-02-14 19:58:14 +00:00
Greg Daniel
95edb43251 Revert "Revert "When creating emptyp MipMap proxies, don't instantiate them immediately.""
This reverts commit 0ee866dac7.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Revert "When creating emptyp MipMap proxies, don't instantiate them immediately."
> 
> This reverts commit 8242c5c199.
> 
> Reason for revert: Hitting assert on intel bots on skbug6850overlay2.skp, SkASSERT(proxy->getUniqueKey().isValid()); in processInvalidProxyUniqueKey
> 
> Original change's description:
> > When creating emptyp MipMap proxies, don't instantiate them immediately.
> > 
> > This chnages makes it match how we handle non mipped proxies where we
> > don't actually instantiate them until we need to.
> > 
> > Bug: skia:
> > Change-Id: Id0c50eefce43ef1458a3ff0bb1881a817b045279
> > Reviewed-on: https://skia-review.googlesource.com/106966
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
> 
> TBR=egdaniel@google.com,robertphillips@google.com
> 
> Change-Id: I1fa6165b69c5bbb1d6bb10abba33dcdb55a27ba3
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:
> Reviewed-on: https://skia-review.googlesource.com/107263
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

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

Bug: skia:
Change-Id: Ice34283f9ac183faed6e061d8162cf2226b18289
Reviewed-on: https://skia-review.googlesource.com/107320
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-02-14 19:55:24 +00:00