Commit Graph

2147 Commits

Author SHA1 Message Date
Brian Osman
57bc3ea6fa Expose srgbDecodeDisableSupport in GrCaps
This will allow Flutter to workaround the lack of this extension on a
small number of devices.

Bug: skia:
Change-Id: I46e54aaffc0551a7a17758ebc2016b39bda19abf
Reviewed-on: https://skia-review.googlesource.com/27440
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-07-27 14:18:43 +00:00
Greg Daniel
02611d9afd Add Make[backend] calls for creating GrContexts
Docs-Preview: https://skia.org/?cl=26369
Bug: skia:
Change-Id: I460ee63e466f85b05918479f068a2e5ca2d70550
Reviewed-on: https://skia-review.googlesource.com/26369
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-07-25 14:33:03 +00:00
Mike Reed
8724b46099 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>
2017-07-22 17:34:00 +00:00
Greg Daniel
cd1416efbc 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>
2017-07-22 01:03:06 +00:00
Mike Klein
7634330c98 reduce code size in GrGLTestInterface.o and GrGLAssembleInterface.o
All these std::function instantiations fill the object files up with
almost 1MB of boilerplate generated code.  I think we can do better by
implementing GrGLFunction as its own std::function-like type with much
less overhead, bringing the total object file size down to about 200K.

This reduces DM from 28780344 to 27726144 on my Mac, a touch above 1MB.

Change-Id: I219a86737d1dfb8b68e4eb47b51a8a98b18ff282
Reviewed-on: https://skia-review.googlesource.com/20551
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-07-21 16:51:33 +00:00
Greg Daniel
8761e0c546 Add ability to pre-initialize vulkan semaphores when flushing surfaces
Bug: skia:
Change-Id: I2d3eb68d2ac6045fe3e30350fdd21140e22861d7
Reviewed-on: https://skia-review.googlesource.com/24645
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-07-20 20:59:52 +00:00
Brian Salomon
807371c15b Revert "Remove GrBackendRenderTargetDesc in favor of GrBackendRenderTarget."
This reverts commit e2d37c2a07.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Remove GrBackendRenderTargetDesc in favor of GrBackendRenderTarget.
> 
> Also removes a reference to GrBackendTextureDesc in a comment and updates markdown docs.
> 
> Docs-Preview: https://skia.org/?cl=24861
> Bug: skia:
> Change-Id: Ic6490d5ef46953450e6dee69271397bb2b94d0d6
> Reviewed-on: https://skia-review.googlesource.com/24861
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

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

Change-Id: I4b85b529727f0bf5aec21d87e725a8195666e2e5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/25182
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-07-20 20:48:23 +00:00
Brian Salomon
e2d37c2a07 Remove GrBackendRenderTargetDesc in favor of GrBackendRenderTarget.
Also removes a reference to GrBackendTextureDesc in a comment and updates markdown docs.

Docs-Preview: https://skia.org/?cl=24861
Bug: skia:
Change-Id: Ic6490d5ef46953450e6dee69271397bb2b94d0d6
Reviewed-on: https://skia-review.googlesource.com/24861
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-07-20 20:28:57 +00:00
Greg Daniel
dba7e7ccfb Add test for flushing empty surface with semaphores
Bug: skia:
Change-Id: I8d7dcb29c5b4c460aa5137842caf6563448ba5d3
Reviewed-on: https://skia-review.googlesource.com/25181
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-07-20 20:26:28 +00:00
Brian Salomon
d17f6584df Remove GrBackendTextureDesc
Change-Id: I2b123d1782400e97ab2ce2f11e3e3d325a13e6c8
Reviewed-on: https://skia-review.googlesource.com/24748
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-07-20 00:21:18 +00:00
Greg Daniel
81e7bf8d6d Update gpu caps for valid sample counts.
Instead of query and maxSampleCount and using that to cap, we now have
each config store its supported values and when requested returns either
the next highest or equal supported value, or if non the max config supported.

Bug: skia:
Change-Id: I8802d44c13b3b1703ee54a7e69b82102d4b8dc2d
Reviewed-on: https://skia-review.googlesource.com/24302
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-07-19 19:13:25 +00:00
Brian Salomon
e5b399ee69 Remove GrLegacyMeshDrawOp and GrPipelineBuilder
Change-Id: Ib301a0e7d4b4c4f05417d28862017307949748c9
Reviewed-on: https://skia-review.googlesource.com/23584
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2017-07-19 18:16:05 +00:00
Brian Salomon
c5886036cb Move GrTypesPriv.h to include/private
Bug: skia:
Change-Id: I68610fed67a70454a815229c47b78ea6d9463a43
Reviewed-on: https://skia-review.googlesource.com/24624
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-07-19 17:16:14 +00:00
Chris Dalton
1a325d25b9 Coverage counting path renderer
Initial implementation of a GPU path renderer that draws antialiased
paths by counting coverage in an offscreen buffer.

