Commit Graph

6664 Commits

Author SHA1 Message Date
Chris Dalton
b8fff0dfce Make mixed samples detection automatic
Previously, we relied on ops to deduce whether a draw would have
hardware coverage modulation as a result mixed samples. This is
problematic because *any* draw can have mixed samples coverage if
there is a multisampled stencil clip. No ops were checking for stencil
clip, and most just said they never used mixed samples.

Now that the only usecase for mixed samples is the stencil buffer,
this CL makes the processorSet automatically deduce mixed samples
coverage from the stencil settings and fsaaType.

Bug: skia:
Change-Id: Ib69b84bc03b12f6efb8e7d6ed721ae1612785315
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197281
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-03-05 21:27:15 +00:00
Robert Phillips
6603a1743e Make SkImage_Base::asTextureProxyRef take a GrRecordingContext parameter
In future Ganesh the SkImage's will only have GrImageContexts. asTextureProxyRef, however, may need to perform some rendering thus requires an external GrRecordingContext.

Change-Id: I893573e9f3462b4c4cf5e29a7f8ee74027a2ce6e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197134
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-03-05 19:49:40 +00:00
Brian Salomon
9ac0407006 Distinguish between "flushed" and "finished" idle state callbacks on GrTexture.
This is necessary to convert the promise image API to call Release when all
work is flushed and Done when all work is complete (future work).

Change-Id: I9745952bb0978ca2aaa79aeed460730b2fea856e
Bug: skia:8800
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197163
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-03-05 19:49:00 +00:00
Brian Salomon
2ca31f8de2 Use GrSurface::setRelease helper that creates ref-counted wrapper
Change-Id: Ic748ee18d6cdf7d7b83a89ad6ec580be96bc305b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197769
Commit-Queue: Robert Phillips <robertphillips@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-03-05 19:43:55 +00:00
Greg Daniel
39847ccfd0 Add unit test to check if we can create a VkDevice using global priority extension.
Bug: b/126595186
Change-Id: I0a23ca2a7cc47bd02bb535566aa37627899249ee
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197201
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Stan Iliev <stani@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-03-05 18:57:13 +00:00
Ben Wagner
68efb2122d Clarify ownership of typefaces in implementation.
This converts a number of ownership semantics by using sk_sp and
unique_ptr instead of comments.

Change-Id: I4c584a5a8ea54fd22a4d23deddb5ce844f883117
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197206
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2019-03-05 16:20:45 +00:00
Brian Salomon
b2c5dae65d Simplify promise image lazy instantiation callbacks.
Now that we never re-fulfill a promise image we no longer need to deinstantiate
promise image proxies. They now can use kSingleUse callback semantics.

This was the only usage of the kDeinstantiate lazy callback type so it is
removed. The DeinstantiateProxyTracker is also no longer required and is
removed.

The GrTexture idle callback mechanism now uses GrReleaseProcHelper, which has
been extended to support chaining multiple callbacks together and an abandon()
method that aborts calling the callback in the destructor. It has been renamed
GrRefCntedCallback to reflect its more general usage.

Bug: skia:8800
Change-Id: I857c9eec57fdf706631a266ec8bea682d6657a7c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/196500
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-03-05 13:18:22 +00:00
Robert Phillips
9882dae24d Reduce usage of SkCanvas::flush
SkCanvas::flush is problematic and we wish to deprecate it. As a first step, this CL begins to remove Skia's internal usage of it.

Ideally clients would use SkSurface::flush and/or GrContext::flush.

Change-Id: I39bb0702f8230134a97961a4ee70833fd5bd0dcc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/196641
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-03-04 22:09:39 +00:00
Florin Malita
390f9bd8ba Fix handling of SkSL nullable FPs
Bug: skia:8798
Change-Id: Iec311c9d834a6f35b0a4481dbd748532107cd4b1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197108
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-03-04 22:09:20 +00:00
Mike Klein
b70990eda4 add kRGBA_F16Norm_SkColorType
For now this is distinct from kRGBA_F16_SkColorType but treated the
same.  Next steps are to see if we can keep it clamped to [0,1].

Switched a few switches away from default to exhaustive.

