Commit Graph

9742 Commits

Author SHA1 Message Date
Brian Osman
bb651c4902 Remove old version of SkImage::makeTextureImage
Client code has been updated to call new version

Change-Id: Id7e18154fe273590f04435c936121b3a3e3665df
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235317
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-08-16 19:01:55 +00:00
Brian Osman
237a95fe7b Remove old version of MakeCrossContextFromPixmap
Client code has been updated

Change-Id: Ic6102effc63c0f4f00a47b8876107aa0b2306e32
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235296
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-08-16 17:41:35 +00:00
Hal Canary
bb108480ec SkMallocPixelRef: remove MakeDirect and MakeWithProc from API.
Not currently used by any clients.

Change-Id: I21d554fb95ffef4f317945ab22c4cfb14fbb6b2a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/234660
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-08-15 19:01:13 +00:00
Ben Wagner
c86cf3cdb3 Restore SkFontMetrics documentation.
With 462505f310 "include refresh" most of
the useful parts of the SkFontMetrics documentation were removed.
Restore the documentation and update it with the latest information.

Change-Id: I28c13bc194b53265818e31e7b26e93a390f6259c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/234945
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-08-15 18:11:39 +00:00
Brian Osman
4c3fd34e00 Remove MakeCrossContextFromEncoded, unused argument from ...FromPixmap
Change-Id: I962e923a4994eb549a9c1002323f33d05b936b84
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/234912
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-08-15 17:10:28 +00:00
Brian Salomon
096b091874 Make GrBlend.h private
Change-Id: I77f3dbc80d85d3a19e8986dae42450ee5b8c07a7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/234668
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-08-15 13:34:57 +00:00
Brian Osman
d514837136 Add SkImage::reinterpretColorSpace
This reinterprets the contents of an image as though they were in a
different color space. Helpful for tools and debug visualization.

Bug: chromium:795132 chromium:985500
Change-Id: Ia8739bbd73d72249b8bee9d51dfa11d560a2a1f5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/234328
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-08-15 13:30:41 +00:00
Brian Salomon
201cdbb646 Make GrSamplerState.h and GrRenderTarget.h private
Change-Id: Id7a270f5a528e1a4a6d94474fa092545252753b3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/234667
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-08-15 12:22:11 +00:00
Greg Daniel
7bfc9139c6 Remove GrCaps isConfigTexturable.
This also makes the isTexturable that takes a color explicitly called
isFormatTexturableAndUploadable. A lot of the uses of isConfigTexturable
were changed to the Uploadable version of the check, even though this is
not where we want to land in the long run. In the long run the uploadability
will be checked via calls to supportedWritePixelsColorType and all the
isTexturable calls should purely be about texturing. However, until those
changes land we keep it safe and keep the same functionality that
isConfigTexturable had by checking uploadability as well.

Bug: skia:6718
Change-Id: I3563f33f49811923da80e676fa3036ae46c4da70
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/234323
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-08-14 19:30:45 +00:00
Brian Osman
d566e2eab7 Remove unused dstColorSpace parameter from makeTextureImage
Old version still exists until client code is migrated.

Change-Id: I087b6b977f586d334f9a20954e7ed7b5e4b7ea5e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/234579
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-08-14 19:09:05 +00:00
Hal Canary
735f1d2f02 SkMallocPixelRef: hide implementation
Change-Id: Ie0af47ed842769a3f47056bb1d633c84fa4d06d6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/234329
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2019-08-14 16:21:02 +00:00
Leon Scroggins III
6154ac4311 Hook up SkHeifCodec for ImageDecoder animation
bug: 78868457
bug: 120414514

test: local test with OpenGL Rendrerer Tests animation
demo and heifs files

Change-Id: I09a7667a57f545927dbe9ac24c1a6b405ff0006d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/232839
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Auto-Submit: Chong Zhang <chz@google.com>
2019-08-14 16:02:32 +00:00
Chris Dalton
3d77027d26 Reland "Initiate regeneration of mipmaps from proxy DAG land"
This is a reland of fe19203eb7

Original change's description:
> Initiate regeneration of mipmaps from proxy DAG land
> 
> This allows us to resolve all the textures before executing a command
> buffer, rather than interrupting execution as is currently done in the
> GL backend.
> 
> Change-Id: I998546b312d24cf47fc2c837e7c94fbf95571af0
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230636
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

Change-Id: Ic904d0b1bcb451bcb74cfae2204fb7297eaff108
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/234016
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-08-14 16:01:31 +00:00
Mike Reed
a5acbf940e expose direct methods for decoding to an image
These are meant to contrast MakeFromEncoded(), and emphasize that it is deferred/cached,
while the new methods are not.

Change-Id: I83ac22394cb14cdc84ff8507a514bf708734b84f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/234476
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-08-14 15:49:32 +00:00
Brian Salomon
67529b2543 SkSL GLSL generator writes default precision for sampler2D/samplerExternalOS/sampler2DRect
This is a stop gap. We should probably base the precision decision on the texture format.

Also removes all code used to add sampler precision to program keys. The precision that
was added to the key did not affect the generated GLSL.

Bug: skia:8863
Bug: skia:6718
Change-Id: Ibdb702e1aca5d48d83e2f24cb24010a0b7270871
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/234322
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-08-14 13:29:57 +00:00
Robert Phillips
f75996469d Make defaultBackendFormat callable from anywhere in the GrContext hierarchy
This is probably overkill but yields an officially thread-safe means of calling defaultBackendFormat.

Change-Id: Ibf344acf11102d938e335e9ea38bfaee575e00c5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/234324
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-08-13 20:46:35 +00:00
Sergey Ulanov
2739fd2f09 Reland: Enable YCbCr sampler support on platforms other than Android
Previously YCbCr Vulkan samplers were supported only on Android for
external images, while Vulkan requires YCbCr sampler for I420 YUV image
formats such as VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM,
VK_FORMAT_G8_B8R8_2PLANE_420_UNORM.
This CL:
 - Adds VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM and
   VK_FORMAT_G8_B8R8_2PLANE_420_UNORM as supported Vulkan formats
 - Updates GrVkYcbcrConversionInfo to add fFormat field and allow
   fExternalFormat=0.
 - Removes assertions format=VK_FORMAT_UNDEFINED for all images that
   have ycbcr info.

