Commit Graph

635 Commits

Author SHA1 Message Date
Greg Daniel
4684f82ebc Add ability to uninstantiate lazy proxies after every flush.
Bug: skia:
Change-Id: Id32540cda54a9c5e3e6cb721776699be3cc8ac1a
Reviewed-on: https://skia-review.googlesource.com/113263
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-03-08 21:05:21 +00:00
Brian Salomon
58389b90cd Initial texture data is never flipped when uploaded.
The first bytes of the data always refer to the pixel accessed by texture coord (0, 0).

Change-Id: I708702d90f35b3bc896a48c3c3fd6a0be73f505a
Reviewed-on: https://skia-review.googlesource.com/112261
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-03-07 18:22:40 +00:00
Greg Daniel
fcea56c5d8 Make GrReleaseProcHelper an SkWeakRefCnt
Bug: skia:
Change-Id: Iccc22d477c17c4c58615e3f3bf9e551f9596b710
Reviewed-on: https://skia-review.googlesource.com/112562
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-03-07 02:30:35 +00:00
Robert Phillips
94458ee0f2 Add SkSurfaceCharacterization::createResized
Change-Id: Ia98ce3cf6c0b9f9100eea9850af56048e43b8d07
Reviewed-on: https://skia-review.googlesource.com/112580
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-03-06 19:08:46 +00:00
Brian Salomon
2a4f983c94 Remove GrSurfaceOrigin from GrSurfaceDesc.
This field has no interpretation at the GrTexture/GrGpu as the orientation is
handled at the GrSurfaceProxy level.

This change requires GrGpu to accept a GrSurfaceOrigin when creating a texture with initial data. The origin refers to the texel data to be uploaded. Longer term the plan is to remove this and require the data to be kTopLeft. Additionally, kBottomLeft will only be allowed for wrapped texture/RTs as this evolves.

Change-Id: I7d25b0199aafd9bf3b74c39b2cae451acadcd772
Reviewed-on: https://skia-review.googlesource.com/111806
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-03-05 18:50:25 +00:00
Brian Osman
10fc6fddf2 Revert "Revert "Add 1010102 support to Ganesh""
This reverts commit ded47a5014.

Bug: skia:
Change-Id: I7d7552e6ccc8591cae91426407ab13b628b93b68
Reviewed-on: https://skia-review.googlesource.com/111760
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-03-02 18:19:50 +00:00
Robert Phillips
fde6fa0903 Fix creation of extra GrContextThreadSafeProxies in DDL world
For the DDLContexts we simply want to reuse the threadSafeProxy from the main thread but we, obviously, still need to create one for the main DirectContext.

TBR=bsalomon@google.com
Change-Id: I99449bc375172c9004e2e80c21d95ab2d7708309
Reviewed-on: https://skia-review.googlesource.com/110781
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-03-02 17:10:30 +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
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
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
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
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
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
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
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
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
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
Robert Phillips
7d79e7b588 Use a lazy proxy in OnFlushCallbackTest to fulfill some old TODOs
Change-Id: I194e38c87c2f341f16a5048f02027165d7c28ae9
Reviewed-on: https://skia-review.googlesource.com/107022
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2018-02-14 16:31:47 +00:00
Greg Daniel
0ee866dac7 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>
2018-02-14 14:40:48 +00:00
Greg Daniel
8242c5c199 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>
2018-02-14 14:07:47 +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
Robert Phillips
ce5209a8a5 Make fully lazy proxies possess an origin
Change-Id: Icd3d68bce78568562aa12167a58b6d6e5064b124
Reviewed-on: https://skia-review.googlesource.com/106901
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-02-13 21:25:53 +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
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
faffa86771 begin to wrap all float divides
Bug: skia:7607 skia:6134
Change-Id: Id126e92816bef1df1372bd531238cda9f3b36fab
Reviewed-on: https://skia-review.googlesource.com/106261
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2018-02-12 19:04:19 +00:00
Greg Daniel
d2d8e92e5e Remove tracking of SkDestinationSurfaceColorMode on GrTextureProxy for mips
When we create a new surface from a proxy we were always using legacy and
when we wrapped an existing surface we never actaully had to use the value
we pulled off of it since the proxy was already instantiatied.

Bug: skia:
Change-Id: Ifcb5f3ac2f1dcf41b01a98c554d682ae57028d5a
Reviewed-on: https://skia-review.googlesource.com/106207
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-02-12 18:51:28 +00:00
Kevin Lubick
2416f968a6 Add 2 fuzz targets for image decoding (oss-fuzz)
This also adds in a few small guards to prevent libfuzzer from frequently
running out of memory when an image claims to have billions of pixels.