Took away any explicit SW clamps for now except the one we definitely
want in append_gamut_clamp_if_normalized().

Skip F16Norm in the DDL test because we can't yet distinguish it from
F16.

Change-Id: I021a864fe078e4fa4e2b399982e6c38350e10d74
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/196371
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
2019-03-04 21:49:07 +00:00
Greg Daniel
bae712104d Add flush call to take access type, flags, and semaphore.
Bug: skia:
Change-Id: I5e664939a446616ef57acc79d26a10e6908cda10
Reviewed-on: https://skia-review.googlesource.com/c/196643
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-03-02 03:45:36 +00:00
Brian Salomon
7d88f310a9 Remove support for SkDeferredDisplayListRecorder::DelayReleaseCallback::kNo.
Bug: skia:8800
Change-Id: I39d1ac62ab9a0d4f987c23de96c644aa9b2fa70e
Reviewed-on: https://skia-review.googlesource.com/c/196161
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-02-28 19:02:20 +00:00
Mike Reed
31cc6d7917 utility to check if floats are [0...1]
Bug: skia:
Change-Id: I9bab3ff73d3934786d7457c4b1bcf67d01c653f3
Reviewed-on: https://skia-review.googlesource.com/c/196060
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-02-27 21:43:31 +00:00
Mike Klein
41b995c4fb specialize if_then_else(int4,float4,float4)
Add SSE, SSE4.1, and NEON specializations.

The if_then_else() unit tests in SkVxTest.cpp should cover this.

I had to give up on my dream of not using Skia headers for now.  There's
really no good way of knowing whether we've got SSE4.1 support in MSVC
except when we explicitly define SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE41.

This refactor to use SK_CPU_SSE_LEVEL let MSVC point out a slight
ordering problem that would cause an infinite loop calling any of
the specializions like sqrt(float2).  I believe moving them after
the float4 specializations will fix that.

Change-Id: I83639f378a182716d1b37e92b6d725472698f874
Reviewed-on: https://skia-review.googlesource.com/c/195920
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-02-27 20:12:20 +00:00
Ben Wagner
ff84d8a900 SkTypeface::openStream to return smart pointer.
Change-Id: I2c936510e13561fcc9fd8343d5ab9f18c28c8340
Reviewed-on: https://skia-review.googlesource.com/c/195371
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-02-27 14:08:09 +00:00
Chris Dalton
07cdcfc966 Reland "Stack-allocate pipelines for GrMeshDrawOp"
This is a reland of dfe5000a5f

Original change's description:
> Stack-allocate pipelines for GrMeshDrawOp
>
> Stack-allocates the pipelines in onExecute. This saves us from having
> to store the pipelines on the heap, as well as delaying the need to
> detach processors until onExecute. The delay is an improvement because
> it allows us to keep visiting proxies after onPrepare. (Previously,
> they were moved out of GrProcessorSet and into a pipeline during
> onPrepare, so visiting proxies was impossible after that point.)
>
> Bug: skia:8731
> Change-Id: Idc05063fb0dfbfed42b434e429fa5a497097bdae
> Reviewed-on: https://skia-review.googlesource.com/c/193368
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

TBR=robertphillips@google.com

Bug: skia:8731
Change-Id: I32def1a35bb0593470fa672691a9e697dc6d9680
Reviewed-on: https://skia-review.googlesource.com/c/195261
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-02-26 23:32:54 +00:00
Chris Dalton
b8af5ad73a sksl: Negate dFdy when the Y axis is flipped
Bug: skia:
Change-Id: Icbdaa6b1ebbe00168f57ebb888c2345d4f7a5e7d
Reviewed-on: https://skia-review.googlesource.com/c/195160
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2019-02-25 23:32:23 +00:00
Chris Dalton
35a3abe765 Revert "Stack-allocate pipelines for GrMeshDrawOp"
This reverts commit dfe5000a5f.

Reason for revert: HWAA pipeline flag not getting set for dashing.