Bug: chromium:981022
Change-Id: Id4d81b20d9fda4d9ad0831f77e6025eed3db2bfd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/233776
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Auto-Submit: Sergey Ulanov <sergeyu@chromium.org>
2019-08-12 14:21:01 +00:00
Robert Phillips
3e7fa79f2c Revert "Initiate regeneration of mipmaps from proxy DAG land"
This reverts commit fe19203eb7.

Reason for revert: Turned a lot of bots red

Original change's description:
> Initiate regeneration of mipmaps from proxy DAG land
> 
> This allows us to resolve all the textures before executing a command
> buffer, rather than interrupting execution as is currently done in the
> GL backend.
> 
> Change-Id: I998546b312d24cf47fc2c837e7c94fbf95571af0
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230636
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

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

Change-Id: Iaa8391b8fbd5a4f851ca41834c1dfeee4be6fedd
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/233836
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-08-10 13:00:33 +00:00
Chris Dalton
fe19203eb7 Initiate regeneration of mipmaps from proxy DAG land
This allows us to resolve all the textures before executing a command
buffer, rather than interrupting execution as is currently done in the
GL backend.

Change-Id: I998546b312d24cf47fc2c837e7c94fbf95571af0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230636
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-08-10 00:39:50 +00:00
Brian Salomon
74c19de3be Add SkUNREACHABLE to definition of SK_ABORT.
Remove return statements immediately following SK_ABORTs.

Change-Id: I6446b6ba3a6fb272d84ea27f38cf366095cf801d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/233565
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-08-09 20:43:39 +00:00
Greg Daniel
9fc5e8da98 Revert "Enable YCbCr sampler support on platforms other than Android"
This reverts commit cc4573dfed.

Reason for revert: Seems to be crashing in Win Intel vulkan bots

Original change's description:
> Enable YCbCr sampler support on platforms other than Android
> 
> Previously YCbCr Vulkan samplers were supported only on Android for
> external images, while Vulkan requires YCbCr sampler for I420 YUV image
> formats such as VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM,
> VK_FORMAT_G8_B8R8_2PLANE_420_UNORM.
> This CL:
>  - Adds VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM and
>    VK_FORMAT_G8_B8R8_2PLANE_420_UNORM as supported Vulkan formats
>  - Updates GrVkYcbcrConversionInfo to add fFormat field and allow
>    fExternalFormat=0.
>  - Removes assertions format=VK_FORMAT_UNDEFINED for all images that
>    have ycbcr info.
> 
> Bug: chromium:981022
> Change-Id: I3989f72e918a257a081b81ae20429a6771229ad6
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230918
> Commit-Queue: Sergey Ulanov <sergeyu@chromium.org>
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Auto-Submit: Sergey Ulanov <sergeyu@chromium.org>
> Reviewed-by: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,sergeyu@chromium.org

Change-Id: Ia9c229fbec4cd397fb04304753fa49f34336ed3a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:981022
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/233563
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-08-09 19:09:05 +00:00
Sergey Ulanov
cc4573dfed Enable YCbCr sampler support on platforms other than Android
Previously YCbCr Vulkan samplers were supported only on Android for
external images, while Vulkan requires YCbCr sampler for I420 YUV image
formats such as VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM,
VK_FORMAT_G8_B8R8_2PLANE_420_UNORM.
This CL:
 - Adds VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM and
   VK_FORMAT_G8_B8R8_2PLANE_420_UNORM as supported Vulkan formats
 - Updates GrVkYcbcrConversionInfo to add fFormat field and allow
   fExternalFormat=0.
 - Removes assertions format=VK_FORMAT_UNDEFINED for all images that
   have ycbcr info.

Bug: chromium:981022
Change-Id: I3989f72e918a257a081b81ae20429a6771229ad6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230918
Commit-Queue: Sergey Ulanov <sergeyu@chromium.org>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Auto-Submit: Sergey Ulanov <sergeyu@chromium.org>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-08-09 18:01:13 +00:00
Brian Salomon
ec22b1a2bf Expose GrContext::dump() when SK_ENABLE_DUMP_GPU is defined.
Change-Id: I499228454bc387de2c988b8f607320b7e5ea57b0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/233557
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-08-09 14:13:01 +00:00
Brian Salomon
d4764a15f3 Rework how backend-specific formats are retrieved from GrBackendFormat.
Change-Id: If1047c477ff3f2cc4aaf19d2e2e838f2dbcb0126
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/233160
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-08-08 17:20:34 +00:00
Hal Canary
bcfed55a8c experimental/editor: mouse drag select, modifierkeys cleanup.
Change-Id: I8c8de54ad6309424bdf18987ccf3eac6bdd41c19
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/233080
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-08-08 02:33:44 +00:00
Mike Reed
41974000e2 note that drawAtlas does nothing if atlas is null
Change-Id: I8d2171b1f51a2beccff8a18f9e6324c08e4b864c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/233076
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-08-07 15:27:02 +00:00
Ben Wagner
549476357c Mark SkBitmaskEnum operators constexpr.
Change-Id: I498beee590ff7728f4d49da28d9a2b9909409c48
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/232763
Reviewed-by: Hal Canary <halcanary@skia.org>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-08-07 14:32:10 +00:00
Brian Salomon
a9c2257810 Pass size and GrPixelConfig to GrSurface/Texture/RenderTarget constructors
Change-Id: I4421354453a22a0a2853fc3cd64199f76b70c9f2
Bug: skia:6718
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/232556
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
2019-08-05 19:08:07 +00:00
Brian Salomon
4eb38b7684 Pass GrBackendFormat to GrResourceProvider and GrGpu texture create
functions.