Initially disabled until it has had time to soak.

Bug: skia:
Change-Id: I003d8cfdf8dc62641581b5ea2dc4f0aa00108df6
Reviewed-on: https://skia-review.googlesource.com/21541
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-07-14 21:45:35 +00:00
Greg Daniel
b76a72a659 Add support for creating a GrContext backed by Metal.
Also adds the support code to allow our TestContext to create a Metal
backend.

Bug: skia:
Change-Id: Ia850687019d79b897bb16e2c151f4f8526721ad9
Reviewed-on: https://skia-review.googlesource.com/22644
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-07-13 21:29:33 +00:00
Brian Salomon
8fe24272fa Add mock config to tools and run through gms and benchs without crashing.
Change-Id: I7e2474129ef2b15899ad2baeb8d18f39d05da98c
Reviewed-on: https://skia-review.googlesource.com/21820
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2017-07-07 20:47:38 +00:00
Brian Salomon
ec045b4312 Add SK_API to GrBackendTexture and GrBackendRenderTarget
Change-Id: Ibae248bf8e2d2da860e99b62346e737da55a85b5
Reviewed-on: https://skia-review.googlesource.com/21827
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-07-07 16:57:25 +00:00
Brian Salomon
cfe910dc79 Revert "Revert "Make mock GrContext unit testable.""
This reverts commit c867a89b01.

Reason for revert: test

Original change's description:
> Revert "Make mock GrContext unit testable."
> 
> This reverts commit 993e7e2521.
> 
> Reason for revert: Seeing if this fixes the NexusPlayer bots
> 
> Original change's description:
> > Make mock GrContext unit testable.
> > 
> > Bug: skia:
> > Change-Id: I959122f1f2c390832ab1033bcdbdd2ca6cfc0419
> > Reviewed-on: https://skia-review.googlesource.com/20699
> > Reviewed-by: Greg Daniel <egdaniel@google.com>
> > Commit-Queue: Brian Salomon <bsalomon@google.com>
> 
> TBR=egdaniel@google.com,bsalomon@google.com
> 
> Change-Id: I25ed9329962d930fe38108f779ff7083e0e4847e
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:
> Reviewed-on: https://skia-review.googlesource.com/21731
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

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

Change-Id: I62c579e087db1ff9891cf6c41b3eb40f47561887
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/21733
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-07-06 21:59:18 +00:00
Brian Salomon
c867a89b01 Revert "Make mock GrContext unit testable."
This reverts commit 993e7e2521.

Reason for revert: Seeing if this fixes the NexusPlayer bots

Original change's description:
> Make mock GrContext unit testable.
> 
> Bug: skia:
> Change-Id: I959122f1f2c390832ab1033bcdbdd2ca6cfc0419
> Reviewed-on: https://skia-review.googlesource.com/20699
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

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

Change-Id: I25ed9329962d930fe38108f779ff7083e0e4847e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/21731
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-07-06 18:21:37 +00:00
Brian Salomon
993e7e2521 Make mock GrContext unit testable.
Bug: skia:
Change-Id: I959122f1f2c390832ab1033bcdbdd2ca6cfc0419
Reviewed-on: https://skia-review.googlesource.com/20699
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-07-06 15:25:35 +00:00
Greg Daniel
e5ddff5553 Add basic metal build files for backend
Bug: skia:
Change-Id: Iddeeb91b378bdb61d200070d8faa3610299ab733
Reviewed-on: https://skia-review.googlesource.com/21533
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-07-05 21:12:40 +00:00
Brian Salomon
91a3e52552 Move mock gpu and caps, add Gr prefix, and create via GrContext::Create
Change-Id: I02427839f78372e337ed717b071c6baaa8ba4450
Reviewed-on: https://skia-review.googlesource.com/20622
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-06-23 15:42:15 +00:00
Greg Daniel
a5cb781c17 Revert "Revert "Add API for flushing surfaces with gpu semaphores""
This reverts commit 7292231905.

This change relands the original plus the follow on change:
https://skia-review.googlesource.com/20059.

Additionally it adds a blacklist for the mac intel bots which
don't see to respect the added fences on the GPU.

