Commit Graph

491 Commits

Author SHA1 Message Date
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
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
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
Robert Phillips
fc711a2b01 Add SkCharacterization creation helper to GrContextThreadSafeProxy (take 2)
TBR=bsalomon@google.com
Change-Id: Id96d4fdbb6889065f10a4a7e0c22a03ad9aa5fef
Reviewed-on: https://skia-review.googlesource.com/107000
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-02-14 12:42:18 +00:00
Cary Clark
559823d1fe Revert "Add SkCharacterization creation helper to GrContextThreadSafeProxy"
This reverts commit d76e56d93c.

Reason for revert: broke NexusPlayer Vulkan

Original change's description:
> Add SkCharacterization creation helper to GrContextThreadSafeProxy
> 
> Change-Id: I8ad7cf335f2b586cf501eaa70573690fbbd53efa
> Reviewed-on: https://skia-review.googlesource.com/106105
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

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

Change-Id: I72b75ff700d39839f7207955566e48bb544aaf6b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/106968
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
2018-02-13 17:02:31 +00:00
Brian Osman
8a83ca4e9a Add "sharpen" option to SkSL, to LOD bias all textures
This adds a fixed bias (-0.5) to the computed LOD of all
mip-mapped texture fetches. (Technically, to all texture
fetches, but that only matters for mip-mapped ones).

Clients can opt-in with a new GrContextOption.

Bug: skia:7541
Bug: chromium:562162
Change-Id: Ie3cd0679c4ab66f62d2dc32e7e68e5c99355115e
Reviewed-on: https://skia-review.googlesource.com/106322
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-02-13 16:30:20 +00:00
Robert Phillips
d76e56d93c Add SkCharacterization creation helper to GrContextThreadSafeProxy
Change-Id: I8ad7cf335f2b586cf501eaa70573690fbbd53efa
Reviewed-on: https://skia-review.googlesource.com/106105
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-02-13 16:03:50 +00:00
Mike Reed
5dd202dc90 Revert "Revert "move GrColor.h to private, IWYU""
This reverts commit 63cc29304a.

Reason for revert: pdfium updated

Original change's description:
> Revert "move GrColor.h to private, IWYU"
> 
> This reverts commit e602f39581.
> 
> Reason for revert: Breaks PDFIUM
> 
> Original change's description:
> > move GrColor.h to private, IWYU
> > 
> > Bug: skia:
> > Change-Id: I0f0dabd7cc54cb7786f53bd6da0c0c012375037e
> > Reviewed-on: https://skia-review.googlesource.com/104160
> > Commit-Queue: Mike Reed <reed@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> 
> TBR=bsalomon@google.com,reed@google.com
> 
> Change-Id: Ifaa50f8771fa1ca8bc152270efdb1fe27f7210f2
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:
> Reviewed-on: https://skia-review.googlesource.com/104440
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

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

Change-Id: I22fa5c0e0628b5c1f3b5f13879c7d1a4528cc93a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/104561
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-02-06 23:05:46 +00:00
Brian Salomon
63cc29304a Revert "move GrColor.h to private, IWYU"
This reverts commit e602f39581.

Reason for revert: Breaks PDFIUM

Original change's description:
> move GrColor.h to private, IWYU
> 
> Bug: skia:
> Change-Id: I0f0dabd7cc54cb7786f53bd6da0c0c012375037e
> Reviewed-on: https://skia-review.googlesource.com/104160
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

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

Change-Id: Ifaa50f8771fa1ca8bc152270efdb1fe27f7210f2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/104440
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-02-06 18:33:26 +00:00
Mike Reed
e602f39581 move GrColor.h to private, IWYU
Bug: skia:
Change-Id: I0f0dabd7cc54cb7786f53bd6da0c0c012375037e
Reviewed-on: https://skia-review.googlesource.com/104160
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-02-06 15:42:15 +00:00
Brian Salomon
bdecacfbe4 Revert "Revert "Revert "Revert "Revert "Revert "Redefine the meaning of sample counts in GPU backend.""""""
This reverts commit 3a2cc2c2ec.

Fix code with samplecnt=0 that slipped in between trybots/CQ and landing of previous version