Change-Id: Ie3fe9d56fdbf369ccacd0188a3d3d73ce1d30d48
Bug: skia:6718
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/232141
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-08-05 17:33:17 +00:00
Michael Ludwig
bf8439d7e2 Fix GMs broken during API porting
Bugs:
morphology GM: Had swapped Erode and Dilate
imagefilterscropexpand GM: Was applying the filter to the wrong rectangle
imagefilterstransformed, filterfastbounds, et al GMs: The new
SkImageFilters::Image() factory had defaulted to using kNone for quality,
since it appeared to keep a 1-to-1 scale. However, it actually draws the
image from srcRect into the dstRect, mapped by the CTM, so if there's a
scaling factor in the CTM the filter no longer is 1-to-1 and kNone leads
to weird scaling artifacts. So switched back to the original kHigh default.
Change-Id: I30ee455008720048fb27eaed1c2c42915d222c97
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/232396
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-08-05 14:53:45 +00:00
Michael Ludwig
8ee6cf3691 Move SkImageFilter functionality into private SkImageFilter_Base
Bug: skia:9281
Change-Id: I189dbf652580805641f8c4b9a6587cf15a9049dd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/231256
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-08-02 18:56:39 +00:00
Chris Dalton
6b49810f98 Extract a GrRenderTask base class from GrOpList
This is a more abstract representation of something that can
participate in the DAG by modifying a GrSurfaceProxy's pixels. This
will serve as the direct base class for future DAG participants that
aren't opLists, and help to eventually remove GrTextureOpList.

Bug: skia:
Change-Id: Ia903c0188e0f6a6602781b90ee8da87ba3cc13f8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/231277
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-08-02 16:56:09 +00:00
Michael Ludwig
06eacf44d5 Add new SkImageFilters factory API
In preparation for moving the filter-specific headers from include/effects and into src/effects/imagefilters, this exposes a more convenient API where all filters provided by Skia are accessible from the same factory.

It also only exposes the factories that take the shared enums (SkColorChannel, SkTileMode), so the per-filter enums can be phased out (SkBlurImageFilter::TileMode, etc.). It also accepts an SkIRect* instead of an SkImageFilter::CropRect* since all uses seem to be for integer rectangles and flags are either always on or always off. This will allow us to later remove the CropRect type.

Bug: skia:9280
Change-Id: I71f77ff44b573f87b837d6523b9eb565521f0f36
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230876
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-08-02 13:33:35 +00:00
Florin Malita
4800949bf4 Reland: SkColorfilters::HSLAMatrix
Introduce an SkColorFilter_Matrix flavor operating in HSLA space.

(CPU-only for now)

TBR=mtklein

Change-Id: I3a8686775593ccc9ce0e46159a17bec7f4ab4228
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/231736
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-08-01 23:04:22 +00:00
Mike Klein
40f9138361 Revert "let color filters tell us their alpha format"
This reverts commit 0355f05b26.

Reason for revert: roll?