Original change's description:
> Stack-allocate pipelines for GrMeshDrawOp
> 
> Stack-allocates the pipelines in onExecute. This saves us from having
> to store the pipelines on the heap, as well as delaying the need to
> detach processors until onExecute. The delay is an improvement because
> it allows us to keep visiting proxies after onPrepare. (Previously,
> they were moved out of GrProcessorSet and into a pipeline during
> onPrepare, so visiting proxies was impossible after that point.)
> 
> Bug: skia:8731
> Change-Id: Idc05063fb0dfbfed42b434e429fa5a497097bdae
> Reviewed-on: https://skia-review.googlesource.com/c/193368
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

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

Change-Id: If706f19423310846de70288f393ac12f17ffeee5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:8731
Reviewed-on: https://skia-review.googlesource.com/c/195161
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-02-25 23:11:47 +00:00
Ben Wagner
4212a7d948 SkTypeface::onOpenStream to return unique_ptr.
This moves the smart pointer use up one more level in preparation for
changing SkTypeface::openStream to return unique_ptr as well.

Change-Id: Ib8173d59e03de38b06f6e1b4e6776f1961055ae7
Reviewed-on: https://skia-review.googlesource.com/c/195121
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-02-25 22:30:04 +00:00
Chris Dalton
dfe5000a5f Stack-allocate pipelines for GrMeshDrawOp
Stack-allocates the pipelines in onExecute. This saves us from having
to store the pipelines on the heap, as well as delaying the need to
detach processors until onExecute. The delay is an improvement because
it allows us to keep visiting proxies after onPrepare. (Previously,
they were moved out of GrProcessorSet and into a pipeline during
onPrepare, so visiting proxies was impossible after that point.)

Bug: skia:8731
Change-Id: Idc05063fb0dfbfed42b434e429fa5a497097bdae
Reviewed-on: https://skia-review.googlesource.com/c/193368
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-02-25 21:02:23 +00:00
Leon Scroggins III
194580dc60 Reland "Treat kWEBP encode with quality=100 as lossless"
This reverts commit 22170b3178.

It was reverted due to the test breaking Google3. This includes a
workaround.

    Original change's description:
    > Treat kWEBP encode with quality=100 as lossless
    >
    > In SkEncodeImage and friends, treat quality of 100 as a lossless encode
    > when using kWEBP. This seems a good fit for the intent - which is
    > presumably to save the highest quality image. This also matches
    > Chromium's blink::ImageEncoder::ComputeWebpOptions, which treats a
    > quality of 1 (on a float scale from 0 to 1) as a lossless encode.
    >
    > FWIW, Chromium has had this behavior since
    > https://codereview.chromium.org/1937433002, in response to
    > crbug.com/523098. The goal is to "maintain sharpness to
    > match the JPEG encoder behavior (use WEBP lossless encoding)".
    >
    > Add a test to verify the new behavior. This requires making tests
    > depend on libwebp to use WebPGetFeatures, since the Skia API does not
    > provide a way to determine whether an encoded webp file was encoded
    > lossless-ly or lossily.
    >
    > Bug: skia:8586
    > Change-Id: Ie9e09c2f7414ab701d696c4ad9edf405868a716f
    > Reviewed-on: https://skia-review.googlesource.com/c/175823
    > Commit-Queue: Leon Scroggins <scroggo@google.com>
    > Reviewed-by: Derek Sollenberger <djsollen@google.com>
    > Reviewed-by: Mike Reed <reed@google.com>

TBR=reed@google.com, based on prior approval

Bug: skia:8586
Change-Id: I09c73f71996422f797fd9456fef5dfad9af36839
Reviewed-on: https://skia-review.googlesource.com/c/194194
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
Auto-Submit: Leon Scroggins <scroggo@google.com>
2019-02-25 18:42:22 +00:00
Leon Scroggins III
8546335d2d Allow setting an SkColorSpace on SkAnimatedImage
Add a new constructor which merges the SkISize scaledSize with the
SkImageInfo. This allows passing an SkColorSpace to the decode.

Update the test to call the new API.

Bug: b/123301872
Change-Id: I9fd89198e97ac9b8e6dc9fcfe89ed38913a0fe69
Reviewed-on: https://skia-review.googlesource.com/c/189303
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2019-02-22 18:58:05 +00:00
Ethan Nicholas
ee1c8a733e Revert "Revert "SkSL now supports null child processors""
This reverts commit bce7d86270.