Bug: skia:
Change-Id: I47a9daac832c4d85a42000698482b61721c38880
Reviewed-on: https://skia-review.googlesource.com/106264
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
2018-02-12 15:25:59 +00:00
Greg Daniel
3b2ebbb2d4 When querying mipmapped on proxies return targets state if possible
In the non-ddl world where we are still using lazy proxies, we may create
those proxies with no mipmaps, but when we instantiate them immediately we
end up getting a surface with mips. This allows future queries on that
proxy to take advatage of the fact that we actaully have mips.

For lazy ddl proxies, this makes it work in a world where we may decide to
uninstantiate the proxies and we continue to track the request mip level as
well as the actually one from instantiation.

Bug: skia:
Change-Id: I4824e74d5e2a2fdf860709c85469aa8cf74632d5
Reviewed-on: https://skia-review.googlesource.com/106121
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-02-09 16:14:51 +00:00
Greg Daniel
457469c7a0 Make non-ddl lazy proxys clean-up and delete their callbacks immediately after instanstation.
This makes sure resources are released and free'd as soon as possible if we
no longer need them.

Bug: skia:
Change-Id: Ic216987649c54183f8cbbff90a633860a97754b3
Reviewed-on: https://skia-review.googlesource.com/105721
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-02-08 20:33:40 +00:00
Robert Phillips
4150eea6c4 Move control of explicit GPU resource allocation to GrContextOptions
Change-Id: Ic284acc79bab5936f0007d5ae5fb1e7a9929e2af
Reviewed-on: https://skia-review.googlesource.com/104880
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2018-02-08 12:36:29 +00:00
Robert Phillips
8e546043c6 Revert "Re-enable explicit resource allocation in Skia (take 2)"
This reverts commit ed858ec095.

Reason for revert: Breaking some text GMs

Original change's description:
> Re-enable explicit resource allocation in Skia (take 2)
> 
> Unsurprisingly, given how we're adding them to the opList's deferredProxy list, a proxy can appear twice.
> 
> Change-Id: I474357a1c3ee8cedf51dbeffcd0e0a96f396375c
> Reviewed-on: https://skia-review.googlesource.com/103701
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

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

Change-Id: I90aa30c37bfc506e5a8e4c2ccf3bd1b968fd9c5f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/105100
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-02-07 16:02:50 +00:00
Robert Phillips
ed858ec095 Re-enable explicit resource allocation in Skia (take 2)
Unsurprisingly, given how we're adding them to the opList's deferredProxy list, a proxy can appear twice.

Change-Id: I474357a1c3ee8cedf51dbeffcd0e0a96f396375c
Reviewed-on: https://skia-review.googlesource.com/103701
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-02-07 14:22:58 +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
5711133a1b Remove integer texture support
Change-Id: I0db1c4d705711b8d980bbe0d986013daec6c8ef3
Reviewed-on: https://skia-review.googlesource.com/103762
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-02-06 12:56:46 +00:00
Robert Phillips
11bdbe0013 Revert "Re-enable explicit resource allocation in Skia"
This reverts commit ac18b46904.

Reason for revert: erg - bit rot

Original change's description:
> Re-enable explicit resource allocation in Skia
> 
> I can no longer repro the bug (assignment of the same GrTexture to both
> sides of a dest read) locally. Let's see what the bots have to say.
> 
> Change-Id: Ia71bb6fb44c5b8dc3dd870f7b20e12a6db70e26c
> Reviewed-on: https://skia-review.googlesource.com/103581
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

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

Change-Id: I5264986d3ddd439e5944c801b5d9113283921308
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/103660
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-02-05 16:19:57 +00:00
Robert Phillips
ac18b46904 Re-enable explicit resource allocation in Skia
I can no longer repro the bug (assignment of the same GrTexture to both
sides of a dest read) locally. Let's see what the bots have to say.

Change-Id: Ia71bb6fb44c5b8dc3dd870f7b20e12a6db70e26c
Reviewed-on: https://skia-review.googlesource.com/103581
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-02-05 15:56:06 +00:00
Robert Phillips
e8fabb2665 Update LazyProxy creation to allow for a non-textureable result
Change-Id: Ic284b4f4220afa714159e07f57798a94fd40d63a
Reviewed-on: https://skia-review.googlesource.com/102484
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2018-02-04 20:01:28 +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