Original change's description:
> let color filters tell us their alpha format
> 
> There are a bunch of native premul->premul color filters, and about an
> equal number of native unpremul->unpremul filters that all have roughly
> the same logic to interoperate with a premul color pipeline.  I haven't
> seen anything that wants premul in and unpremul out or vice versa.
> 
> (It's easy to find by grepping for ::unpremul.)
> 
> This CL flags the natively unpremul color filters and centralizes the
> logic to handle premul interop.  This mostly eliminates the need for
> SkColorFilter subclasses to know shaderIsOpaque, but not quite entirely.
> It's of course used in the centralized SkColorFilter::appendStages(),
> but is still also needed by any subclass that calls that, any subclass
> that composes other color filters. I've commented out any unused
> shaderIsOpaque arguments.
> 
> In the future we could imagine handling this outside in a more
> sophisticated way, like eliding unnecessary alpha format conversions.
> We'd need to move this logic out of SkColorFilter::appendStages() to
> it's callers... the blitter, composing subclasses, and any other misc.
> 
> Should be no diffs and no interesting perf change.
> 
> I couldn't help but correct some misuse of "protected" where I was
> editing anyway.  I'm feeling a mega CL coming...
> 
> Change-Id: If3528820ca639357864b8b99c8fe11ab60c1ae0d
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/231465
> Commit-Queue: Mike Klein <mtklein@google.com>
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Reviewed-by: Mike Reed <reed@google.com>

TBR=mtklein@google.com,fmalita@chromium.org,reed@google.com

Change-Id: Ide8b887fe7ff445f503864ee935908bcb56f637e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/231677
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-08-01 21:11:36 +00:00
Mike Klein
44d095fe18 Revert "SkColorfilters::HSLAMatrix"
This reverts commit f4c5f63ab9.

Reason for revert: trying to revert my earlier CL.  Sorry!  I'll let you reland this one first and I'll rebase next time.

Original change's description:
> SkColorfilters::HSLAMatrix
> 
> Introduce an SkColorFilter_Matrix flavor operating in HSLA space.
> 
> (CPU-only for now)
> 
> Change-Id: If081de062b9e920c3365bd7b281e45bb069c3d1a
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/231259
> Commit-Queue: Florin Malita <fmalita@chromium.org>
> Reviewed-by: Mike Reed <reed@google.com>
> Reviewed-by: Mike Klein <mtklein@google.com>

TBR=mtklein@google.com,brianosman@google.com,fmalita@chromium.org,reed@google.com

Change-Id: I6a4e85d3810e2ca30d072937c035c929917d36c9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/231678
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-08-01 21:10:31 +00:00
Robert Phillips
bac46728fc Add a means of printing out the GrBackendFormat
Change-Id: I78b145765bc6ad2f0568ff9bee97397844c23728
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/231557
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-08-01 20:42:32 +00:00
Florin Malita
f4c5f63ab9 SkColorfilters::HSLAMatrix
Introduce an SkColorFilter_Matrix flavor operating in HSLA space.

(CPU-only for now)

Change-Id: If081de062b9e920c3365bd7b281e45bb069c3d1a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/231259
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-08-01 19:02:55 +00:00
Mike Klein
0355f05b26 let color filters tell us their alpha format
There are a bunch of native premul->premul color filters, and about an
equal number of native unpremul->unpremul filters that all have roughly
the same logic to interoperate with a premul color pipeline.  I haven't
seen anything that wants premul in and unpremul out or vice versa.

(It's easy to find by grepping for ::unpremul.)

This CL flags the natively unpremul color filters and centralizes the
logic to handle premul interop.  This mostly eliminates the need for
SkColorFilter subclasses to know shaderIsOpaque, but not quite entirely.
It's of course used in the centralized SkColorFilter::appendStages(),
but is still also needed by any subclass that calls that, any subclass
that composes other color filters. I've commented out any unused
shaderIsOpaque arguments.

In the future we could imagine handling this outside in a more
sophisticated way, like eliding unnecessary alpha format conversions.
We'd need to move this logic out of SkColorFilter::appendStages() to
it's callers... the blitter, composing subclasses, and any other misc.

Should be no diffs and no interesting perf change.

I couldn't help but correct some misuse of "protected" where I was
editing anyway.  I'm feeling a mega CL coming...

Change-Id: If3528820ca639357864b8b99c8fe11ab60c1ae0d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/231465
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
2019-08-01 17:28:00 +00:00
Michael Ludwig
c711a86493 Combine erode and dilate implementations
Combine the GPU and Raster morph type and direction enums, and have the
morphology base class accept the type as an argument instead of a virtual.
Adds somewhat complex deserialization code to be backwards compatible with
the old erode and dilate create procs.

Also updates SkXfermodeImageFilter's implementation to be named with the
"Impl" suffix instead of _Base, and updates both filters to have the common
code layout for image filter implementations.

Change-Id: I5082914f9754c2be71becfceb0c7d9a8fd06f569
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/231099
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-08-01 17:24:10 +00:00
Brian Salomon
8f8354a9a3 Reland "Remove GrCaps::SupportedRead::fSwizzle and supporting code"
This reverts commit a0f864d6ac.

Reason for revert: updated valgrind suppression

EXTRA_TRYBOTS=Test-Ubuntu18-GCC-Golo-GPU-QuadroP400-x86_64-Release-All-Valgrind_SK_CPU_LIMIT_SSE41

Original change's description:
> Revert "Remove GrCaps::SupportedRead::fSwizzle and supporting code"
>
> This reverts commit 1cec69ae5c.
>
> Reason for revert: Causing Valgrind failures
>
> Original change's description:
> > Remove GrCaps::SupportedRead::fSwizzle and supporting code
> >
> > Add weird color types that handle the swizzling.
> >
> > Change-Id: Ie37a00eb877fe5e519f7498bf749e02a2f1dc204
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230135
> > Reviewed-by: Greg Daniel <egdaniel@google.com>
> > Commit-Queue: Brian Salomon <bsalomon@google.com>
>
> TBR=egdaniel@google.com,bsalomon@google.com
>
> Change-Id: I710e1952f2cef1a1e6e7ccf408b8a71ce721c002
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/231262
> Reviewed-by: Ben Wagner aka dogben <benjaminwagner@google.com>
> Commit-Queue: Ben Wagner aka dogben <benjaminwagner@google.com>

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

Change-Id: I367f62ba7349b112d0a2eb5340a37be938ad5ef5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/231178
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-08-01 00:17:54 +00:00
Ben Wagner aka dogben
a0f864d6ac Revert "Remove GrCaps::SupportedRead::fSwizzle and supporting code"
This reverts commit 1cec69ae5c.

Reason for revert: Causing Valgrind failures

Original change's description:
> Remove GrCaps::SupportedRead::fSwizzle and supporting code
> 
> Add weird color types that handle the swizzling.
> 
> Change-Id: Ie37a00eb877fe5e519f7498bf749e02a2f1dc204
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230135
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

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

Change-Id: I710e1952f2cef1a1e6e7ccf408b8a71ce721c002
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/231262
Reviewed-by: Ben Wagner aka dogben <benjaminwagner@google.com>
Commit-Queue: Ben Wagner aka dogben <benjaminwagner@google.com>
2019-07-31 23:55:31 +00:00
Brian Salomon
1cec69ae5c Remove GrCaps::SupportedRead::fSwizzle and supporting code
Add weird color types that handle the swizzling.

Change-Id: Ie37a00eb877fe5e519f7498bf749e02a2f1dc204
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230135
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-07-31 15:48:45 +00:00
Mike Reed
72a0c0c94d move all picture version crap into single header
Change-Id: Idc11d86809bc20e870bc546fabb26db607739936
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230885
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2019-07-30 20:15:07 +00:00
Michael Ludwig
d668f7f061 Hide SkImageFilter subclasses in CPP files
Bug: skia:9280
Change-Id: Ice3624467f5e643f9d3d81da72d77911eeac963e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230198
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-07-30 18:39:22 +00:00
Mike Reed
3899239b67 simplify canvas after looper's demise
Bug: skia:4783
Change-Id: Ib5bf3524033b0064f4248552b5946306dab18572
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230744
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2019-07-30 15:46:13 +00:00
Michael Ludwig
7bacbf71f7 Update SkPicture version for simplified image filter enums
Bug: skia:9280
Change-Id: I638c2b3d34be2037648cf27bde933345f8abbd77
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230126
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-07-30 14:22:08 +00:00
Robert Phillips
d5e80ca8ea Add GrContext::defaultBackendFormat
TBR=bsalomon@google.com
Bug: 987392
Change-Id: I38ff649b25e78c0a02a8fd20f513db4be62abf43
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229919
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-07-30 14:05:28 +00:00
Mike Reed
9dc0b9e2f8 remove code now that loopers are dead (w.r.t. canvas and paint)
We can't remove the loopers themselves, as they are still used
by android and chrome (they just don't ever pass them to skia).

Eventually each of those clients will resolve this, but for now
we just keep the classes (and tests) in skia.

Bug: skia:4783
Change-Id: I5f507e6bb82280f2bc7c0b21eebe59c287aa9265
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230579
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2019-07-30 12:49:28 +00:00
Michael Ludwig
607c057de9 Use SkTileMode for blur and matrix convolution filters
Bug: skia:9280
Change-Id: I6d40b83093d8a8e9e84bbe44d917d02dfde85877
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230124
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-07-29 18:27:27 +00:00
Stephen White
ff5d7a2f90 Implement separate sampler and textures in SkSL.
Dawn doesn't support old-style combined texturesampler uniforms, so
they must be expressed as separate samplers and texture uniforms.

At the SkSL Type level, I've added a Texture2D type, and expressed
the Sampler2D (combined) type in terms of it. This ensures that we
emit only a single OpTypeImage for it in the SPIRV.

Eventually, all of the Texture types (1D, 3D, Rect) could be defined
and SamplerX could simply contain a reference to TextureX. I wanted to
float this idea with a single example for now (and since it's all that
the Dawn backend needs).

This also required adding a new "makeSampler2D" function to combine
them, which maps to OpSampledImage at the SPIR-V level.

Change-Id: Iaf33a6e7d339da415be6ea9a017340cb0ef3c1eb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229417
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2019-07-26 22:09:50 +00:00
Michael Ludwig
14963cef70 Use SkColorChannel in SkDisplacementMapEffect
Bug: skia:9280
Change-Id: I1a1df193ce212300b7a84d2247fa9c63601c9446
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230119
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-07-26 19:44:08 +00:00
Brian Salomon
b28cb68bc0 Make GrColorTypeBytesPerPixel return size_t.
Change-Id: I4ce55c3870290cc7053db5eeb3eb4e29337f06a3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229977
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-07-26 17:50:32 +00:00
Brian Salomon
42be09d535 Test GrGpu::transferPixelsTo for more color types.
Change-Id: Ibae377f01c1ed37c5dfac50a085c7eb97e93f24b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229376
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-07-26 16:48:12 +00:00
Michael Ludwig
130be09f5b Move SkColorChannel into SkColor
By making it in a more common header, this enum can be reused by the
SkDisplacementMapEffect.

Bug: skia:9280
Change-Id: Ia8352e0530f915cdad659c657bd86710226582b6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230118
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-07-26 15:50:12 +00:00
Brian Salomon
247ac39ccc Remove old constructor for GrVkImageInfo.
TBR: egdaniel@google.com

Change-Id: I09e5ff84c81617c23235b39edbbe47b5eabfd3a3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229616
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-07-25 23:58:43 +00:00
Mike Reed
59f2e46ab4 Return translate info from looper, rather than moding a canvas
Change-Id: Ibb4520030bc0ca455fa079d923fd4f5be86d72a1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229837
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2019-07-25 20:39:13 +00:00
Robert Phillips
62221e768c Delete GrBackendSurface's GrPixelConfig
This member variable is no longer used

TBR=bsalomon@google.com
Bug: skia:6718
Change-Id: I84680c8c3bc36eefa603f5be7f3c15b496a79948
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229478
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-07-25 15:18:08 +00:00
Heather Miller
269713b09e Update Skia milestone to 78
Change-Id: I4c65c276032b85063177eb5da12df31e000fdb2f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229656
Reviewed-by: Heather Miller <hcm@google.com>
Commit-Queue: Heather Miller <hcm@google.com>
Auto-Submit: Heather Miller <hcm@google.com>
2019-07-25 11:05:37 +00:00
Mike Reed
6d907faa7d add copytable method to typefaces
This allows some backends to efficiently retrieve a copy of the data.

Inspired by https://skia-review.googlesource.com/c/skia/+/229136

Change-Id: I9b0345333e30376a50a5dc7c9e993b847e2791c4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229384
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-07-24 19:20:46 +00:00
Robert Phillips
c80b0e9541 Make rest of GrGpu::wrapBackend* methods take a GrColorType (take 2)
This CL is intended to further wean Ganesh off of using the GrBackendTexture's pixel config

TBR=bsalomon@google.com
Bug: skia:6718
Change-Id: Iedaa7811f9c4aac552f219c702627bc476325317
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228338
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-07-23 16:13:30 +00:00
Mike Reed
aed493e49f remove default looper flag, rely on clients to opt-in
Bug: skia:4783
Change-Id: I232ec6fa10287b6e07849d596b93cc997e0de052
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229280
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2019-07-23 14:20:09 +00:00
Brian Salomon
27b4d8d8db Remove sample count from GrSurfaceDesc.
This leaves just width, height, and GrPixelConfig. Once we remove the
latter we can replace GrSurfaceDesc with SkISize.

Also remove unused GrRenderTarget::overrideResolveRect

Also remove GrSurfaceProxy::Renderable and use GrRenderable instead.

Change-Id: I652fe6169a22ca33d199b144ec6385286ac07b5a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228570
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-07-23 13:42:29 +00:00
Mike Reed
b7dad44040 Reland "hide drawlooper from paint"
This reverts commit 6dc14ded91.

Reason for revert: add flag to google3

Original change's description:
> Revert "hide drawlooper from paint"
>
> This reverts commit 766b42b7ba.
>
> Reason for revert: afaict this is changing a lot of image filter GMs for the worse
>
> Original change's description:
> > hide drawlooper from paint
> >
> > Bug: skia: 4783
> >
> > Change-Id: I1d0ad1683a2e8345d8ea13db9b69b568ada827dc
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228573
> > Reviewed-by: Florin Malita <fmalita@chromium.org>
> > Commit-Queue: Mike Reed <reed@google.com>
>
> TBR=fmalita@chromium.org,reed@google.com
>
> Change-Id: I0bfd48ada3f8e48a774527caccf7abdb7a1cc470
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia: 4783
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229005
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

TBR=robertphillips@google.com,fmalita@chromium.org,reed@google.com

Change-Id: Ib3cd8941a63cd323b8872dd7fec1c953ab81cbdc
Bug: skia: 4783
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229010
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-07-22 20:03:36 +00:00
Robert Phillips
6dc14ded91 Revert "hide drawlooper from paint"
This reverts commit 766b42b7ba.

Reason for revert: afaict this is changing a lot of image filter GMs for the worse

Original change's description:
> hide drawlooper from paint
> 
> Bug: skia: 4783
> 
> Change-Id: I1d0ad1683a2e8345d8ea13db9b69b568ada827dc
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228573
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=fmalita@chromium.org,reed@google.com

Change-Id: I0bfd48ada3f8e48a774527caccf7abdb7a1cc470
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia: 4783
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229005
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-07-22 17:27:17 +00:00
Mike Reed
766b42b7ba hide drawlooper from paint
Bug: skia: 4783

Change-Id: I1d0ad1683a2e8345d8ea13db9b69b568ada827dc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228573
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2019-07-22 16:25:41 +00:00
Robert Phillips
ebab03ffbf Add Ganesh support for LUM16F (take 2)
When Chrome has a LUM16F texture they tell Skia it is R16F. Although this has been working for them so far it causes trouble with some upcoming changes.

Change-Id: I2473f70e4f725128f143c2dfb08adb79f3c7c166
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228565
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-07-22 14:13:36 +00:00
Mike Reed
efe259bb2a add apply method to drawlooper
Bug: skia: 4783

Change-Id: I3eabe364c9b377d1f0c024131f8cbdabc094fa8e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228574
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-07-20 20:06:01 +00:00
Chris Dalton
c3318f09cd ccpr: Add an MSAA atlas mode
Adds the option to use a multisampled (or mixed sampled) atlas, and
uses the sample mask and stencil buffer instead of coverage counts.

Bug: skia:
Change-Id: I9fb76d17895ae25208124f6c27e37977ac31b5eb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227428
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-07-19 20:52:17 +00:00
Brian Salomon
e8a766b16c Move GrProtected off GrSurfaceDesc and pass separately.
Change-Id: If628c13bb0e5aa885e4249a37432ba572e65d920
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228440
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-07-19 19:03:19 +00:00
Michael Ludwig
aa861a1907 Change SkMatrix::decomposeScale to use preScale
While most callers of decomposeScale only depend on the scale factors
that are returned, image filter decomposition depends on the remaining
matrix as well. Hence, the following necessary updates to work with
the new behavior of decomposeScale:

* Update imagefilter DAG sample to reflect prescaling
* Correct embedded matrix in SkApplyCTMToFilter
* Add comment to clipRectBounds() clarifying coordinate spaces and image filters

But, we want to have decomposeScale using preScale() because it then
produces a remainder matrix that can be used as the transform for the
image filter draw, instead of wrapping the image filter in an
SkMatrixImageFilter as currently done by SkApplyCTMToFilter.

Bug: skia:7211
Change-Id: If14570afb4189cebc75f3815e8ccdde05cb074e1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228438
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-07-19 15:41:11 +00:00
Robert Phillips
cdb40c9d07 Revert "Add Ganesh support for LUM16F"
This reverts commit 2f6c8af73a.

Reason for revert: Failing on some bots

Original change's description:
> Add Ganesh support for LUM16F
> 
> When Chrome has a LUM16F texture they tell Skia it is R16F. Although this has been working for them so far it causes trouble with some upcoming changes.
> 
> Change-Id: Ic2143ec69f33a17cb1cb64f6ebc39bffd94a5e68
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228557
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

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

Change-Id: Ie52150f4f5255a2db697b9f0e810eff2042eadec
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228560
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-07-19 14:53:53 +00:00
Robert Phillips
2f6c8af73a Add Ganesh support for LUM16F
When Chrome has a LUM16F texture they tell Skia it is R16F. Although this has been working for them so far it causes trouble with some upcoming changes.

Change-Id: Ic2143ec69f33a17cb1cb64f6ebc39bffd94a5e68
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228557
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-07-19 14:39:21 +00:00
Brian Salomon
e78454e802 Add temporary constructor to GrVkImageInfo to allow Chrome to compile.
TBR: egdaniel@google.com


Change-Id: Iae8e41ac1f6ba1c77846284f5649592250c206ae
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228559
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-07-19 14:10:11 +00:00
Florin Malita
abc96536f6 [SkSVGCanvas] Add flag for converting text to paths
Change-Id: I9130518d12acda1a82576a17fa4fa8c34b0618f5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228436
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
2019-07-19 13:39:11 +00:00
Brian Salomon
4456a0d35c Store protectedness on GrVkImageInfo.
Changes the GrBackendSurface to not take it separately.

Change-Id: I5eb9684da1532907e7833e9d7835a74d1e71f5ca
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228396
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-07-18 20:03:08 +00:00
Stephen White
985741a554 First draft of Dawn backend: clears are working.
First draft of (mostly stubbed-out) GrDawnGpu.
Skeletons of GrDawnCaps, GrDawnGpuCommandBuffer, GrDawnRenderTarget.
First draft of DawnTestContext.
First draft of psuedo-fences for Dawn, implemented with MapReadAsync.

Change-Id: I443f3370522639e82f2fa0eebe6b206c372f13a4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228137
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-07-18 18:09:12 +00:00
Mike Reed
9724582271 return self from matrix setters to allow chaining
Change-Id: Ifd4c6bf5f5feb925f06067d50e491fd1a490f896
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228344
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-07-18 17:19:09 +00:00
Robert Phillips
dd39980115 Revert "Make rest of GrGpu::wrapBackend* methods take a GrColorType"
This reverts commit 9725638fb1.

Reason for revert: Chrome roll

Original change's description:
> Make rest of GrGpu::wrapBackend* methods take a GrColorType
> 
> This CL is intended to further wean Ganesh off of using the GrBackendTexture's pixel config
> 
> Bug: skia:6718
> Change-Id: I593c0c73922fb76045e379214e20adb1f17ea215
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227780
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>

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

Change-Id: Id71acf1dec63c288a858fccd7109c84cf3cc6f0a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:6718
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228337
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-07-18 12:28:17 +00:00
Michael Ludwig
43c6da2a15 First pass at ImageFilter DAG visualizer sample
Change-Id: I04493af0a6ce1425c4acf68365135722dd3c218b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227857
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-07-17 20:59:37 +00:00
Robert Phillips
9725638fb1 Make rest of GrGpu::wrapBackend* methods take a GrColorType
This CL is intended to further wean Ganesh off of using the GrBackendTexture's pixel config

Bug: skia:6718
Change-Id: I593c0c73922fb76045e379214e20adb1f17ea215
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227780
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-07-17 20:00:05 +00:00
Greg Daniel
fad9fbc3c4 Revert "First draft of Dawn backend: clears are working."
This reverts commit 6cebea42a8.

Reason for revert: breaking google3 roll

Original change's description:
> First draft of Dawn backend: clears are working.
> 
> First draft of (mostly stubbed-out) GrDawnGpu.
> Skeletons of GrDawnCaps, GrDawnGpuCommandBuffer, GrDawnRenderTarget.
> First draft of DawnTestContext.
> First draft of psuedo-fences for Dawn, implemented with MapReadAsync.
> 
> Change-Id: Id009436f4441f26ffbc82d485d7af3a499b3281b
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/226857
> Commit-Queue: Stephen White <senorblanco@chromium.org>
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

TBR=egdaniel@google.com,jvanverth@google.com,bsalomon@google.com,senorblanco@chromium.org

Change-Id: Ie494b5a403e8537c6539551533ae8b9156e90a61
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228120
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-07-17 17:23:02 +00:00
Florin Malita
7a15a6e2c7 [skottie] De-dupe sequential cubic mappers
Detect and de-dupe repeating/sequential cubic mapers.

Also improve linear keyframe detection.

Change-Id: Ic7cc757ba9369416d4f1e5639e1c9fdf9e1e2c6e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228117
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
2019-07-17 17:14:46 +00:00
Greg Daniel
009ad250fe Remove RG32F color type and pixel config.
Change-Id: I7fd3a8f6c02217d011f353ef602718a537bb87b2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228116
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-07-17 17:05:36 +00:00
Stephen White
6cebea42a8 First draft of Dawn backend: clears are working.
First draft of (mostly stubbed-out) GrDawnGpu.
Skeletons of GrDawnCaps, GrDawnGpuCommandBuffer, GrDawnRenderTarget.
First draft of DawnTestContext.
First draft of psuedo-fences for Dawn, implemented with MapReadAsync.

Change-Id: Id009436f4441f26ffbc82d485d7af3a499b3281b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/226857
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-07-17 16:29:22 +00:00
Brian Salomon
f2c2ba99f6 Remove kRenderTarget_GrSurfaceFlag, instead pass GrRenderable.
This is the last surface desc flag, so remove flags from GrSurfaceDesc.

Bug: skia:6718

Change-Id: Id3ed66b161289927b62f40bfb1f6482cf544deda
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227858
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-07-17 15:09:03 +00:00
Brian Salomon
947efe28de makeDeferredSurfaceContext -> makeDeferredTextureContext and makeDeferredRenderTargetContext.
Removes some usage of GrSurfaceDesc.

Bug: skia:6718
Change-Id: Icc4f93aba0e5c49a801b4c7bbfcba76a6e30c538
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227776
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-07-16 20:06:04 +00:00
Brian Salomon
a3e2996b08 Rework how initial clearing of texture works.
1) It only applies when a texture is created, not when recycled from cache

2) It is all textures or none, not a flag GrSurfaceDesc

3) It is implemented by GrGpu clearing the texture after creation if
such a thing is supported in underlying API. Otherwise, GrResourceProvider
must provide pre-zeroed mip levels.