Change-Id: Iab19f2e8d1e9901601c8c76244d7a88c5d707fab
Reviewed-on: https://skia-review.googlesource.com/103181
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-02-03 01:59:59 +00:00
Brian Salomon
3a2cc2c2ec Revert "Revert "Revert "Revert "Revert "Redefine the meaning of sample counts in GPU backend."""""
This reverts commit 5bb82cbecd.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Revert "Revert "Revert "Revert "Redefine the meaning of sample counts in GPU backend.""""
> 
> This reverts commit 18c52a7b52.
> 
> Also relands "More sample count cleanup:" and "Add new GrContext queries for imagability, surfacability, and max sample count of color types"
> 
> 
> Bug: skia:
> Change-Id: I4028105a3a1f16ce3944e134619eb6245af6b947
> Reviewed-on: https://skia-review.googlesource.com/102940
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

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

Change-Id: Idee23be2f1719f0bdc9305043e95a2d589bee8d1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/103220
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-02-03 00:25:20 +00:00
Brian Salomon
5bb82cbecd Revert "Revert "Revert "Revert "Redefine the meaning of sample counts in GPU backend.""""
This reverts commit 18c52a7b52.

Also relands "More sample count cleanup:" and "Add new GrContext queries for imagability, surfacability, and max sample count of color types"


Bug: skia:
Change-Id: I4028105a3a1f16ce3944e134619eb6245af6b947
Reviewed-on: https://skia-review.googlesource.com/102940
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-02-02 23:37:59 +00:00
Brian Salomon
18c52a7b52 Revert "Revert "Revert "Redefine the meaning of sample counts in GPU backend."""
This reverts commit d0d7270fcc.

Revert "More sample count cleanup:"

This reverts commit d653cac70e.

Revert "Add new GrContext queries for imagability, surfacability, and max sample count of color types"

This reverts commit 85ae7159c9.


Need to understand NVPR perf changes before relanding

Change-Id: I0db075fb42438ef2a1f9885df184dce52892ac4b
Reviewed-on: https://skia-review.googlesource.com/102780
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-02-02 12:19:52 +00:00
Brian Salomon
85ae7159c9 Add new GrContext queries for imagability, surfacability, and max sample count of color types
Bug: skia:7538
Change-Id: I235fc1aa947ba57faa7aef5e7e7ce9241b315fff
Reviewed-on: https://skia-review.googlesource.com/99704
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2018-02-02 00:16:28 +00:00
Brian Salomon
d0d7270fcc Revert "Revert "Redefine the meaning of sample counts in GPU backend.""
Fixes gpu config default samples to be 1 and updates config parsing test accordingly.

This reverts commit c1ce2f7966.

Bug: skia:
Change-Id: I456973b1f52ced85a2011ea10fc49449bfc5846f
Reviewed-on: https://skia-review.googlesource.com/102147
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-02-01 21:15:39 +00:00
Brian Salomon
c1ce2f7966 Revert "Redefine the meaning of sample counts in GPU backend."
This reverts commit 48825b11ad.

Reason for revert: nanobench

Original change's description:
> Redefine the meaning of sample counts in GPU backend.
> 
> Old: 0  -> nonMSAA
>      1+ -> MSAA
> 
> New:
>      0  -> error/unsupported
>      1  -> nonMSAA
>      2+ -> MSAA
> 
> We still allow 0 to mean nonMSAA in three sets of public APIs for backwards compatibility:
> 
> 1) SkSurface factories
> 2) GrBackendRenderTarget constructors
> 3) GrCaps::getSampleCnt()'s requestedCount parameter
> 
> However, we immediately clamp to 1 and treat 0 as invalid/non-renderable internally.
> 
> This also changes the behavior when using a large sample count. We now fail in that case rather than using the largest sample available sample count. GrCaps::getSampleCount() will return 0 in this case.
> 
> 
> Bug: skia:
> Change-Id: Ida22c6b22c1365e563c9046b611e88bf5eb3ff33
> Reviewed-on: https://skia-review.googlesource.com/101560
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

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

Change-Id: Ic257619a8a5ee9ac15419ecf10259e42daed7f82
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/102662
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-02-01 18:34:40 +00:00
Brian Salomon
48825b11ad Redefine the meaning of sample counts in GPU backend.
Old: 0  -> nonMSAA
     1+ -> MSAA

New:
     0  -> error/unsupported
     1  -> nonMSAA
     2+ -> MSAA