Bug: skia:
Change-Id: I3ccaf47b3d4b9dcb9e049671117183a374526032
Reviewed-on: https://skia-review.googlesource.com/c/194185
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2019-02-22 17:50:30 +00:00
Robert Phillips
6989370877 Move DrawingManager to RecordingContext
This CL does make use of a new GrRecordingContextPriv backdoor to break CL deadlocks. This occurs when this CL tries to create GrContext-dependent objects outside its scope.

Change-Id: I278fe9d321f8e0a4f5e9b489b1a5cc01b8974521
Reviewed-on: https://skia-review.googlesource.com/c/191287
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-02-22 17:25:00 +00:00
Greg Daniel
59dc1481a0 Track GrVkResources in command buffer associated with pipeline barriers.
This makes sure we don't call the release proc on an external image before
the transition to the external queue finishes on the gpu.

Bug: skia:
Change-Id: I35b0e3899fcd859cd5ccaa57df9427a47d434210
Reviewed-on: https://skia-review.googlesource.com/c/194004
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-02-22 16:56:37 +00:00
Brian Salomon
8cabb327e7 Make it safe to enter the cache from a GrTexture idle proc.
This fixes an issue in Chrome where Skia is calling a promise SkImage
texture release proc from ~SkImage that in turn flushes a SkSurface.
Prior to this change this caused an assert because we had already
decremented the GrTexture's ref count priot to calling the release
proc. This made the GrTexture purgeable, but the cache had not yet
been notified that the texture was purgeable and still had it in its
array of non-purgeable resources. This triggered an assert in the
cache's self-validation checks during the flush.

Now we call the release proc just prior to decrementing the ref count.
This also makes it legal to re-ref the resources from the release proc.

Bug: chromium:933526
Change-Id: I8cd921b77ca3dfe112089f9a553c1a625160d16d
Reviewed-on: https://skia-review.googlesource.com/c/194000
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-02-22 16:12:35 +00:00
Robert Phillips
bce7d86270 Revert "SkSL now supports null child processors"
This reverts commit 0e8dc4ce36.

Reason for revert: ASAN complaints

Original change's description:
> SkSL now supports null child processors
> 
> Bug: skia:
> Change-Id: Icb3f2d57b393e3d40247aaad98c17344b507f0d7
> Reviewed-on: https://skia-review.googlesource.com/c/193379
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>

TBR=bsalomon@google.com,ethannicholas@google.com,fmalita@chromium.org

Change-Id: Ibf739b3c6afd32d44f6b20705922618c29960d16
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/194020
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-02-21 22:54:08 +00:00
Ethan Nicholas
0e8dc4ce36 SkSL now supports null child processors
Bug: skia:
Change-Id: Icb3f2d57b393e3d40247aaad98c17344b507f0d7
Reviewed-on: https://skia-review.googlesource.com/c/193379
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2019-02-21 21:50:32 +00:00
Mike Klein
63c4d35969 Revert "remove linear sRGB singleton"
This reverts commit b03b80066b.

Reason for revert:  !@#$%^&*

Original change's description:
> remove linear sRGB singleton
> 
> Cq-Include-Trybots: luci.chromium.try:linux-blink-rel
> Change-Id: I01e2515cfa8e5356ee862ea7184bb7ceb4c9176f
> Reviewed-on: https://skia-review.googlesource.com/c/192038
> Commit-Queue: Mike Klein <mtklein@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

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

Change-Id: Ic88368e193aaa48b9aa6d3a6c145377681b2a5db
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Cq-Include-Trybots: luci.chromium.try:linux-blink-rel
Reviewed-on: https://skia-review.googlesource.com/c/194005
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-02-21 21:16:16 +00:00
Mike Klein
b03b80066b remove linear sRGB singleton
Cq-Include-Trybots: luci.chromium.try:linux-blink-rel
Change-Id: I01e2515cfa8e5356ee862ea7184bb7ceb4c9176f
Reviewed-on: https://skia-review.googlesource.com/c/192038
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-02-21 17:31:12 +00:00
Mike Reed
f922c783fd add colorspace param to textblobdiff canvas
Bug: skia:8773
Change-Id: Ib5d04e02a1568ad8a2b3f1baccb9544515f772f9
Reviewed-on: https://skia-review.googlesource.com/c/193373
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-02-20 04:52:48 +00:00
Michael Ludwig
136f45a636 Formalize edge-aa interaction with GrAA
With this formalization, the edge-AA APIs in GrRTC can distinguish
between tiling cases and regular drawing cases implemented using
kNone or kAll for the AA flags. This means fillRectToRect can be
implemented in terms of fillRectWithEdgeAA.