4) Works for MIP mapped textures (all levels without initial data are cleared)

This could cause performance regressions in WebGL until we re-add the
ability to clear using glCear() in GL. Doing that requires making the "can
clear using GrGpu" caps query be per-format. Deferring doing that until
GrPixelConfig work is farther along.

Bug: skia:6718


Change-Id: I234715b9faaf61e8b44d54464497a17cd553585d

start

Change-Id: Ib84a8c3ece010cc3164b18895107e78484cbf76b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/226977
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-07-16 16:36:41 +00:00
Mike Reed
1f3548cb05 add savelayer flag to promote the later to half-float
Bug: skia:9256
Change-Id: Ifd7846349f83854e860306bd475cfba0adeddcb5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227066
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-07-12 17:31:33 +00:00
Mike Klein
55f6fd50ea initialize val in SkTHash Slot
Found with a GCC compiler warning.
Seems like a sane idea to keep Slots fully initialized.

Change-Id: I7a7bd4ccc4a6800d6e262aa7c616d3cab36d74dc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227121
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-07-12 15:44:06 +00:00
Brian Salomon
5043f1f2cd More GrGLFormat.
Also rename from GrGLSizedInternalFormat since the compressed formats
aren't really sized internal formats.

Change-Id: I8744f1f4b8156300ab69d89066b44913bce120a3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/226956
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-07-12 14:40:26 +00:00
Greg Daniel
e877dce203 Add kRGBA_8888_SRGB GrColorType and remove GrSRGBEncoded.
Change-Id: Iad1c72eb81ffd9c006e39c96191fada990d9dbd6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/226224
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-07-11 15:22:23 +00:00
Robert Phillips
f9fcf7ffa8 Alter approximate scratch texture binning after 1024
As the powers-of-2 get larger the coarse binning can burn a lot of VRAM.