We still allow 0 to mean nonMSAA in three sets of public APIs for backwards compatibility:

1) SkSurface factories
2) GrBackendRenderTarget constructors
3) GrCaps::getSampleCnt()'s requestedCount parameter

However, we immediately clamp to 1 and treat 0 as invalid/non-renderable internally.

This also changes the behavior when using a large sample count. We now fail in that case rather than using the largest sample available sample count. GrCaps::getSampleCount() will return 0 in this case.


Bug: skia:
Change-Id: Ida22c6b22c1365e563c9046b611e88bf5eb3ff33
Reviewed-on: https://skia-review.googlesource.com/101560
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-02-01 18:16:58 +00:00
Brian Salomon
33bf56d6b4 Remove GrContext::getRecommendedSampleCount and SkPictureContentInfo::suitableForGpuRasterization
Change-Id: I8c5521f87c5eae185e68622aa104cb8911efa8c8
Reviewed-on: https://skia-review.googlesource.com/100183
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-01-26 17:13:00 +00:00
Jim Van Verth
87d18ced0a Add Chinese zoom Sample.
Bug: skia:
Change-Id: Ibe5ffee64fe9fccd6b8d86c1310a78d2d51e424e
Reviewed-on: https://skia-review.googlesource.com/97065
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2018-01-22 18:20:27 +00:00
Robert Phillips
f35fd8d2f2 Move more internal methods from GrContext to GrContextPriv (take 3)
Change-Id: Ied630e61cf95780bf85032867e6ce663e1ef9c2f
Reviewed-on: https://skia-review.googlesource.com/98000
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-01-22 16:53:17 +00:00
Leon Scroggins
2914555e00 Revert "Move more internal methods from GrContext to GrContextPriv (take 2)"
This reverts commit c22e50bd31.

Reason for revert: Speculative fix for Android roll

Original change's description:
> Move more internal methods from GrContext to GrContextPriv (take 2)
> 
> Change-Id: I47108910517d61edeb52f82793d384fdb5605d45
> Reviewed-on: https://skia-review.googlesource.com/97241
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>

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

Change-Id: I3a77ac33c5f48529357cf9c683d5f4cacaa2379f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/97582
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2018-01-20 17:09:10 +00:00
Robert Phillips
c22e50bd31 Move more internal methods from GrContext to GrContextPriv (take 2)
Change-Id: I47108910517d61edeb52f82793d384fdb5605d45
Reviewed-on: https://skia-review.googlesource.com/97241
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2018-01-19 19:26:46 +00:00
Robert Phillips
88260b549f Split GrContext into Normal/DDL flavors
Change-Id: If37d8a236bd71e2d7121eaafb9d7c7b08328b10f
Reviewed-on: https://skia-review.googlesource.com/84863
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-01-19 18:36:35 +00:00
Hal Canary
07320e46c0 Revert "Move more internal methods from GrContext to GrContextPriv"
This reverts commit f440cecbfd.

Reason for revert: breaking android builds. 

Original change's description:
> Move more internal methods from GrContext to GrContextPriv
> 
> TBR=bsalomon@google.com
> Change-Id: Ia8cf0e0d30451c69bc7a08215aafa6abe6e0ddbe
> Reviewed-on: https://skia-review.googlesource.com/97080
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>

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

Change-Id: If263f8161f0fbe3fc6ee8f34bb09e237705c3694
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/97200
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-01-19 18:18:24 +00:00
Robert Phillips
f440cecbfd Move more internal methods from GrContext to GrContextPriv
TBR=bsalomon@google.com
Change-Id: Ia8cf0e0d30451c69bc7a08215aafa6abe6e0ddbe
Reviewed-on: https://skia-review.googlesource.com/97080
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2018-01-19 18:03:03 +00:00
Robert Phillips
6be756b673 Move resourceProvider accessor to GrContextPriv (take 2)
TBR=bsalomon@google.com
Change-Id: I3fd46ebfad0d04b8a2bfa6190f81308f3a6be620
Reviewed-on: https://skia-review.googlesource.com/95121
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2018-01-16 20:53:28 +00:00
Hal Canary
be46e24d57 Revert "Move resourceProvider accessor to GrContextPriv"
This reverts commit 1f9ed8501b.