Original change's description:
> Revert "Add API for flushing surfaces with gpu semaphores"
> 
> This reverts commit 66366c6978.
> 
> Reason for revert: Failing test on mac bots
> 
> Original change's description:
> > Add API for flushing surfaces with gpu semaphores
> > 
> > BUG=skia:
> > 
> > Change-Id: Ia4bfef784cd5f2516ceccafce958be18a86f91d1
> > Reviewed-on: https://skia-review.googlesource.com/11488
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Reviewed-by: Forrest Reiling <freiling@google.com>
> 
> TBR=egdaniel@google.com,jvanverth@google.com,bsalomon@google.com,brianosman@google.com,freiling@google.com
> 
> Change-Id: I75633a2732d2d48b1926f9ad818a9f1a9196d211
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:
> Reviewed-on: https://skia-review.googlesource.com/20063
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,jvanverth@google.com,bsalomon@google.com,brianosman@google.com,freiling@google.com

Change-Id: I4dc6c0e1deb0398eeb165a34f0a26af7a58259f1
Reviewed-on: https://skia-review.googlesource.com/20141
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2017-06-16 14:22:34 +00:00
Robert Phillips
881f143aec Hide GrGpuResourceRef from prying eyes
Change-Id: I5535b8cc8e82ed4b6fe847b96b417531b4bae348
Reviewed-on: https://skia-review.googlesource.com/19967
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-06-16 12:17:18 +00:00
Greg Daniel
7292231905 Revert "Add API for flushing surfaces with gpu semaphores"
This reverts commit 66366c6978.

Reason for revert: Failing test on mac bots

Original change's description:
> Add API for flushing surfaces with gpu semaphores
> 
> BUG=skia:
> 
> Change-Id: Ia4bfef784cd5f2516ceccafce958be18a86f91d1
> Reviewed-on: https://skia-review.googlesource.com/11488
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Forrest Reiling <freiling@google.com>

TBR=egdaniel@google.com,jvanverth@google.com,bsalomon@google.com,brianosman@google.com,freiling@google.com

Change-Id: I75633a2732d2d48b1926f9ad818a9f1a9196d211
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/20063
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2017-06-15 21:55:03 +00:00
Greg Daniel
66366c6978 Add API for flushing surfaces with gpu semaphores
BUG=skia:

Change-Id: Ia4bfef784cd5f2516ceccafce958be18a86f91d1
Reviewed-on: https://skia-review.googlesource.com/11488
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Forrest Reiling <freiling@google.com>
2017-06-15 19:49:18 +00:00
Chris Dalton
b894c2b339 Fix failing dm with GrPrimitiveType::kLinesAdjacency
Bug: skia:
Change-Id: I9a73ec49b2bf10700ca95c2073b84cfb606d2fec
Reviewed-on: https://skia-review.googlesource.com/19722
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Ravi Mistry <rmistry@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-06-14 19:15:09 +00:00
Brian Salomon
e225b565fc Force AAType to MSAA if the render target has MSAA and the API doesn't support disabling it.
Change-Id: I88c29b8117fa82c6f41166b9333537a06bb841cc
Reviewed-on: https://skia-review.googlesource.com/19818
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-06-14 17:50:47 +00:00
Robert Phillips
fcd5fddb02 Revert "Revert "Update skia to use ifdefs for Vulkan code instead of dummy header""
This reverts commit fad9e3f541.

Reason for revert: Can't find the error message anymore (?!?) Let's try again shall we

Original change's description:
> Revert "Update skia to use ifdefs for Vulkan code instead of dummy header"
> 
> This reverts commit c0f8e426c5.
> 
> Reason for revert: Experiment to see if this will unblock the Android roll
> 
> Original change's description:
> > Update skia to use ifdefs for Vulkan code instead of dummy header
> > 
> > Bug: skia:6721
> > Change-Id: I80a4c9f2acc09c174497f625c50ed12a8bb76505
> > Reviewed-on: https://skia-review.googlesource.com/19547
> > Reviewed-by: Mike Klein <mtklein@google.com>
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> 
> TBR=egdaniel@google.com,mtklein@google.com,bsalomon@google.com
> 
> Change-Id: Ib51c1672570f2071a17b6fbde692a5174b0358ce
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:6721
> Reviewed-on: https://skia-review.googlesource.com/19724
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

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

Change-Id: Iecef7ddcfe31d82938336120a4193525ac6693be
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:6721
Reviewed-on: https://skia-review.googlesource.com/19782
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-06-14 01:43:38 +00:00
Robert Phillips
fad9e3f541 Revert "Update skia to use ifdefs for Vulkan code instead of dummy header"
This reverts commit c0f8e426c5.