Granted it isn't the best metric but, with this CL, the number of textures created and scratch textures reused remains unchanged when running the GMs.

Change-Id: I84abbbae0ed01aabb387671b5ee0e4fcdb82b671
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/226226
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-07-11 13:29:41 +00:00
Brian Salomon
9e9ea91092 Try GrGLSizedInternalFormat enum
Change-Id: I970fe3547caf4fa363f20aa8246b293a19c4ba8c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/226225
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-07-10 21:30:38 +00:00
Mike Reed
3a8ff230ab Move test around in cubic_solver to test function, not delta_t.
Add SkOpts variant for avx2 to get FMA
Decrease tolerance now that we're testing the function

Before

  15/15  MB	1	1.13ms	1.17ms	1.18ms	1.26ms	4%	cubicmap_0_1_1_1
  15/15  MB	1	1.08ms	1.13ms	1.12ms	1.17ms	3%	cubicmap_0_1_1_0
  15/15  MB	1	862µs	904µs	900µs	937µs	3%	cubicmap_0_1_0_1
  15/15  MB	1	861µs	878µs	882µs	934µs	3%	cubicmap_0_1_0_0
  15/15  MB	1	1.44ms	1.47ms	1.49ms	1.55ms	3%	cubicmap_1_0_1_1
  15/15  MB	1	1.44ms	1.48ms	1.48ms	1.55ms	3%	cubicmap_1_0_1_0
  15/15  MB	1	1.42ms	1.42ms	1.46ms	1.53ms	3%	cubicmap_1_0_0_1
  15/15  MB	1	1.42ms	1.42ms	1.44ms	1.51ms	2%	cubicmap_1_0_0_0