Reason for revert: 
 1. breaking android roll 
 2. breaking Build-Debian9-Clang-arm-Release-Android_API26



Original change's description:
> Move resourceProvider accessor to GrContextPriv
> 
> Change-Id: I5cddd620a7ec4b006b7359864ede58e9d4dd684e
> Reviewed-on: https://skia-review.googlesource.com/94340
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

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

Change-Id: I20b2d267c0925f20453b635663654967199a1197
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/94964
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-01-16 18:33:14 +00:00
Robert Phillips
1f9ed8501b Move resourceProvider accessor to GrContextPriv
Change-Id: I5cddd620a7ec4b006b7359864ede58e9d4dd684e
Reviewed-on: https://skia-review.googlesource.com/94340
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-01-16 17:02:45 +00:00
Robert Phillips
1afd4cdb08 Add GrProxyProvider
This pulls all the proxy tracking & creation functionality out of the GrResourceCache and GrResourceProvider and consolidates it in the GrProxyProvider.

Change-Id: I7256f7c544319a70c1bd93dd5a9ccbe5fa0a544f
Reviewed-on: https://skia-review.googlesource.com/91501
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2018-01-08 19:05:31 +00:00
Mike Klein
4b6bde71ec add back purgeResourcesNotUsedInMs() temporarily
I think this will let Android roll.

Change-Id: If6b602d66bcecd711f4340a620d78cdf27ee825f
Reviewed-on: https://skia-review.googlesource.com/84960
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-12-14 13:02:09 +00:00
Robert Phillips
e42edcc8ef Add stubbed out GrContext
This CL mainly just:
   stores the GrContextOptions in GrContextThreadSafeProxy (so they can be passed on to a stubbed out GrContext)
   adds a method to create a stubbed out GrContext that has a GrStubGpu
      - the stubbed out GrContext isn't quite ready for prime time yet

Change-Id: I31be6763640e406c5963e6f0714489ac358339e4
Reviewed-on: https://skia-review.googlesource.com/79601
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-12-13 18:24:30 +00:00
Jim Van Verth
76d917cef1 Ensure we flush TextBlobCache message queue.
If we create and delete TextBlobs without actually renderering them,
their deletion messages can back up in the message queue. This adds
a routine to GrContext to ensure these messages get flushed.

Bug: 703297
Change-Id: Icc222373ac2a954dc3b77190cad79070ea562ba2
Reviewed-on: https://skia-review.googlesource.com/82686
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-12-13 14:54:42 +00:00
Brian Salomon
eace8cd22a Use sk_sp to own GrCaps in GrContext.
Change-Id: I46cd37132ecdf0f93be4509c6a06fb74cb185076
Reviewed-on: https://skia-review.googlesource.com/82625
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-12-08 18:42:52 +00:00
Brian Salomon
990014d082 Temporarily readd old signature of GrContext::MakeGL
Change-Id: I9c785dd2fd14e422b7e84067053d0565a4d782b6
Reviewed-on: https://skia-review.googlesource.com/82340
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-12-07 21:29:03 +00:00
Brian Salomon
384fab467e sk_spification of GrGpu creation.
Make GrContext::MakeGL take interface as sk_sp.

Make GrContext::MakeVulkan take GrVkBackendContext as sk_sp.

Change-Id: I13c22a57bd281c51738f503d9ed3418d35a466df
Reviewed-on: https://skia-review.googlesource.com/81842
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-12-07 17:56:59 +00:00
Robert Phillips
8def8bffe9 Add a GrContextThreadSafeProxy to SkSurfaceCharacterization
Ganesh will require access to the GrCaps to make rendering decisions.

Change-Id: I6dee42a3f0dc638f052706b8d1ea6e02b589e062
Reviewed-on: https://skia-review.googlesource.com/77681
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-11-30 14:16:32 +00:00
Ethan Nicholas
d1b2eec0d0 API to cache shader binaries between runs of Skia.
This CL does not include an actual implementation of said cache.
Stan is working on the cache implementation on the Android side of
things.

Bug: skia:
Change-Id: Iabe4f19b2dbacaaa1ead8bb3fa68d88c687b9a84
Reviewed-on: https://skia-review.googlesource.com/54780
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-11-02 13:07:41 +00:00
Greg Daniel
45d6303f6e Have mip status match surface when snapping image from wrapped object
Also fixes some bugs involved with creating mipped SkSurfaces.