Reason for revert: Experiment to see if this will unblock the Android roll

Original change's description:
> Update skia to use ifdefs for Vulkan code instead of dummy header
> 
> Bug: skia:6721
> Change-Id: I80a4c9f2acc09c174497f625c50ed12a8bb76505
> Reviewed-on: https://skia-review.googlesource.com/19547
> Reviewed-by: Mike Klein <mtklein@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

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

Change-Id: Ib51c1672570f2071a17b6fbde692a5174b0358ce
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:6721
Reviewed-on: https://skia-review.googlesource.com/19724
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-06-13 22:16:19 +00:00
Greg Daniel
c0f8e426c5 Update skia to use ifdefs for Vulkan code instead of dummy header
Bug: skia:6721
Change-Id: I80a4c9f2acc09c174497f625c50ed12a8bb76505
Reviewed-on: https://skia-review.googlesource.com/19547
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-06-13 18:50:03 +00:00
Chris Dalton
3809bab7ed Add GrPrimitiveType::kLinesAdjacency
Converts GrPrimitiveType to an enum class and adds kLinesAdjacency.

Bug: skia:
Change-Id: I3b5e68acfb20476f6c6923968f5a4ac4f73ae12d
Reviewed-on: https://skia-review.googlesource.com/19680
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2017-06-13 18:18:23 +00:00
Ravi Mistry
7cd974fc7d Revert "Add GrPrimitiveType::kLinesAdjacency"
This reverts commit f7eb015083.

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


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

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

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

Bug: skia:
Change-Id: If57d26277182aac1375e8181211ddaf7ea6d1e0a
Reviewed-on: https://skia-review.googlesource.com/19581
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2017-06-13 14:25:21 +00:00
Robert Phillips
c4f0a8245c Move Flags from GrRenderTarget to GrTypesPriv.h & rename
The motivation for this is to prevent GrRenderTarget.h appearing in GrRenderTargetProxy.h

Change-Id: I4ef126972c0780cbacb35fa2aa6290777c66eddf
Reviewed-on: https://skia-review.googlesource.com/19521
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-06-13 13:12:17 +00:00
Brian Salomon
9bada5475f Revert "Revert "Expand partial render target write pixels workaround.""
New version limits the workaround to unorm configs.

This reverts commit fdd117025f.

Change-Id: I47a08a0ea4cf1acd88ca3c1bf9922cf0a8d215cc
Reviewed-on: https://skia-review.googlesource.com/19490
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-06-12 19:31:53 +00:00
Robert Phillips
c9c06d4586 Remove GrTGpuResourceRef specializations
This template is only used for GrBuffers now.

Change-Id: Ia9e95576b01124657e64007231fbc0a83276e13f
Reviewed-on: https://skia-review.googlesource.com/19484
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-06-12 15:24:44 +00:00
Robert Phillips
3ea1798829 Remove ImmediateFlush mode
Change-Id: I7db113e66d81516b2beb5eefeddf488d9bfed2e5
Reviewed-on: https://skia-review.googlesource.com/18488
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-06-02 17:35:18 +00:00
Robert Phillips
fe50d9696a Remove GrSurface-based surfaceContext factories from GrContextPriv
This relies on both:
   https://skia-review.googlesource.com/c/13001/ (Rm makeRenderTargetContext in favor of deferred version)
   https://skia-review.googlesource.com/c/11125/ (Remove discard from GrRenderTarget & force it to always go through a RenderTargetContext)

Change-Id: Ia06469a6fa0048e162fb769ed4a11e4773cfacca
Reviewed-on: https://skia-review.googlesource.com/13130
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-06-01 14:47:31 +00:00
Chris Dalton
1d6163577c Add support for instanced draws
Adds an instance buffer to GrMesh and instance attribs to
GrPrimitiveProcessor. Implements support in GL and Vulkan. Adds unit
tests for instanced rendering with GrMesh.

Bug: skia:
Change-Id: If1a9920feb9366f346b8c37cf914713c49129b3a
Reviewed-on: https://skia-review.googlesource.com/16200
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2017-05-31 20:40:20 +00:00
Robert Phillips
5efd5ea4e1 Update clearOp for split-OpList world (take 3)
It would reduce a lot of noise if the GrRenderTargetOpList kept a pointer to the GrCaps but, for now, I'm trying to shrink the GrRTOpList, not expand it.

Reland of: https://skia-review.googlesource.com/c/17323/ (Update clearOp for split-OpList world)