After moving the check to the function, not delta_t

  15/15  MB	1	900µs	900µs	915µs	971µs	3%	cubicmap_0_1_1_1
  15/15  MB	1	899µs	900µs	914µs	988µs	3%	cubicmap_0_1_1_0
  15/15  MB	1	865µs	896µs	890µs	946µs	3%	cubicmap_0_1_0_1
  15/15  MB	1	866µs	910µs	914µs	959µs	3%	cubicmap_0_1_0_0
  15/15  MB	1	1.29ms	1.29ms	1.33ms	1.44ms	4%	cubicmap_1_0_1_1
  15/15  MB	1	1.28ms	1.29ms	1.34ms	1.54ms	6%	cubicmap_1_0_1_0
  15/15  MB	1	1.26ms	1.26ms	1.27ms	1.34ms	3%	cubicmap_1_0_0_1
  15/15  MB	1	1.26ms	1.26ms	1.27ms	1.3ms	2%	cubicmap_1_0_0_0

After SkOpts (on an avx2 machine)

  15/15  MB	1	613µs	613µs	616µs	646µs	2%	cubicmap_0_1_1_1
  15/15  MB	1	613µs	613µs	624µs	654µs	3%	cubicmap_0_1_1_0
  15/15  MB	1	862µs	865µs	867µs	887µs	1%	cubicmap_0_1_0_1
  15/15  MB	1	865µs	901µs	896µs	949µs	3%	cubicmap_0_1_0_0
  15/15  MB	1	849µs	850µs	868µs	929µs	4%	cubicmap_1_0_1_1
  15/15  MB	1	849µs	850µs	873µs	940µs	4%	cubicmap_1_0_1_0
  15/15  MB	1	831µs	831µs	856µs	950µs	5%	cubicmap_1_0_0_1
  15/15  MB	1	831µs	831µs	848µs	911µs	3%	cubicmap_1_0_0_0

