aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrGpu.cpp
Commit message (Collapse)AuthorAge
* Make GrTextureProxy store a GrTextureType.Gravatar Brian Salomon2018-07-30
| | | | | | | | | | Removes flag indicating rectangle or external as its now redundant. Bug: skia: Change-Id: Ia475b557390e7a6b0f19f6e189cf8c27090e397c Reviewed-on: https://skia-review.googlesource.com/144346 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Ensure that textures exported via SkImage::MakeBackendTextureFromSkImageGravatar Brian Salomon2018-06-20
| | | | | | | | | | | have consistent content in their mip map levels. Bug= chromium:850617 Change-Id: I3ad918aa453bd8e4e625eb145de6ba2a5dab7b0c Reviewed-on: https://skia-review.googlesource.com/136230 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* Fall back to bilerp if we are undable to do a copy for mips.Gravatar Greg Daniel2018-06-08
| | | | | | | | Bug: skia: Change-Id: I52b86d83aaec1fa245be2ee17bbd56defcb5881f Reviewed-on: https://skia-review.googlesource.com/133587 Commit-Queue: Greg Daniel <egdaniel@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* Reland "Reland "Require mips to be allocated at texture creation time and ↵Gravatar Greg Daniel2018-06-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | disable late allocations."" This reverts commit 01422bc8eff0c317b9c234b3b4f5a82f1011dfce. Reason for revert: follow on change may be ready Original change's description: > Revert "Reland "Require mips to be allocated at texture creation time and disable late allocations."" > > This reverts commit 9eb36b9eb8e81e970e02fa985ae82fe64de0a8f0. > > Reason for revert: Alpha8 isn't renderable on es2 so we end up dropping draws on certain A8 mip requests > > Original change's description: > > Reland "Require mips to be allocated at texture creation time and disable late allocations." > > > > This reverts commit 0c78238e2991c95b6fb3c945d4ad2b5d941ae21b. > > > > Reason for revert: <INSERT REASONING HERE> > > > > Original change's description: > > > Revert "Require mips to be allocated at texture creation time and disable late allocations." > > > > > > This reverts commit cd2c3f9055452d413d6be7ea6dc63fd1922fe994. > > > > > > Reason for revert: Looks to be causing angle failures on initial clear test > > > > > > Original change's description: > > > > Require mips to be allocated at texture creation time and disable late allocations. > > > > > > > > If we get a non-mipped texture for a draw that wants to be use mip map filter, we > > > > will copy the texture into a new mipped texture. > > > > > > > > Clean up of unused code in the GPU backends for reallocating for mips will be done > > > > in a follow up CL. > > > > > > > > Bug: skia: > > > > Change-Id: Idab588c1abf4bbbf7eeceb3727d500e5df274188 > > > > Reviewed-on: https://skia-review.googlesource.com/132830 > > > > Reviewed-by: Brian Salomon <bsalomon@google.com> > > > > Commit-Queue: Greg Daniel <egdaniel@google.com> > > > > > > > > > > > > Change-Id: I49f0ace52f2586d61b451630b2e6aae84b420b81 > > > No-Presubmit: true > > > No-Tree-Checks: true > > > No-Try: true > > > Bug: skia: > > > Reviewed-on: https://skia-review.googlesource.com/133041 > > > Reviewed-by: Greg Daniel <egdaniel@google.com> > > > Commit-Queue: Greg Daniel <egdaniel@google.com> > > > > Bug: skia: > > Change-Id: I004447a5f1ec72c3be2318ddea803f57efb12ea4 > > Reviewed-on: https://skia-review.googlesource.com/133340 > > 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: I9e9718d380c4d9927ec39e46008750ab7396391f > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia: > Reviewed-on: https://skia-review.googlesource.com/133680 > Reviewed-by: Greg Daniel <egdaniel@google.com> > Commit-Queue: Greg Daniel <egdaniel@google.com> TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com Change-Id: Ic3df69f65a89962b21cdb50ee436a29fd121ab1f No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/133740 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
* Revert "Reland "Require mips to be allocated at texture creation time and ↵Gravatar Greg Daniel2018-06-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | disable late allocations."" This reverts commit 9eb36b9eb8e81e970e02fa985ae82fe64de0a8f0. Reason for revert: Alpha8 isn't renderable on es2 so we end up dropping draws on certain A8 mip requests Original change's description: > Reland "Require mips to be allocated at texture creation time and disable late allocations." > > This reverts commit 0c78238e2991c95b6fb3c945d4ad2b5d941ae21b. > > Reason for revert: <INSERT REASONING HERE> > > Original change's description: > > Revert "Require mips to be allocated at texture creation time and disable late allocations." > > > > This reverts commit cd2c3f9055452d413d6be7ea6dc63fd1922fe994. > > > > Reason for revert: Looks to be causing angle failures on initial clear test > > > > Original change's description: > > > Require mips to be allocated at texture creation time and disable late allocations. > > > > > > If we get a non-mipped texture for a draw that wants to be use mip map filter, we > > > will copy the texture into a new mipped texture. > > > > > > Clean up of unused code in the GPU backends for reallocating for mips will be done > > > in a follow up CL. > > > > > > Bug: skia: > > > Change-Id: Idab588c1abf4bbbf7eeceb3727d500e5df274188 > > > Reviewed-on: https://skia-review.googlesource.com/132830 > > > Reviewed-by: Brian Salomon <bsalomon@google.com> > > > Commit-Queue: Greg Daniel <egdaniel@google.com> > > > > > > > > Change-Id: I49f0ace52f2586d61b451630b2e6aae84b420b81 > > No-Presubmit: true > > No-Tree-Checks: true > > No-Try: true > > Bug: skia: > > Reviewed-on: https://skia-review.googlesource.com/133041 > > Reviewed-by: Greg Daniel <egdaniel@google.com> > > Commit-Queue: Greg Daniel <egdaniel@google.com> > > Bug: skia: > Change-Id: I004447a5f1ec72c3be2318ddea803f57efb12ea4 > Reviewed-on: https://skia-review.googlesource.com/133340 > 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: I9e9718d380c4d9927ec39e46008750ab7396391f No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/133680 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
* Reland "Require mips to be allocated at texture creation time and disable ↵Gravatar Greg Daniel2018-06-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | late allocations." This reverts commit 0c78238e2991c95b6fb3c945d4ad2b5d941ae21b. Reason for revert: <INSERT REASONING HERE> Original change's description: > Revert "Require mips to be allocated at texture creation time and disable late allocations." > > This reverts commit cd2c3f9055452d413d6be7ea6dc63fd1922fe994. > > Reason for revert: Looks to be causing angle failures on initial clear test > > Original change's description: > > Require mips to be allocated at texture creation time and disable late allocations. > > > > If we get a non-mipped texture for a draw that wants to be use mip map filter, we > > will copy the texture into a new mipped texture. > > > > Clean up of unused code in the GPU backends for reallocating for mips will be done > > in a follow up CL. > > > > Bug: skia: > > Change-Id: Idab588c1abf4bbbf7eeceb3727d500e5df274188 > > Reviewed-on: https://skia-review.googlesource.com/132830 > > Reviewed-by: Brian Salomon <bsalomon@google.com> > > Commit-Queue: Greg Daniel <egdaniel@google.com> > > > > Change-Id: I49f0ace52f2586d61b451630b2e6aae84b420b81 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia: > Reviewed-on: https://skia-review.googlesource.com/133041 > Reviewed-by: Greg Daniel <egdaniel@google.com> > Commit-Queue: Greg Daniel <egdaniel@google.com> Bug: skia: Change-Id: I004447a5f1ec72c3be2318ddea803f57efb12ea4 Reviewed-on: https://skia-review.googlesource.com/133340 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
* Revert "Require mips to be allocated at texture creation time and disable ↵Gravatar Greg Daniel2018-06-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | late allocations." This reverts commit cd2c3f9055452d413d6be7ea6dc63fd1922fe994. Reason for revert: Looks to be causing angle failures on initial clear test Original change's description: > Require mips to be allocated at texture creation time and disable late allocations. > > If we get a non-mipped texture for a draw that wants to be use mip map filter, we > will copy the texture into a new mipped texture. > > Clean up of unused code in the GPU backends for reallocating for mips will be done > in a follow up CL. > > Bug: skia: > Change-Id: Idab588c1abf4bbbf7eeceb3727d500e5df274188 > Reviewed-on: https://skia-review.googlesource.com/132830 > 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: I49f0ace52f2586d61b451630b2e6aae84b420b81 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/133041 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
* Require mips to be allocated at texture creation time and disable late ↵Gravatar Greg Daniel2018-06-07
| | | | | | | | | | | | | | | | allocations. If we get a non-mipped texture for a draw that wants to be use mip map filter, we will copy the texture into a new mipped texture. Clean up of unused code in the GPU backends for reallocating for mips will be done in a follow up CL. Bug: skia: Change-Id: Idab588c1abf4bbbf7eeceb3727d500e5df274188 Reviewed-on: https://skia-review.googlesource.com/132830 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
* Remove origin from GrGpu::readPixelsGravatar Brian Salomon2018-06-02
| | | | | | | Change-Id: I40d046c66240ab40794aa008861a1974f7f9182c Reviewed-on: https://skia-review.googlesource.com/131620 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
* Remove origin from GrGpu::writePixelsGravatar Brian Salomon2018-06-02
| | | | | | | | Change-Id: Iea3d68d282420f28623ebea315499fbd7ad9d471 Reviewed-on: https://skia-review.googlesource.com/131526 Commit-Queue: Brian Salomon <bsalomon@google.com> Auto-Submit: Brian Salomon <bsalomon@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
* Remove GrGpu::getWritePixelsInfoGravatar Brian Salomon2018-06-01
| | | | | | | | | Change-Id: I30f9eed774b0b659ee91949a234bcc112fbee035 Reviewed-on: https://skia-review.googlesource.com/131480 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com> Reviewed-by: Brian Osman <brianosman@google.com> Auto-Submit: Brian Salomon <bsalomon@google.com>
* Replace GrContextPriv::read/writeSurfacePixels with ↵Gravatar Brian Salomon2018-06-01
| | | | | | | | | | | GrContextPriv::read/WritePixels2 Change-Id: I08be0f347d360e97bf9a6d1aeb25f9f584cc3d89 Reviewed-on: https://skia-review.googlesource.com/131442 Commit-Queue: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Osman <brianosman@google.com> Auto-Submit: Brian Salomon <bsalomon@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
* Make GPU lattice/nine patch not bleed across cells.Gravatar Brian Salomon2018-05-07
| | | | | | | | | | | | | Consolidate code for handling various image/bitmap and lattice/ninepatch flavors. Makes refTextureForParams virtual on GrTextureProducer. Previously both subclasses had non-virtual flavors of this. Bug: b/77917978 Change-Id: I14787faef33c4617ef359039e81453d683f33ff1 Reviewed-on: https://skia-review.googlesource.com/125520 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Don't allow ganesh to allocate mip maps for wrapped textures.Gravatar Greg Daniel2018-04-16
| | | | | | | | | | | | | | We will not allocate new mips on a wrapped texture but we will use mips if the wrapped texture already has one. If we need mips for a draw this will trigger a copy to occur. Also some cleanup up of our InternalSurfaceFlags in general. Bug: skia:7806 Change-Id: I7aa666478cc91bba6e0644b323825fcc9b49793a Reviewed-on: https://skia-review.googlesource.com/121348 Commit-Queue: Greg Daniel <egdaniel@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
* Add texture-specific flags for External & Rectangle texturesGravatar Robert Phillips2018-03-21
| | | | | | | | | | | | | | | | For DDLs, Ganesh needs to know about External & Rectangle textures prior to instantiation (or PromiseImage fulfillment). These new flags allow the client to provide this information when the lazyProxy is created. The new texture flags work analogously to the render target flags: GrSurface and GrSurfaceProxy get a new set of accessors for the new flags The new flags are set appropriately on a GrGLTexture when it is created For wrapped texture proxies the flags are just copied off of the GrSurface For lazy-proxies/promise-images the flags are computed up front and passed to the proxy The GrSurfaceProxy/GrSurface flags equivalence is verified in GrSurfaceProxy::assign Change-Id: Ia8e1998aa0a36ce4481bfd9e56be21f990e83148 Reviewed-on: https://skia-review.googlesource.com/114985 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Correctly discard or load RT when doing copies as draws in VulkanGravatar Greg Daniel2018-03-16
| | | | | | | | | | | This fixes all the copy as draw issues we've had with certain devices and the cap is no longer needed. Bug: skia: Change-Id: Id0b750849c4c920beae2d8cb3eda5f402018f194 Reviewed-on: https://skia-review.googlesource.com/114860 Commit-Queue: Greg Daniel <egdaniel@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* Additional DDL playback cleanupGravatar Robert Phillips2018-03-08
| | | | | | | | | | This operates in tandem with https://skia-review.googlesource.com/c/skia/+/112702 ( Remove GrRestrictedAtlasManager) to get DDL playback working. Change-Id: I6c2178fde760677bf79f2cf0a2dee8b5990aa5bc Reviewed-on: https://skia-review.googlesource.com/113121 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* Initial texture data is never flipped when uploaded.Gravatar Brian Salomon2018-03-07
| | | | | | | | | 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>
* Remove GrSurfaceOrigin from GrSurfaceDesc.Gravatar Brian Salomon2018-03-05
| | | | | | | | | | | | 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>
* Introduce GrColorTypeGravatar Brian Salomon2018-02-20
| | | | | | | | | | | | | | | | | | 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>
* Drop unused support for MSAA sample locationsGravatar Chris Dalton2018-02-20
| | | | | | | | Bug: skia: Change-Id: I96f0c25732d79c5881e400b121e81c5696a747a6 Reviewed-on: https://skia-review.googlesource.com/107441 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
* Prepare sRGB encoding conversion for the removal of GrPixelConfigGravatar Brian Salomon2018-02-14
| | | | | | | | | | | | 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>
* Move default init of tmp draw params out of subclasses into GrGpuGravatar Brian Salomon2018-02-10
| | | | | | | | | I want to move srgb conversion logic to GrGpu from subclasses and I think it will make more sense if the temp draw info is fully initialized before invoking the subclass. Change-Id: Icfc4d564fc0d3c7c12f78c77f5ea921d979e290d Reviewed-on: https://skia-review.googlesource.com/106260 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Track dirty rects on GrRenderTargets in native space rather than origin-relativeGravatar Brian Salomon2018-02-09
| | | | | | | Change-Id: Icccf2fcb5d468696c42c5a0ccf405e30e5e9bc65 Reviewed-on: https://skia-review.googlesource.com/105980 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
* Remove integer texture supportGravatar Brian Salomon2018-02-06
| | | | | | | 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>
* Revert "Revert "Revert "Revert "Revert "Revert "Redefine the meaning of ↵Gravatar Brian Salomon2018-02-03
| | | | | | | | | | | | | sample counts in GPU backend."""""" This reverts commit 3a2cc2c2ec124de36d2544b2a523ef1dd317ca32. 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>
* Revert "Revert "Revert "Revert "Revert "Redefine the meaning of sample ↵Gravatar Brian Salomon2018-02-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | counts in GPU backend.""""" This reverts commit 5bb82cbecd740d21b92e8d2944280ab6eb6af7a6. 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 18c52a7b52211de5d0dcd86dc048adef758c6c75. > > 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>
* Revert "Revert "Revert "Revert "Redefine the meaning of sample counts in GPU ↵Gravatar Brian Salomon2018-02-02
| | | | | | | | | | | | | | | backend."""" This reverts commit 18c52a7b52211de5d0dcd86dc048adef758c6c75. 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>
* Revert "Revert "Revert "Redefine the meaning of sample counts in GPU backend."""Gravatar Brian Salomon2018-02-02
| | | | | | | | | | | | | | | | | | | | This reverts commit d0d7270fcc32546005b8e847df516cb11592cd30. Revert "More sample count cleanup:" This reverts commit d653cac70ed17983125ceed053138c09f1401846. Revert "Add new GrContext queries for imagability, surfacability, and max sample count of color types" This reverts commit 85ae7159c9c8a9186a4c7e74304eabb35bca9a79. 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>
* More sample count cleanup:Gravatar Brian Salomon2018-02-01
| | | | | | | | | | | | | | | | | | | rename getSampleCount -> getRenderTargetSampleCount because it will return 0 when a config is not renderable but *is* supported as a texture format. (Old name kept around until Chrome stops calling it) Add virtual GrCaps::maxRenderTargetSampleCount(GrPixelConfig). Devirtualize isConfigRenderable() and implement as maxRTSC != 0. Separate implementation for version with bool withMSAA param to be removed after Flutter is updated to no longer call. Consolidate various file static GrSurfaceDesc validators fns into GrCaps::validateSurfaceDesc(). Bug: skia: Change-Id: Ie30a291aa027e910df3bd90fac8518ccdb39e53f Reviewed-on: https://skia-review.googlesource.com/102141 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* Revert "Revert "Redefine the meaning of sample counts in GPU backend.""Gravatar Brian Salomon2018-02-01
| | | | | | | | | | | | Fixes gpu config default samples to be 1 and updates config parsing test accordingly. This reverts commit c1ce2f7966babaae0deb150f93f1227ee5af9285. 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>
* Revert "Redefine the meaning of sample counts in GPU backend."Gravatar Brian Salomon2018-02-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 48825b11ad25c98b9a4884d5cc0edd4e290c4409. 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>
* Redefine the meaning of sample counts in GPU backend.Gravatar Brian Salomon2018-02-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Revert "Drop support for unused MSAA extensions"Gravatar Robert Phillips2018-01-30
| | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 7df27465c4ecc8a4a0cdd95e9785c342903c2de9. Reason for revert: experimental revert to see if this is the cause of the tree redness Original change's description: > Drop support for unused MSAA extensions > > Bug: skia: > Change-Id: I113b80e3f991f195155148625ceb29242ea82776 > Reviewed-on: https://skia-review.googlesource.com/101403 > Reviewed-by: Brian Salomon <bsalomon@google.com> > Commit-Queue: Chris Dalton <csmartdalton@google.com> TBR=bsalomon@google.com,csmartdalton@google.com,ethannicholas@google.com Change-Id: I4fa4123e2d176bef88cd76a09a14053d9ac5809f No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/101680 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Drop support for unused MSAA extensionsGravatar Chris Dalton2018-01-29
| | | | | | | | Bug: skia: Change-Id: I113b80e3f991f195155148625ceb29242ea82776 Reviewed-on: https://skia-review.googlesource.com/101403 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
* Make use of VkSemaphores thread safe assuming use of the same VkQueue.Gravatar Greg Daniel2018-01-22
| | | | | | | | | | | | This allows us to re-enable support for multiple GrContexts in GrBackendTextureImageGenerator. Bug: skia: Change-Id: Ifd6ac1ad81cdfbd1fd986467d8beb359399d6588 Reviewed-on: https://skia-review.googlesource.com/98340 Reviewed-by: Brian Osman <brianosman@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
* Move resourceProvider accessor to GrContextPriv (take 2)Gravatar Robert Phillips2018-01-16
| | | | | | | | 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>
* Revert "Move resourceProvider accessor to GrContextPriv"Gravatar Hal Canary2018-01-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 1f9ed8501b0007846b3032f4bfc38aee98c175a1. 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>
* Move resourceProvider accessor to GrContextPrivGravatar Robert Phillips2018-01-16
| | | | | | | | 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>
* Update GrSemaphore to allow it to only be used once for signaling and once ↵Gravatar Greg Daniel2018-01-09
| | | | | | | | | | | | | for waiting. This is required for Vulkan which doesn't allow a semaphore to be waited on by multiple things at once or signaled from multiple places. Bug: skia: Change-Id: Iac0cb782a6662167c2cab1fd6a2c80378834a480 Reviewed-on: https://skia-review.googlesource.com/92601 Commit-Queue: Greg Daniel <egdaniel@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
* Remove instanced renderingGravatar Brian Salomon2017-12-08
| | | | | | | Change-Id: I4219b1d23a647b849ee41fe71b53e1c45edfc3f4 Reviewed-on: https://skia-review.googlesource.com/82241 Reviewed-by: Chris Dalton <csmartdalton@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Use enum to track MipMapsStatus throughout Texture creationGravatar Greg Daniel2017-10-12
| | | | | | | | Bug: skia: Change-Id: I1de1105d74b45f7b02ff52e6b8333801d98ef1ce Reviewed-on: https://skia-review.googlesource.com/58501 Commit-Queue: Greg Daniel <egdaniel@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* Revert "Revert "Update GrBitmapTextureMaker for handling mipped requests""Gravatar Greg Daniel2017-09-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 8b059bd946d9f14607f6d2e8b966267dd8e5a54d. Reason for revert: <INSERT REASONING HERE> Original change's description: > Revert "Update GrBitmapTextureMaker for handling mipped requests" > > This reverts commit d1935c16e889b6707a522f711e79c75353caa343. > > Reason for revert: breaking lots of GMs, especially on gles > > Original change's description: > > Update GrBitmapTextureMaker for handling mipped requests > > > > Specifically this updates the case when we are requesting to use mip > > maps but there is already an unmipped version in the cache. Previously > > we just grabbed the unmipped. > > > > Now we will create a new mipped resource. Upload the cpu data to all > > the levels besides the base, copy the base level on GPU from the > > original resource to the mipped one. Then the mipped resource will > > take over the originals unique key. > > > > Bug: skia: > > Change-Id: I38e9725c93280dc2460a0be8a7a229e7f20e1614 > > Reviewed-on: https://skia-review.googlesource.com/43840 > > Commit-Queue: Greg Daniel <egdaniel@google.com> > > Reviewed-by: Robert Phillips <robertphillips@google.com> > > TBR=egdaniel@google.com,robertphillips@google.com,brianosman@google.com > > Change-Id: Id82e8b6e8ab69e46ff018bb07ae5d1f6ea8d7e76 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia: > Reviewed-on: https://skia-review.googlesource.com/52901 > Reviewed-by: Greg Daniel <egdaniel@google.com> > Commit-Queue: Greg Daniel <egdaniel@google.com> TBR=egdaniel@google.com,robertphillips@google.com,brianosman@google.com Bug: skia: Change-Id: Ie5b9553aa67def6f9c5a61f9b6b065b9fce3ff76 Reviewed-on: https://skia-review.googlesource.com/53240 Reviewed-by: Brian Osman <brianosman@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
* Revert "Update GrBitmapTextureMaker for handling mipped requests"Gravatar Greg Daniel2017-09-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit d1935c16e889b6707a522f711e79c75353caa343. Reason for revert: breaking lots of GMs, especially on gles Original change's description: > Update GrBitmapTextureMaker for handling mipped requests > > Specifically this updates the case when we are requesting to use mip > maps but there is already an unmipped version in the cache. Previously > we just grabbed the unmipped. > > Now we will create a new mipped resource. Upload the cpu data to all > the levels besides the base, copy the base level on GPU from the > original resource to the mipped one. Then the mipped resource will > take over the originals unique key. > > Bug: skia: > Change-Id: I38e9725c93280dc2460a0be8a7a229e7f20e1614 > Reviewed-on: https://skia-review.googlesource.com/43840 > Commit-Queue: Greg Daniel <egdaniel@google.com> > Reviewed-by: Robert Phillips <robertphillips@google.com> TBR=egdaniel@google.com,robertphillips@google.com,brianosman@google.com Change-Id: Id82e8b6e8ab69e46ff018bb07ae5d1f6ea8d7e76 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/52901 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
* Update GrBitmapTextureMaker for handling mipped requestsGravatar Greg Daniel2017-09-28
| | | | | | | | | | | | | | | | | Specifically this updates the case when we are requesting to use mip maps but there is already an unmipped version in the cache. Previously we just grabbed the unmipped. Now we will create a new mipped resource. Upload the cpu data to all the levels besides the base, copy the base level on GPU from the original resource to the mipped one. Then the mipped resource will take over the originals unique key. Bug: skia: Change-Id: I38e9725c93280dc2460a0be8a7a229e7f20e1614 Reviewed-on: https://skia-review.googlesource.com/43840 Commit-Queue: Greg Daniel <egdaniel@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
* Remove pre-attachment of stencil buffersGravatar Robert Phillips2017-09-21
| | | | | | | Change-Id: I4ef555a2b36cf3a0ec74e0ecf7e8ab4f8779df3e Reviewed-on: https://skia-review.googlesource.com/49740 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* Rework GrSamplerParams to be more compact and use its own wrap mode enum.Gravatar Brian Salomon2017-09-07
| | | | | | | | | 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>
* Remove kDefault_GrSurfaceOriginGravatar Robert Phillips2017-08-30
| | | | | | | Change-Id: Ic55d488287add32e5a32b5a77415e16cebf4c1ee Reviewed-on: https://skia-review.googlesource.com/29120 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* Remove origin field from GrSurface (take 2)Gravatar Robert Phillips2017-08-29
| | | | | | | | | | | | | This mainly consists of rm origin from GrSurface and the wrapBackEnd* methods and then re-adding an explicit origin parameter to all the GrGpu methods that need it. TBR=bsalomon@google.com Change-Id: I4248b2a4749ef844da4233ce53b0dc504bc9eb74 Reviewed-on: https://skia-review.googlesource.com/30280 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* Revert "Revert "GrContext::dump that produces JSON formatted output""Gravatar Brian Osman2017-08-10
| | | | | | | | | | This reverts commit 0f450acd76fd58a2f7464f99869ed6afbfac303c. 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>