It also means the drawTexture cases will properly handle
isolated draws and tiled draws when drawing into MSAA.

Bug: skia:
Change-Id: I248dd001919228a958cf84b6bc91363b58b72c0b
Reviewed-on: https://skia-review.googlesource.com/c/192023
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-02-19 17:49:57 +00:00
Mike Reed
d6c69d2163 Experiment: always use doubles for setLength
Should allow more stroke cases to succeed, and simplifies the impl.

Bug: oss-fuzz:6811
Change-Id: I53390f57372938ba6d732726486a567c26ff121f
Reviewed-on: https://skia-review.googlesource.com/c/131140
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2019-02-18 21:54:38 +00:00
Robert Phillips
be9aff25bd Remove GrContextPriv.h from GrRenderTargetContext.h
Change-Id: Ib3afe6d8f2f9607eededb4dd4ef9dbe305741cfb
Reviewed-on: https://skia-review.googlesource.com/c/192829
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-02-15 17:29:03 +00:00
Michael Ludwig
e9c57d3ef5 Clean up GrQuad ctors
Refactor Sk4f transformations into reusable internal function.
Switches the SkRect+SkMatrix ctor to a factory method.
Adds simple constructors for Sk4fs and SkRects w/o transforms.

Bug: skia:
Change-Id: I88a4a5f7304b1cf00d68c7772bb0fc19c97abee3
Reviewed-on: https://skia-review.googlesource.com/c/191569
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-02-14 20:46:39 +00:00
Brian Salomon
67f01951d0 Use destructors to free resources owned by lazy proxy callbacks
Change-Id: I103355f12e808c636803491c86d3c887113f088c
Reviewed-on: https://skia-review.googlesource.com/c/192541
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-02-14 19:25:45 +00:00
Florin Malita
562017b086 [SVGCanvas] Clean up public factories
Remove the internal-only/XMLWriter-based factory.

Update SkSVGDevice to always own the xml writer.

The only internal client passing an interesting XMLWriter is
SVGDeviceTest - update to use the device factory directly.

While at it, update the SkSVGDevice factory to return smart pointers
(Create -> Make).

Change-Id: Ibda1ca86ef9fb81ab512822000835ace1af67978
Reviewed-on: https://skia-review.googlesource.com/c/192580
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-02-14 19:17:35 +00:00
Michael Ludwig
d54ca8f754 Add blendmode to GrRTC::drawTexture
This makes drawTexture handle blend modes with a fallback to be consistent
with drawTextureSet. Simple draws (other than non src-over) should be
faster now since they will skip the extra overhead of the GrTextureAdjuster.

It also refactors the GrPaint emulation of GrTextureOp into a function,
which will be reused in the general-purpose quad APIs.

Bug: skia:
Change-Id: Idad67ec749b82c6894df6ec2b57987130125b910
Reviewed-on: https://skia-review.googlesource.com/c/191360
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-02-14 18:21:50 +00:00
Greg Daniel
f259b8ba17 Add kRGB_888X_GrPixelConfig
This is needed to support importing of RGBX AHB into skia's vulkan backend.
With this CL we only enable the new pixel config to be textureable.

Bug: skia:
Change-Id: Iba9180c14f3ef633ae846091cf453d68f82ce544
Reviewed-on: https://skia-review.googlesource.com/c/192035
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-02-14 15:01:55 +00:00
Mike Reed
62ad46b059 fix contour-measure for move-line-move
Use RawIter, so we can dependably peek() (since consumeDegenerates in
Iter() make peeking unreliable), which caused us to think there were two
real contours in the test case.