(not checked in) if we also enable the pragma in cubic_solver

  15/15  MB	1	593µs	594µs	597µs	623µs	2%	cubicmap_0_1_1_1
  15/15  MB	1	593µs	595µs	605µs	629µs	2%	cubicmap_0_1_1_0
  15/15  MB	1	864µs	867µs	869µs	890µs	1%	cubicmap_0_1_0_1
  15/15  MB	1	864µs	866µs	886µs	950µs	4%	cubicmap_0_1_0_0
  15/15  MB	1	809µs	831µs	841µs	891µs	4%	cubicmap_1_0_1_1
  15/15  MB	1	809µs	810µs	855µs	1.11ms	11%	cubicmap_1_0_1_0
  15/15  MB	1	794µs	861µs	856µs	914µs	4%	cubicmap_1_0_0_1
  15/15  MB	1	794µs	821µs	818µs	853µs	3%	cubicmap_1_0_0_0

Change-Id: I260391be956d31a5cf3d0367d1285e56af7568f8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/226499
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-07-10 20:28:28 +00:00
Robert Phillips
cc32642882 Fix SkPixmap and SkBitmap dox for computeByteSize
The SIZE_MAX behavior was added in response to https://bugs.chromium.org/p/skia/issues/detail?id=7132

Bug: skia:9242
Change-Id: If4bd0649c738f68967b0aaa83e43cd7930c87823
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/225730
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-07-10 19:43:59 +00:00
Robert Phillips
3cd5432331 Add protected status to SkSurfaceCharacterization
Change-Id: I27bd051c1fce0239faff7fc073eaf82976fb63ae
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/225940
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-07-10 16:30:35 +00:00
Florin Malita
9ab449ab69 Optional local matrix for SkShaders factories
Change-Id: Id913f89c699097ce53c9f8ef6deea264811a4179
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/226082
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
2019-07-09 18:09:14 +00:00
Robert Phillips
a5e78be278 Make Mock GrBackendFormat use GrColorType (instead of GrPixelConfig)
The switch to GrColorType does mean that we can no longer represent compressed backend formats in the Mock backend surfaces.

This will require a Chrome CL before it can land in Skia.

TBR=bsalomon@google.com
Change-Id: Ie4e2d4826f960664a21d3de79933eb1cb5d06896
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/225538
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-07-09 17:43:14 +00:00
Robert Phillips
d09064263d Make BGRA_8888 renderable & textureable by default in the mock context
This is a temporary change to allow us to switch GrMockOptions to be based on GrColorType. Chrome sets up their FakeWebGraphicsContext3DProvider in this manner.

TBR=bsalomon@google.com
Change-Id: I68c6b78aeb0395e1783c7acf1dbdbd028373433c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/225720
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-07-08 18:49:51 +00:00