Bug: skia:
Change-Id: I6e0109000eadd2bdee4a907d3ee2231104528165
Reviewed-on: https://skia-review.googlesource.com/65063
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-10-30 20:06:53 +00:00
Greg Daniel
e1da1d9a7d Add option to create a deferred render target context with mips
We need this since we have texture generators that draw the base level
but nothing more. Thus we want them to be able to directly draw into
a pre allocated mipped target instead of doing a copy later.

TBR: bsalomon@google.com
Bug: skia:
Change-Id: I1dfae0da7153b21b30fdfa51a7061fc255739a1e
Reviewed-on: https://skia-review.googlesource.com/54100
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-10-06 20:28:00 +00:00
Brian Salomon
2bbdcc44c6 Rework GrSamplerParams to be more compact and use its own wrap mode enum.
The main change is to make GrSamplerParams smaller by making its enums have byte-sized underlying types. The rest is cosmetic.

Change-Id: Ib71ea50612d24619a85e463826c6b8dfb9b445e3
Reviewed-on: https://skia-review.googlesource.com/43200
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2017-09-07 16:58:31 +00:00
Brian Osman
5127998795 Add an (optional) SkTaskGroup to GrContext
GrContextOptions has an SkExecutor field, allowing clients to supply a
thread pool. If present, the GrContext will create an SkTaskGroup that
can be used for internal threading work.

Bug: skia:
Change-Id: I8b01245515a21a83f9fe838caf0a01c9a26c0003
Reviewed-on: https://skia-review.googlesource.com/37580
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-08-23 14:33:25 +00:00
Brian Salomon
aff329b8e9 Make GrFragmentProcessor be non-refcounted and use std::unique_ptr.
Change-Id: I985e54a071338e99292a5aa2f42c92bc115b4008
Reviewed-on: https://skia-review.googlesource.com/32760
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2017-08-11 14:13:26 +00:00
Brian Osman
71a1889a14 Revert "Revert "GrContext::dump that produces JSON formatted output""
This reverts commit 0f450acd76.

Bug: skia:
Change-Id: I97428fbbc6d82bf8b186ec5fdbf1a939c00e4126
Reviewed-on: https://skia-review.googlesource.com/32726
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-08-10 15:42:25 +00:00
Brian Osman
0f450acd76 Revert "GrContext::dump that produces JSON formatted output"
This reverts commit 175af0d011.

Reason for revert: Chrome doesn't know about portable format specifiers. Sigh.

Original change's description:
> GrContext::dump that produces JSON formatted output
> 
> Includes caps, GL strings, and extensions
> 
> Bug: skia:
> Change-Id: I1e8b3dd50fb68357f9de8ca6149cf65443d027ef
> Reviewed-on: https://skia-review.googlesource.com/32340
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

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

Change-Id: Ie280b25275725f0661da7541f54ed62897abb82f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/32861
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-08-09 20:47:49 +00:00
Brian Osman
175af0d011 GrContext::dump that produces JSON formatted output
Includes caps, GL strings, and extensions