Bug: oss-fuzz:13013
Change-Id: I0d85f3e6a83cb972c4d801dd9b17f0e388b926d0
Reviewed-on: https://skia-review.googlesource.com/c/192025
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2019-02-13 17:14:09 +00:00
Robert Phillips
6f0e02f5d7 Switch path renderers over to using GrRecordingContext
The path renderers convert paths into Ganesh ops when recording so should also be able to make due with only the GrRecordingContext.

Change-Id: Ie796af73ca5aa2a074ebd037d6d558ec85ff5928
Reviewed-on: https://skia-review.googlesource.com/c/191568
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-02-13 16:58:29 +00:00
Robert Phillips
b97da530f0 Switch Ops over to using GrRecordingContext
Since, by definition, the ops are created when recording, it makes sense that they should be able to make due with only the GrRecordingContext.

TBR=bsalomon@google.com
Change-Id: If64353aee30b35d0a16401f7de00954f44ed8c59
Reviewed-on: https://skia-review.googlesource.com/c/190670
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-02-13 15:53:09 +00:00
Ethan Nicholas
ac285b1c2a added constant 0 and 1 swizzle components to SkSL
Bug: skia:
Change-Id: I8f4dce314ebe0d5de7ba032a435f362eeb14edc4
Reviewed-on: https://skia-review.googlesource.com/c/191565
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2019-02-13 14:43:07 +00:00
Greg Daniel
60ea40c210 Remove private configs from GrPixelConfig.
GrPixelConfig is no longer public so there is no need for us to have the
special private configs.

Bug: skia:
Change-Id: Id732a3b2db3a7b9fd5d767e5548e796a4e670547
Reviewed-on: https://skia-review.googlesource.com/c/191572
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-02-12 19:08:01 +00:00
Ethan Nicholas
0dc8087e91 SkSL Metal backend can now handle CCPR
Bug: skia:
Change-Id: I796a40db46174b405495af8234c5b8d7920a46d6
Reviewed-on: https://skia-review.googlesource.com/c/189985
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2019-02-12 14:56:00 +00:00
Brian Salomon
1f05d459e2 Add GrContext::resetGLTextureBindings().
This function binds texture ID 0 to any texture unit/target combo that
Skia has modified.

Bug: chromium:926017
Change-Id: I3ac8f8050c863232886102886e60d3b91a5380c9
Reviewed-on: https://skia-review.googlesource.com/c/190663
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-02-08 21:26:51 +00:00
Robert Phillips
d6841487eb Move auditTrail and opMemoryPool from GrContext to GrRecordingContext
Any context that records ops (i.e., direct and/or DDL) will need these two objects.

Change-Id: Ifd3527c23a4015f7d469ad2222563508cccbd339
Reviewed-on: https://skia-review.googlesource.com/c/190307
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-02-08 16:07:56 +00:00
Jim Van Verth
6bc650e9d7 Fix Metal bots.
Disables some invalid tests and re-enables others.
Fixes up a shader issue.

Bug: skia:8243
Change-Id: I03c3685c1f0bc55c435121d659e52115f114ca7f
Reviewed-on: https://skia-review.googlesource.com/c/190300
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2019-02-07 21:00:20 +00:00
Brian Salomon
601ac80b48 Cache CPU memory buffers used for client side arrays.
Use same cache for CPU-side copy of data when using GPU buffers.

Change-Id: I09f2837211a30aabc50e9897c090f5fbc6d90492
Reviewed-on: https://skia-review.googlesource.com/c/189484
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-02-07 20:25:55 +00:00
Mike Klein
dcfc3ef110 skvx wip
- remove ALWAYS_INLINE until we find we need it

 - make bit_puns explicit

 - implement everything recursively so, e.g.
   sqrt(float8) picks up sqrt(float4) when
   not otherwise specialized.

 - implement SSE specializations:
   of the operations I tested, only sqrt, rcp, and rsqrt
   needed any help.  The others look good as-is.

Change-Id: I1b679c7bd9a99f952272b118d7ade2469b55d604
Reviewed-on: https://skia-review.googlesource.com/c/190222
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-02-07 20:06:46 +00:00