Change-Id: Ia61ce4d6ce245380fc9651928a46c22039fc12cf
Reviewed-on: https://skia-review.googlesource.com/18026
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-05-31 17:00:22 +00:00
Brian Salomon
fdd117025f Revert "Expand partial render target write pixels workaround."
This reverts commit 0cc507d225.

Reason for revert: Causing IntTextureText to fail on bots

Original change's description:
> Expand partial render target write pixels workaround.
> 
> The workaround is extended in the following ways:
> 
> 1) It now applies to any texture whose base level has *ever* been attached to a FBO.
> 2) It applies to Adreno 5xx in addition to Adreno 4xx
> 3) It applies in the atlas upload code path.
> 
> This workaround (and a similar one) are narrowed to GLCaps rather than Caps.
> 
> Bug: skia:
> Change-Id: Id600e9739bb97bf6766075ea2a987fd2039e53e5
> Reviewed-on: https://skia-review.googlesource.com/18150
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> 

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

Change-Id: I53c8dd7ea7f614da57331470fcc24c6d84aba354
Reviewed-on: https://skia-review.googlesource.com/18229
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-05-31 16:22:03 +00:00
Brian Salomon
0cc507d225 Expand partial render target write pixels workaround.
The workaround is extended in the following ways:

1) It now applies to any texture whose base level has *ever* been attached to a FBO.
2) It applies to Adreno 5xx in addition to Adreno 4xx
3) It applies in the atlas upload code path.

This workaround (and a similar one) are narrowed to GLCaps rather than Caps.

Bug: skia:
Change-Id: Id600e9739bb97bf6766075ea2a987fd2039e53e5
Reviewed-on: https://skia-review.googlesource.com/18150
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-05-31 14:38:43 +00:00
Derek Sollenberger
5480a18d87 Add method to GrContext to purge unlocked resources.
Beyond setting the total cache limits this method enables clients to
request to purge a specific number of bytes, as well as specify their
preference to purge scratch resources over resources of other types.

Change-Id: I9259d5544d34251575d77eebe599388f213ff3ce
Reviewed-on: https://skia-review.googlesource.com/17987
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
2017-05-26 18:14:33 +00:00
Brian Salomon
1c21431324 Revert "Clear atlas textures at creation in Chrome"
This reverts commit 8785df15fe.

Reason for revert: Chrome bug
Bug: chromium:726226

Original change's description:
> Clear atlas textures at creation in Chrome
> 
> Bug: chromium:656320
> Change-Id: Ia65274aa733f199be188579821e745920493aefc
> Reviewed-on: https://skia-review.googlesource.com/17824
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> 

TBR=bsalomon@google.com,robertphillips@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: chromium:656320

Change-Id: Ibc4dd7f184866b58481f2dc7e7e88da9169e7adc
Reviewed-on: https://skia-review.googlesource.com/17988
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-05-25 20:03:07 +00:00
Brian Osman
ac1e4964e7 Workaround Mali static analysis bug
Comment describes it: Unless we do something to confuse their optimizer,
they will (incorrectly) deduce that uniform opaque color (modulated only
by a texture fetch) is always going to remain opaque. Then they skip
inserting their shader based blending code, turning SrcOver into Src.

Doing a max against zero is enough to squelch the optimization.

Bug: skia:
Change-Id: I74676cebb0b0c8d121da868dd8a88050e0cfcc0d
Reviewed-on: https://skia-review.googlesource.com/17924
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-05-25 16:15:07 +00:00
Derek Sollenberger
ee47914ae5 Add GrContext API to report the number of purgeable bytes in the cache.
Change-Id: I1457eec9831736f386e3b3b80d9eac8dbb337a9b
Reviewed-on: https://skia-review.googlesource.com/17829
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
2017-05-24 17:08:45 +00:00
Brian Salomon
8785df15fe Clear atlas textures at creation in Chrome
Bug: chromium:656320
Change-Id: Ia65274aa733f199be188579821e745920493aefc
Reviewed-on: https://skia-review.googlesource.com/17824
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-05-24 16:04:45 +00:00
Brian Salomon
d17b4a678b Revert "Revert "Add a flag to GrSurfaceFlags that requires the texture to be cleared upon creation. ""
This reverts commit a9e795eab5.

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

Reason for revert: :'(

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

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

Change-Id: I8a4f71537e45f3c4cf37b10b2dc8ee38fe6959ba
Reviewed-on: https://skia-review.googlesource.com/17765
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-05-23 19:03:01 +00:00