Bug: skia:
Change-Id: I1e8b3dd50fb68357f9de8ca6149cf65443d027ef
Reviewed-on: https://skia-review.googlesource.com/32340
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-08-09 18:52:05 +00:00
Greg Daniel
5131678123 Revert "Revert "Revert "Revert "Add support for semaphores to be inserted on GrContext flush""""
This reverts commit cc8eb60c48.

Reason for revert: Chrome change landed that should fix chrome roll

Original change's description:
> Revert "Revert "Revert "Add support for semaphores to be inserted on GrContext flush"""
> 
> This reverts commit 876aed8758.
> 
> Reason for revert: the bots seem to be unhappily red with this CL
> 
> Original change's description:
> > Revert "Revert "Add support for semaphores to be inserted on GrContext flush""
> > 
> > This reverts commit 8724b46099.
> > 
> > Reason for revert: Creating a test CL to see what happens on the bots
> > 
> > Original change's description:
> > > Revert "Add support for semaphores to be inserted on GrContext flush"
> > > 
> > > This reverts commit cd1416efbc.
> > > 
> > > Reason for revert: speculative, to try to fix roll see gpu_tests.pixel_integration_test.PixelIntegrationTest.Pixel_GpuRasterization_ConcavePaths
> > > 
> > > Original change's description:
> > > > Add support for semaphores to be inserted on GrContext flush
> > > > 
> > > > This also moves the logic of inserting semaphores down into GrDrawingManager
> > > > and finishFlush on GrGpu. With it being on finishFlush, there should be no
> > > > issues when the DrawingManager starts respecting the proxy passed in assuming
> > > > it always calls finishFlush at the end (which it should).
> > > > 
> > > > Bug: skia:
> > > > Change-Id: I925c2a289dcbbb9159b9120878af1d34f21a2dc7
> > > > Reviewed-on: https://skia-review.googlesource.com/25641
> > > > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > > > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > > 
> > > TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
> > > 
> > > Change-Id: I9c5b9cf8c060193e1861dbb8f0c10fb11dfb5249
> > > No-Presubmit: true
> > > No-Tree-Checks: true
> > > No-Try: true
> > > Bug: skia:
> > > Reviewed-on: https://skia-review.googlesource.com/25980
> > > Reviewed-by: Mike Reed <reed@google.com>
> > > Commit-Queue: Mike Reed <reed@google.com>
> > 
> > TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com,reed@google.com
> > 
> > # Not skipping CQ checks because original CL landed > 1 day ago.
> > 
> > Bug: skia:
> > Change-Id: I5edbeaa0769670ee58f362f0ccaa78319410aa6c
> > Reviewed-on: https://skia-review.googlesource.com/26160
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> 
> TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com,reed@google.com
> 
> Change-Id: I22fd6febafe70489a5fdb695c6f4263368eb423d
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:
> Reviewed-on: https://skia-review.googlesource.com/29422
> Reviewed-by: Yuqian Li <liyuqian@google.com>
> Commit-Queue: Yuqian Li <liyuqian@google.com>

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

Change-Id: Ie3eae818b02599a70f714ef6b6635ce7d171bde6
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/30000
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-08-02 15:10:18 +00:00
Yuqian Li
cc8eb60c48 Revert "Revert "Revert "Add support for semaphores to be inserted on GrContext flush"""
This reverts commit 876aed8758.

Reason for revert: the bots seem to be unhappily red with this CL

Original change's description:
> Revert "Revert "Add support for semaphores to be inserted on GrContext flush""
> 
> This reverts commit 8724b46099.
> 
> Reason for revert: Creating a test CL to see what happens on the bots
> 
> Original change's description:
> > Revert "Add support for semaphores to be inserted on GrContext flush"
> > 
> > This reverts commit cd1416efbc.
> > 
> > Reason for revert: speculative, to try to fix roll see gpu_tests.pixel_integration_test.PixelIntegrationTest.Pixel_GpuRasterization_ConcavePaths
> > 
> > Original change's description:
> > > Add support for semaphores to be inserted on GrContext flush
> > > 
> > > This also moves the logic of inserting semaphores down into GrDrawingManager
> > > and finishFlush on GrGpu. With it being on finishFlush, there should be no
> > > issues when the DrawingManager starts respecting the proxy passed in assuming
> > > it always calls finishFlush at the end (which it should).
> > > 
> > > Bug: skia:
> > > Change-Id: I925c2a289dcbbb9159b9120878af1d34f21a2dc7
> > > Reviewed-on: https://skia-review.googlesource.com/25641
> > > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > 
> > TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
> > 
> > Change-Id: I9c5b9cf8c060193e1861dbb8f0c10fb11dfb5249
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Bug: skia:
> > Reviewed-on: https://skia-review.googlesource.com/25980
> > Reviewed-by: Mike Reed <reed@google.com>
> > Commit-Queue: Mike Reed <reed@google.com>
> 
> TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com,reed@google.com
> 
> # Not skipping CQ checks because original CL landed > 1 day ago.
> 
> Bug: skia:
> Change-Id: I5edbeaa0769670ee58f362f0ccaa78319410aa6c
> Reviewed-on: https://skia-review.googlesource.com/26160
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

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

Change-Id: I22fd6febafe70489a5fdb695c6f4263368eb423d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/29422
Reviewed-by: Yuqian Li <liyuqian@google.com>
Commit-Queue: Yuqian Li <liyuqian@google.com>
2017-08-01 17:43:41 +00:00