Commit Graph

8514 Commits

Author SHA1 Message Date
Cary Clark
27dddae313 rebase
This reverts commit 32a4910e57.

Reason for revert: SkMatrix::toString use has been removed from flutter
and has been picked up in fuchsia

Additionally some bookmaker changes take into account recent
additions of typedef comments and the generated header comment.

Original change's description:
> Revert "remove toString"
>
> This reverts commit 5191880cbf.
>
> Reason for revert: broke flutter
>
> Original change's description:
> > remove toString
> >
> > toString may have been used by obsolete debugger only
> > find out if that is so
> >
> > R=​brianosman@google.com,bsalomon@google.com
> >
> > Docs-Preview: https://skia.org/?cl=119894
> > Bug:830651
> > Change-Id: I737f19b7d3fbc869bea2f443fa3b5ed7c1393ffd
> > Reviewed-on: https://skia-review.googlesource.com/119894
> > Commit-Queue: Cary Clark <caryclark@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
>
> TBR=bsalomon@google.com,brianosman@google.com,caryclark@google.com,caryclark@skia.org
>
> Change-Id: I9f81de6c3615ee0608bcea9081b77239b4b8816c

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

# Not skipping CQ checks because original CL landed > 1 day ago.

Reviewed-on: https://skia-review.googlesource.com/129623
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@google.com>
Docs-Preview: https://skia.org/?cl=133583
Bug: 830651
Change-Id: If8499e796be63580ad419e150e94d43e8b89de1b
Reviewed-on: https://skia-review.googlesource.com/133583
Commit-Queue: Cary Clark <caryclark@skia.org>
Auto-Submit: Cary Clark <caryclark@skia.org>
2018-06-08 20:36:53 +00:00
Chris Dalton
afa11586d7 Make the SkPathRef GenIDChangeListener ref counted
Bug: skia:
Change-Id: I2780e3fc76153373b4efca6059ded82f4f749325
Reviewed-on: https://skia-review.googlesource.com/133502
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2018-06-08 20:15:03 +00:00
Herb Derby
59d997a6e1 New more efficient run builder
A system for building glyph runs. In the future the builder will
only live in canvas, but it's internal structures facilitate
interacting with the cache a single glyph at a time. When all
the bulk code is in place, only runs will be passed around.

Passing the builder down the text draw stack is temporary.

Change-Id: I6e3ed184b3f3a58b919377f2d31936e971bd8efa
Reviewed-on: https://skia-review.googlesource.com/132928
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2018-06-08 19:25:43 +00:00
Greg Daniel
9eb36b9eb8 Reland "Require mips to be allocated at texture creation time and disable late allocations."
This reverts commit 0c78238e29.

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 cd2c3f9055.
> 
> 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>
2018-06-08 17:39:33 +00:00
Cary Clark
9149954e3a update SkColor
SkColor.h generated include.

Also add generated comment for all files.
And, added typedef documentation where missing.

TBR=reed@google.com

Bug: skia:6898
Change-Id: Ib7757d70c1926b5ae04a5de557711756fce631b6
Reviewed-on: https://skia-review.googlesource.com/132827
Auto-Submit: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
Reviewed-by: Cary Clark <caryclark@skia.org>
2018-06-08 16:36:31 +00:00
Mike Klein
5f444c9072 remove final SkTypes dependencies in SkArenaAlloc
Change-Id: I09ab433fecdba01f8e652816be08817da68eea56
Reviewed-on: https://skia-review.googlesource.com/132926
Commit-Queue: Hal Canary <halcanary@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2018-06-08 15:34:11 +00:00
Mike Klein
9f752aada3 tweak SkArenaAlloc comments, parameter names
Change-Id: Ie7518f2ad2e0f11f0acd5a3bfeff4e5ca7188311
Reviewed-on: https://skia-review.googlesource.com/132925
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2018-06-07 22:59:36 +00:00
Mike Klein
2e361a3c34 remove unused stat tracking from SkArenaAlloc
I'm really only trying to remove the dependency on SkDebugf().
If we want to keep this, I could switch it to take an optional
stats callback called in the destructor?

Change-Id: I5aa2a58ccc7c8e17e61f29b482b2851be056fa07
Reviewed-on: https://skia-review.googlesource.com/132922
Auto-Submit: Mike Klein <mtklein@chromium.org>
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2018-06-07 20:51:06 +00:00
Greg Daniel
0c78238e29 Revert "Require mips to be allocated at texture creation time and disable late allocations."
This reverts commit cd2c3f9055.

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>
2018-06-07 20:11:33 +00:00
Greg Daniel
cd2c3f9055 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>
2018-06-07 19:35:01 +00:00
Ben Wagner
c174cc675c Add SkTypeface::makeClone.
This adds an method to typeface to allow users to create a copy of the
typeface with different arguments for its parameters. This is far more
efficient when animating a variation font.

BUG=skia:7121

Change-Id: I34e7557a08c7005f8149ea44f0c28de9c59d15a7
Reviewed-on: https://skia-review.googlesource.com/132480
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2018-06-07 19:32:11 +00:00
Khushal
fa8ff09457 fonts: Hook up FallbackTextHelper to font remoting.
Use GrContext::FallbackTextHelper in SkTextBlobCacheDiffCanvas to
replicate glyph generation logic for fallback text during analysis. This
ensures that we correctly handle these fallback cases when using
distance field or paths for text rendering.

R=herb@google.com, jvanverth@google.com

Bug: skia:7913
Change-Id: I3067c4f1bd09231a564ac7c4cd89efcb876d2abd
Reviewed-on: https://skia-review.googlesource.com/132285
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Khusal Sagar <khushalsagar@chromium.org>
2018-06-07 18:03:11 +00:00
Greg Daniel
dc636203f4 Add guard around GrVkBackendContext::Create function.
Just want to make sure the use of this doesn't leak out to other users
as I work on removing it.

Bug: skia:
Change-Id: I5ecf11615db64bd489065e6f67e0e1d4bb3298eb
Reviewed-on: https://skia-review.googlesource.com/132831
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-06-07 16:32:11 +00:00
Mike Klein
d62c4bd38c require std::is_trivially_destructible
Change-Id: I78cbaf420ad1e16f07eacb8b4c6c825fe849b08a
Reviewed-on: https://skia-review.googlesource.com/132825
Auto-Submit: Mike Klein <mtklein@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2018-06-07 16:03:31 +00:00
Mike Klein
d07dc361bc clean up some unused parts of SkArenaAlloc
I'm looking at making SkArenaAlloc independent of Skia.
Here's a bit of low-hanging fruit.

Nothing is using makeSkSp().  Good... it seems real dangerous.

Change-Id: Ib7154e7948a3c6d828376ef37935636b3b4695ff
Reviewed-on: https://skia-review.googlesource.com/132824
Commit-Queue: Mike Klein <mtklein@chromium.org>
Commit-Queue: Herb Derby <herb@google.com>
Auto-Submit: Mike Klein <mtklein@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
2018-06-07 14:21:28 +00:00
Herb Derby
4ffa027cf6 Smarter use of glyph cache
Change-Id: Ic9bea7310b375575503042881d9d54ff13996729
Reviewed-on: https://skia-review.googlesource.com/131924
Reviewed-by: Mike Klein <mtklein@chromium.org>
2018-06-06 19:07:52 +00:00
Mike Klein
12f25a2c22 simplify SK_FloatNaN
math.h contains NAN, an expression that evaluates to a quiet float NaN
While here, INFINITY is also a float, so the casts aren't needed.

Change-Id: Ibdd8f5a2767651cd4382d700e9125b832473a304
Reviewed-on: https://skia-review.googlesource.com/132087
Auto-Submit: Mike Klein <mtklein@chromium.org>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-06-05 16:01:28 +00:00
Brian Osman
e1adc3a955 Remove color space restrictions from image infos
What makes an info valid (or invalid)? Nothing to do with
color space.

Bug: skia:
Change-Id: I6795efa9aa74ab0d65935c5ddccc1058f8e0b112
Reviewed-on: https://skia-review.googlesource.com/131780
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-06-04 14:07:48 +00:00
Greg Daniel
8683037a2e Always keep buffers in vulkan persistently mapped.
This should hopefully fix (and possibly even improve) some of the perf
regressions we had form switching the memory allocator which were caused
by us now mapping and unmapping the entire VkDeviceMemory instead of just
subsets.

Bug: skia:
Change-Id: Ia8232594f33003e88969bf16febea4e4eec0ac95
Reviewed-on: https://skia-review.googlesource.com/131443
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2018-06-01 18:01:26 +00:00
Brian Osman
2b23c4bf31 Dest color space no longer impacts mipmaps or texture sampling
PS5: Removes SkDestinationSurfaceColorMode, tracking of mipmap
mode on GrTexture, sRGB decode state per-texture. Because we
were often choosing sRGB configs for RGB color types, legacy
rendering would then be incorrect (too dark). So...

PS7: Stops ever using sRGB pixel configs when translating
image info or color type. Also removes a bunch of GrCaps bits
and a GrContextOption that are no longer relevant.

PS9: Adjusts surface creation unit test expectations, and
changes the raster rules accordingly.

At this point, sRGB configs are (obviously) going to be broken.

Locally, I ran 8888, gl, and the gbr- versions of both. Across
all GMs x configs, there are 13 diffs. 12 are GMs that create
surfaces with a color-space attached (and thus, the offscreen
is no longer getting sRGB pixel config). The only remainder
constructs an SkPictureImageGenerator, (with an attached color
space) and renders it to the gbr-gl canvas, which triggers a
a tagged surface inside the generator.

Bug: skia:
Change-Id: Ie5edfa157dd799f3121e8173fc4f97f6c8ed6789
Reviewed-on: https://skia-review.googlesource.com/131282
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-06-01 17:00:26 +00:00
Derek Sollenberger
8103bb9609 Expose API for temporary use by the Android WebView.
The WebView needs this information in order to correctly draw into
an unclipped layer. This API can be removed when we update the
Android framework to no longer depend on unclipped layers.

Change-Id: Ibba63005730158021363d1d09e5338578f4fa541
Reviewed-on: https://skia-review.googlesource.com/131148
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
2018-05-31 18:21:50 +00:00
Greg Daniel
81df0414c8 Reland "Use GrVkMemoryAllocator for vulkan memory allocations in ganesh."
This is a reland of 331c266ed7

Original change's description:
> Use GrVkMemoryAllocator for vulkan memory allocations in ganesh.
> 
> Besides using the new allocator, the big logical change is that map
> and unmap calls form GrVkMemory are specc'd to map the entire GrVkAlloc
> instead of a specific offset and size as they did before. As a
> consequence of this, we move the handling of non-coherent alignment
> for flush/invalidate calls to GrVkMemory instead of the callers.
> 
> Bug: skia:
> Change-Id: I794d713106602f27aa7e808c306bbb69fd2b67be
> Reviewed-on: https://skia-review.googlesource.com/130021
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Jim Van Verth <jvanverth@google.com>

Bug: skia:
Change-Id: Ia9a4192d344449fb444d2adaa1d62ff1ede4b21d
Reviewed-on: https://skia-review.googlesource.com/131083
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-05-31 18:21:25 +00:00
Robert Phillips
774168efac Allow CCPR in DDL mode (take 2)
A lot of the changes to get this compiling on the
win_chromium_compile_dbg_ng bot (i.e., moving a lot of header files to
private) should be undone if that bot is ever "fixed".

Bug: skia:7988
Change-Id: I704ff793d80b18e7312048538874498824803580
Reviewed-on: https://skia-review.googlesource.com/130920
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-05-31 17:27:43 +00:00
Cary Clark
89ad31e97c Revert "Reland "remove toString""
This reverts commit 92e37b6d79.

Reason for revert: toString still used by flutter

Original change's description:
> Reland "remove toString"
> 
> This reverts commit 32a4910e57.
> 
> Reason for revert: SkMatrix::toString use has been removed from flutter and has been picked up in fuchsia
> 
> Original change's description:
> > Revert "remove toString"
> > 
> > This reverts commit 5191880cbf.
> > 
> > Reason for revert: broke flutter
> > 
> > Original change's description:
> > > remove toString
> > > 
> > > toString may have been used by obsolete debugger only
> > > find out if that is so
> > > 
> > > R=​brianosman@google.com,bsalomon@google.com
> > > 
> > > Docs-Preview: https://skia.org/?cl=119894
> > > Bug:830651
> > > Change-Id: I737f19b7d3fbc869bea2f443fa3b5ed7c1393ffd
> > > Reviewed-on: https://skia-review.googlesource.com/119894
> > > Commit-Queue: Cary Clark <caryclark@google.com>
> > > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > 
> > TBR=bsalomon@google.com,brianosman@google.com,caryclark@google.com,caryclark@skia.org
> > 
> > Change-Id: I9f81de6c3615ee0608bcea9081b77239b4b8816c
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Bug: 830651
> > Reviewed-on: https://skia-review.googlesource.com/129340
> > Reviewed-by: Cary Clark <caryclark@google.com>
> > Commit-Queue: Cary Clark <caryclark@google.com>
> 
> TBR=bsalomon@google.com,brianosman@google.com,caryclark@google.com,caryclark@skia.org
> 
> # Not skipping CQ checks because original CL landed > 1 day ago.
> 
> Bug: 830651
> Change-Id: Ida8725b6051132d8c46faf99358a8fcc1bcabf34
> Reviewed-on: https://skia-review.googlesource.com/129623
> Reviewed-by: Cary Clark <caryclark@skia.org>
> Reviewed-by: Cary Clark <caryclark@google.com>
> Commit-Queue: Cary Clark <caryclark@google.com>

TBR=bsalomon@google.com,brianosman@google.com,caryclark@google.com,caryclark@skia.org

Change-Id: Iafc59ffc1b3db67c520ba31bf12d68e1b46c0ea2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 830651
Reviewed-on: https://skia-review.googlesource.com/131082
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
2018-05-31 12:27:44 +00:00
Cary Clark
92e37b6d79 Reland "remove toString"
This reverts commit 32a4910e57.

Reason for revert: SkMatrix::toString use has been removed from flutter and has been picked up in fuchsia

Original change's description:
> Revert "remove toString"
> 
> This reverts commit 5191880cbf.
> 
> Reason for revert: broke flutter
> 
> Original change's description:
> > remove toString
> > 
> > toString may have been used by obsolete debugger only
> > find out if that is so
> > 
> > R=​brianosman@google.com,bsalomon@google.com
> > 
> > Docs-Preview: https://skia.org/?cl=119894
> > Bug:830651
> > Change-Id: I737f19b7d3fbc869bea2f443fa3b5ed7c1393ffd
> > Reviewed-on: https://skia-review.googlesource.com/119894
> > Commit-Queue: Cary Clark <caryclark@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> 
> TBR=bsalomon@google.com,brianosman@google.com,caryclark@google.com,caryclark@skia.org
> 
> Change-Id: I9f81de6c3615ee0608bcea9081b77239b4b8816c
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: 830651
> Reviewed-on: https://skia-review.googlesource.com/129340
> Reviewed-by: Cary Clark <caryclark@google.com>
> Commit-Queue: Cary Clark <caryclark@google.com>

TBR=bsalomon@google.com,brianosman@google.com,caryclark@google.com,caryclark@skia.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 830651
Change-Id: Ida8725b6051132d8c46faf99358a8fcc1bcabf34
Reviewed-on: https://skia-review.googlesource.com/129623
Reviewed-by: Cary Clark <caryclark@skia.org>
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
2018-05-31 11:43:13 +00:00
Greg Daniel
a9d3dae67a Revert "Use GrVkMemoryAllocator for vulkan memory allocations in ganesh."
This reverts commit 331c266ed7.

Reason for revert: breaking an intel vulkan bot

Original change's description:
> Use GrVkMemoryAllocator for vulkan memory allocations in ganesh.
> 
> Besides using the new allocator, the big logical change is that map
> and unmap calls form GrVkMemory are specc'd to map the entire GrVkAlloc
> instead of a specific offset and size as they did before. As a
> consequence of this, we move the handling of non-coherent alignment
> for flush/invalidate calls to GrVkMemory instead of the callers.
> 
> Bug: skia:
> Change-Id: I794d713106602f27aa7e808c306bbb69fd2b67be
> Reviewed-on: https://skia-review.googlesource.com/130021
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Jim Van Verth <jvanverth@google.com>

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

Change-Id: I5237c00625dc95d3d9b36c1e5591762988d85562
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/131081
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-05-30 22:59:08 +00:00
Greg Daniel
de81143630 Revert "Move include into head to fix build breakage."
This reverts commit fac695317f.

Reason for revert: needed to revert early change

Original change's description:
> Move include into head to fix build breakage.
> 
> Bug: skia:
> Change-Id: I47e182bf18f56c9c0749a1fd79b85d26fce9887e
> Reviewed-on: https://skia-review.googlesource.com/131022
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>
> Auto-Submit: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

TBR=egdaniel@google.com,rmistry@google.com,brianosman@google.com

Change-Id: Ie396d213c2e43e053a6c6df9cfb18ac4be8b909c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/131080
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-05-30 22:58:28 +00:00
Greg Daniel
fac695317f Move include into head to fix build breakage.
Bug: skia:
Change-Id: I47e182bf18f56c9c0749a1fd79b85d26fce9887e
Reviewed-on: https://skia-review.googlesource.com/131022
Commit-Queue: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-05-30 21:25:49 +00:00
Greg Daniel
331c266ed7 Use GrVkMemoryAllocator for vulkan memory allocations in ganesh.
Besides using the new allocator, the big logical change is that map
and unmap calls form GrVkMemory are specc'd to map the entire GrVkAlloc
instead of a specific offset and size as they did before. As a
consequence of this, we move the handling of non-coherent alignment
for flush/invalidate calls to GrVkMemory instead of the callers.

Bug: skia:
Change-Id: I794d713106602f27aa7e808c306bbb69fd2b67be
Reviewed-on: https://skia-review.googlesource.com/130021
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2018-05-30 19:52:38 +00:00
Ben Wagner
5d1adbfae9 Make sk_sp operator bool explicit.
The sk_sp class has been using the operator pointer to field as a c++98
version of explicit operator bool. This change updates this class to use
explicit operator bool. The one visible change is that the pointer to
field version isn't quite as explcit, requiring code changes for some
users.

Change-Id: Iddf8fb347b1d3ec33db1af08489c9fd885c9bf08
Reviewed-on: https://skia-review.googlesource.com/130380
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-05-30 18:54:38 +00:00
Robert Phillips
cf9086ce1e Revert "Allow CCPR in DDL mode"
This reverts commit 93540dd157.

Reason for revert: Chrome!

> Allow CCPR in DDL mode
> 
> Bug: skia:7988
> Change-Id: If757f29e0156c0ef7045b437b04e17aebe4de851
> Reviewed-on: https://skia-review.googlesource.com/130509
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>

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

Change-Id: Ibb5017d1bf307545969069b94987e0a51a22e333
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7988
Reviewed-on: https://skia-review.googlesource.com/130880
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-05-30 14:59:29 +00:00
Cary Clark
462505f310 include refresh
Update the includes to match the bookmaker docs.
All edits are generated; if something looks amiss, I
probably introduced a bug in the generator. Please
let me know.

I was careful to pick up all direct edits to the includes
and add them to their bookmaker counterpart. Please take
a look to see if your favorites are there.

Note that enum and struct members have been shortened
to fit on one line. The intent is to provide more verbose
documentation online. Let me know if this is too terse.

TBR=reed@google.com
Bug: skia:6898
Change-Id: I374673ed884e03e142439d91532efc558deeaccd
Reviewed-on: https://skia-review.googlesource.com/130540
Commit-Queue: Cary Clark <caryclark@skia.org>
Auto-Submit: Cary Clark <caryclark@skia.org>
Reviewed-by: Cary Clark <caryclark@google.com>
Reviewed-by: Cary Clark <caryclark@skia.org>
2018-05-30 13:51:43 +00:00
Greg Daniel
18dbfd05e4 Reland "Create API for GrVkMemoryAllocator and impliment use of AMD VulkanMemoryAllocator on this API."
This reverts commit 98bddf930e.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Revert "Create API for GrVkMemoryAllocator and impliment use of AMD VulkanMemoryAllocator on this API."
> 
> This reverts commit 26c0e4c1f5.
> 
> Reason for revert: breaks roll into fuchsia
> 
> Original change's description:
> > Create API for GrVkMemoryAllocator and impliment use of AMD VulkanMemoryAllocator on this API.
> > 
> > Bug: skia:
> > Change-Id: I1e122e1b11ab308c2f83cb98c36c81511f4507d0
> > Reviewed-on: https://skia-review.googlesource.com/129980
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Reviewed-by: Jim Van Verth <jvanverth@google.com>
> 
> 
> 
> Change-Id: I6c74978f778987c422e6162e7dd85ea9c6baa0e4
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:
> Reviewed-on: https://skia-review.googlesource.com/130182
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

Bug: skia:
Change-Id: I422ffb3562da567f2e85c806286ad1a17c3862cd
Reviewed-on: https://skia-review.googlesource.com/130183
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-05-30 13:27:38 +00:00
Robert Phillips
93540dd157 Allow CCPR in DDL mode
Bug: skia:7988
Change-Id: If757f29e0156c0ef7045b437b04e17aebe4de851
Reviewed-on: https://skia-review.googlesource.com/130509
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2018-05-30 13:21:48 +00:00
Mike Reed
f2c736400f support image-subsets in serialization
A follow-on API change *could* be to extend the SerialProcs to pass subset information
up to the client, in case they want to handle the subsetting step themselves.

Bug: skia:7983
Change-Id: I36d3f1ce439886384495485c3be3c591d611a135
Reviewed-on: https://skia-review.googlesource.com/130543
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-05-29 20:42:17 +00:00
Mike Klein
cdbec8f197 remove bit, srgbnl config in DM
We're not going to need the bit.

I've rewritten "esrgb" and "srgbnl" to express themselves the way I'd
like them to work.  Their images are supressed in Gold already.

Change-Id: I6da58cc75dcb998cbfcf9a8f65de31c030adb494
Reviewed-on: https://skia-review.googlesource.com/130506
Reviewed-by: Brian Osman <brianosman@google.com>
2018-05-29 19:14:03 +00:00
Brian Salomon
d8eb7b6b12 Reland "Turn off domain in GrTextureOp when src rect contains entire proxy"
This is a reland of 869433fa11

Original change's description:
> Turn off domain in GrTextureOp when src rect contains entire proxy
> 
> Move check for turning off domain when nearest/no-aa to GrRenderTargetContext.
> 
> Change-Id: I3c071b5f73fb3134218453204f30c3020c9dad9a
> Reviewed-on: https://skia-review.googlesource.com/130143
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

Change-Id: I29a21e26de8a246a74bd40fd0cda044f8f18327e
Reviewed-on: https://skia-review.googlesource.com/130307
Reviewed-by: Stephen White <senorblanco@chromium.org>
2018-05-26 18:36:12 +00:00
Stephen White
95ef524734 Revert "Turn off domain in GrTextureOp when src rect contains entire proxy"
This reverts commit 869433fa11.

Reason for revert: possibly preventing Chromium roll (layout tests)

Original change's description:
> Turn off domain in GrTextureOp when src rect contains entire proxy
> 
> Move check for turning off domain when nearest/no-aa to GrRenderTargetContext.
> 
> Change-Id: I3c071b5f73fb3134218453204f30c3020c9dad9a
> Reviewed-on: https://skia-review.googlesource.com/130143
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

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

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I8afc3c05b504ccde7d44e973d707f4cba1dc51b1
Reviewed-on: https://skia-review.googlesource.com/130302
Reviewed-by: Stephen White <senorblanco@chromium.org>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2018-05-26 16:58:43 +00:00
Greg Daniel
98bddf930e Revert "Create API for GrVkMemoryAllocator and impliment use of AMD VulkanMemoryAllocator on this API."
This reverts commit 26c0e4c1f5.

Reason for revert: breaks roll into fuchsia

Original change's description:
> Create API for GrVkMemoryAllocator and impliment use of AMD VulkanMemoryAllocator on this API.
> 
> Bug: skia:
> Change-Id: I1e122e1b11ab308c2f83cb98c36c81511f4507d0
> Reviewed-on: https://skia-review.googlesource.com/129980
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Jim Van Verth <jvanverth@google.com>

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

Change-Id: I6c74978f778987c422e6162e7dd85ea9c6baa0e4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/130182
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-05-25 17:25:23 +00:00
Greg Daniel
26c0e4c1f5 Create API for GrVkMemoryAllocator and impliment use of AMD VulkanMemoryAllocator on this API.
Bug: skia:
Change-Id: I1e122e1b11ab308c2f83cb98c36c81511f4507d0
Reviewed-on: https://skia-review.googlesource.com/129980
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2018-05-25 15:24:42 +00:00
Brian Salomon
869433fa11 Turn off domain in GrTextureOp when src rect contains entire proxy
Move check for turning off domain when nearest/no-aa to GrRenderTargetContext.

Change-Id: I3c071b5f73fb3134218453204f30c3020c9dad9a
Reviewed-on: https://skia-review.googlesource.com/130143
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-05-25 14:41:52 +00:00
Heather Miller
20027ceb28 Update Skia milestone to 69
TBR=reed@google.com

Bug: skia:
Change-Id: Ifabe4c89c9d0018da5d4f270d4e3fb5790e29bfc
Reviewed-on: https://skia-review.googlesource.com/130120
Reviewed-by: Heather Miller <hcm@google.com>
Commit-Queue: Heather Miller <hcm@google.com>
2018-05-24 21:23:08 +00:00
Herb Derby
26cbe5130a Rename GrAtlasTextContext -> GrTextContext
Change-Id: I309b39425afc9b45095241eeb299096bc426afed
Reviewed-on: https://skia-review.googlesource.com/130029
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2018-05-24 20:41:08 +00:00
Mike Reed
d2e74b8080 compute center slightly slower to avoid overflow
Bug: oss-fuzz:8509
Change-Id: I13b1a77e1549070827a7cc534b062ec85aad255e
Reviewed-on: https://skia-review.googlesource.com/129930
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-05-24 15:16:43 +00:00
Brian Salomon
75bf216c03 Move SkYUVAIndex and SkImageSourceChannel to SkImageInfoPriv.h until used in public API
Change-Id: Ib75be2b6e9eb9b80f1f9e738bc8e3300ddc08f22
Reviewed-on: https://skia-review.googlesource.com/129927
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Cary Clark <caryclark@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2018-05-24 14:14:43 +00:00
Khushal
3e7548ca60 Reland fonts: Add support for distance field text to font remoting.
This reverts commit 7257e22e43.

TBR=herb@google.com, bsalomon@google.com
Bug: skia:7913
Change-Id: I51ca5bccdda64cd98e2ad59874e7136ee58cec10
Reviewed-on: https://skia-review.googlesource.com/129809
Reviewed-by: Khusal Sagar <khushalsagar@chromium.org>
Commit-Queue: Khusal Sagar <khushalsagar@chromium.org>
2018-05-24 01:11:21 +00:00
Leon Scroggins III
4aafb3a8d1 Alternate between two SkBitmaps in SkAnimatedImage
Bug: 78866720

The client in Android calls newPictureSnapshot, which results in copying
the mutable SkBitmap into a newly allocated one in each frame. Avoid
this by calling SkMakeImageFromRasterBitmap with
kNever_SkCopyPixelsMode. Make SkAnimatedImage copy on write, by copying
before decoding if the bitmap's pixel ref is not unique.

Android's AnimatedImageDrawable's current architecture only decodes one
frame in advance, so it will never need to perform the copy on write.
This will save one bitmap allocation per GIF frame.

Add a test to verify that copy on write works as expected.

Change-Id: I87eb6e84089096cd2d618b91fb627fc58677e66a
Reviewed-on: https://skia-review.googlesource.com/129841
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
Auto-Submit: Leon Scroggins <scroggo@google.com>
2018-05-23 20:49:42 +00:00
Weiliang Chen
bed9d5ec3e Add usage of SkYUVAIndex as pre-step to transfer to new YUVA API
The plan foward is to have a new API on SkImage to make from YUVA
textures which a combination of array of textures and array of
SkYUVAIndex struct indicating which texture and channel to read for
each plane. This is a pre-step to let the old API use these ideas.

Bug: skia: 7903
Change-Id: I6a696db31a574247eb2abff60f2186a74b640142
Reviewed-on: https://skia-review.googlesource.com/128601
Commit-Queue: Weiliang Chen <weiliangc@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2018-05-23 18:50:53 +00:00
Mike Reed
ee43091c1b fix 0.499999f rounding case for triangles
Bug: skia:7994
Change-Id: I83bb309a2c8fb0bddaf78ba32c0a07537e483900
Reviewed-on: https://skia-review.googlesource.com/129648
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-05-23 16:54:32 +00:00
Brian Osman
fe75169912 Remove ColorCodecBench
This wasn't being run (AFAICT) and was built on pre-skcms color management.

Change-Id: I506e8767f716bc6e4590ce255c5e40f1064fc152
Reviewed-on: https://skia-review.googlesource.com/129644
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-05-23 15:20:21 +00:00
Mike Klein
7257e22e43 Revert "fonts: Add support for distance field text to font remoting."
This reverts commit 35e0a1a690.

Reason for revert: looks like we're leaking paths?
https://chromium-swarm.appspot.com/task?id=3da25e2f0cadb210&refresh=10

Original change's description:
> fonts: Add support for distance field text to font remoting.
> 
> R=​jvanverth@google.com, herb@google.com
> 
> Bug: skia:7913
> Change-Id: Id3f5b3e75005be9a7234df774268359b406c99a8
> Reviewed-on: https://skia-review.googlesource.com/128970
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Jim Van Verth <jvanverth@google.com>
> Commit-Queue: Khusal Sagar <khushalsagar@chromium.org>

TBR=jvanverth@google.com,bsalomon@google.com,bungeman@google.com,herb@google.com,khushalsagar@chromium.org

Change-Id: I37c54c8748db9b20e1f48016d8298808a1999fdb
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7913
Reviewed-on: https://skia-review.googlesource.com/129681
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-05-23 00:17:16 +00:00
Ben Wagner
e87225f12a Remove include/gpu/vk from include paths.
The public.bzl doesn't yet support vulkan, Chromium adds this include
path but appears to do so for the one header fixed in this CL, and
Android seems to be fine with this change.

Change-Id: I3869776a7653c420b584129936c302b8c8e9e8fa
Reviewed-on: https://skia-review.googlesource.com/129640
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2018-05-22 19:59:35 +00:00
Khushal
35e0a1a690 fonts: Add support for distance field text to font remoting.
R=jvanverth@google.com, herb@google.com

Bug: skia:7913
Change-Id: Id3f5b3e75005be9a7234df774268359b406c99a8
Reviewed-on: https://skia-review.googlesource.com/128970
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Khusal Sagar <khushalsagar@chromium.org>
2018-05-22 19:49:45 +00:00
Herb Derby
1724db1658 Remove SkTextBox
Change-Id: I697135475fa9c1b7e803500b743f10c3877c1e10
Reviewed-on: https://skia-review.googlesource.com/129560
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2018-05-22 17:50:35 +00:00
Ben Wagner
d90cd3b279 Revert "Revert "IWYU for tests starting with 'D'.""
This reverts commit edf8449d2c.

Change-Id: Ibeedd9965855b3ccfe44486d15307bf3da15fd9c
Reviewed-on: https://skia-review.googlesource.com/129516
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2018-05-22 17:12:35 +00:00
Mike Klein
5b58b7c14c Reland "strip down SkICC.cpp"
This reverts commit 27fe397bc0.

Reason for revert: time to fly.

Original change's description:
> Revert "strip down SkICC.cpp"
> 
> This reverts commit eab50eb9c6
> and this tiny bit of e61b969a07:
> 
>     https://skia-review.googlesource.com/c/skia/+/127122/3/tests/ICCTest.cpp
> 
> Change-Id: I4306e5118a4e5eb88c05078186a28bd443fd76f7
> Reviewed-on: https://skia-review.googlesource.com/127305
> Reviewed-by: Mike Klein <mtklein@chromium.org>
> Commit-Queue: Mike Klein <mtklein@chromium.org>

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

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I93a6cfb66f0da0e098fdcb77ac1cd619e41614b1
Reviewed-on: https://skia-review.googlesource.com/129446
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-05-22 14:17:15 +00:00
Mike Klein
edf8449d2c Revert "IWYU for tests starting with 'D'."
This reverts commit b5f2897ab5.

Reason for revert: looks like this broke the build for DM in Google3.  Need more include dirs there?

Original change's description:
> IWYU for tests starting with 'D'.
> 
> Change-Id: I9189e4b56ce1635b627119733447c2ed4220753d
> Reviewed-on: https://skia-review.googlesource.com/129319
> Reviewed-by: Herb Derby <herb@google.com>
> Commit-Queue: Ben Wagner <bungeman@google.com>

TBR=bsalomon@google.com,bungeman@google.com,herb@google.com

Change-Id: I01aac7dae6114685a0652cbde3defccc8a42caea
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/129443
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-05-22 12:23:15 +00:00
Herb Derby
1e7c65806f drawPosText no longer obeys paint alignment
Change-Id: Iac498b54dea4aa1b203d2b9c58e15bb5f2147f82
Reviewed-on: https://skia-review.googlesource.com/129462
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2018-05-21 21:53:54 +00:00
Herb Derby
c402b778d5 Remove sk_64_isS32 and sk_64_asS32
This is an API change. I assume that only Skia uses these routines.

Change-Id: Iefc98fa5c0b83eb4f52c478e345fd99121ecb254
Reviewed-on: https://skia-review.googlesource.com/129440
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2018-05-21 20:29:24 +00:00
Ben Wagner
b5f2897ab5 IWYU for tests starting with 'D'.
Change-Id: I9189e4b56ce1635b627119733447c2ed4220753d
Reviewed-on: https://skia-review.googlesource.com/129319
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2018-05-21 19:34:48 +00:00
Brian Salomon
969be1c98b Remove mask-filters and aa from SkPaint in SkCanvas for nine-patch/lattice.
Remove GPU fallback code which would have applied AA and mask filter
separately to each lattice cell.

Change-Id: I43d50f337d24bb34b94f3d0ea6cca686a2e11a50
Reviewed-on: https://skia-review.googlesource.com/129318
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
2018-05-21 19:10:08 +00:00
Greg Daniel
6d138bf681 Reland "Remove GrBackendObject and all related functions from Skia."
This is a reland of ccd4cfc23e

Original change's description:
> Remove GrBackendObject and all related functions from Skia.
> 
> Bug: skia:
> Change-Id: I59434b7477c0bc26fd982bd81eb97ab94bbba073
> Reviewed-on: https://skia-review.googlesource.com/125822
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

Bug: skia:
Change-Id: Ibd1b9bd04b36840d9d872e2f0970dd6bac378bc9
Reviewed-on: https://skia-review.googlesource.com/129380
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-05-21 18:25:38 +00:00
Cary Clark
4dc5a45405 remove defines and add commas
Preparation for generating bookmaker files for all remaining
interfaces

Standardize enum and enum classes by including a comma after
the last entry.

Replace flatten-related #define in public interfaces
with their equivalent.

The motivation is to give documentation something to refer to.

An alternative would be to move part or all of this out of the
public interface; something I can work on in a follow-up CL.

R=reed@google.com,bsalomon@google.com

Bug: skia:6898
Change-Id: I4b865f6ec3d8f5d31e50448fef7d2714510302f0
Reviewed-on: https://skia-review.googlesource.com/129312
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Cary Clark <caryclark@skia.org>
2018-05-21 17:33:39 +00:00
Cary Clark
32a4910e57 Revert "remove toString"
This reverts commit 5191880cbf.

Reason for revert: broke flutter

Original change's description:
> remove toString
> 
> toString may have been used by obsolete debugger only
> find out if that is so
> 
> R=​brianosman@google.com,bsalomon@google.com
> 
> Docs-Preview: https://skia.org/?cl=119894
> Bug:830651
> Change-Id: I737f19b7d3fbc869bea2f443fa3b5ed7c1393ffd
> Reviewed-on: https://skia-review.googlesource.com/119894
> Commit-Queue: Cary Clark <caryclark@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

TBR=bsalomon@google.com,brianosman@google.com,caryclark@google.com,caryclark@skia.org

Change-Id: I9f81de6c3615ee0608bcea9081b77239b4b8816c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 830651
Reviewed-on: https://skia-review.googlesource.com/129340
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
2018-05-20 23:15:48 +00:00
Cary Clark
5191880cbf remove toString
toString may have been used by obsolete debugger only
find out if that is so

R=brianosman@google.com,bsalomon@google.com

Docs-Preview: https://skia.org/?cl=119894
Bug:830651
Change-Id: I737f19b7d3fbc869bea2f443fa3b5ed7c1393ffd
Reviewed-on: https://skia-review.googlesource.com/119894
Commit-Queue: Cary Clark <caryclark@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-05-20 21:16:37 +00:00
Mike Reed
ba5b5f5171 harden line2d effect
Suggested by https://fuzzer.skia.org/category/n32_canvas/file/c3JjL2NvcmUvU2tTdHJva2UuY3Bw?

Bug: skia:
Change-Id: I8ec48f844bfa5d063f0ab1bdfe0612ec4673ada3
Reviewed-on: https://skia-review.googlesource.com/129260
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-05-18 21:03:54 +00:00
Adrienne Walker
4ee88511bc Driver bug workaround: unbind_attachments_on_bound_render_fbo_delete
Bug: chromium: 829614
Change-Id: Ic6bc276d1203d24f96fe92b41655871e25f69623
Reviewed-on: https://skia-review.googlesource.com/128395
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Adrienne Walker <enne@chromium.org>
2018-05-18 17:26:14 +00:00
Ben Wagner
255ab8d9a5 Make SkStream readers report failure.
This also fixes an issue noticed while making this change where
SkFontDescriptor improperly round trips negative axis values.

Change-Id: Iacc5929a185659dcacc18c802c4908e4f34c6899
Reviewed-on: https://skia-review.googlesource.com/128341
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
2018-05-18 15:06:24 +00:00
Robert Phillips
8f8d481b44 Add SkIRect::adjust method
Change-Id: Ib18d1a82944524e20d5d72912d8db7a823c470de
Reviewed-on: https://skia-review.googlesource.com/128884
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Cary Clark <caryclark@google.com>
2018-05-18 14:53:45 +00:00
Khushal
51371a4339 fonts: Handle fallback to using paths for text rendering for remoting.
SkRemoteGlyphCache only sends images for glyphs, even for cases where
the gpu falls back to drawing text as paths. This includes cases in
SkDraw::ShouldDrawTextAsPaths and when the glyph exceeds the max bounds
that can fit on the atlas. Fix this by identifying these cases in the
renderer and sending paths instead.

Note: We still don't handle distance field text correctly.

R=herb@google.com, bsalomon@google.com

Bug: skia:7913
Change-Id: I17d4eccbeaa2e995ae67b61c76cebd27f8280329
Reviewed-on: https://skia-review.googlesource.com/128203
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Khusal Sagar <khushalsagar@chromium.org>
2018-05-17 20:50:43 +00:00
Ben Wagner
e6c0fe0b8f Remove SK_IGNORE_SKIMAGE_ONREFENCODED_CHANGE.
All implementers have been updated, so remove the flag and old code.

Change-Id: Ie9747f37dd0ea3f1db682891bcae2496a470bc3a
Reviewed-on: https://skia-review.googlesource.com/128883
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2018-05-17 20:40:03 +00:00
Robert Phillips
120784394c Fix srcBounds computation in SkMatrixConvolutionImageFilter
Note that this does change the behavior of the cropRect for the repeated case. The cropRect now only acts as a hard clip on the output.

BUG= skia:7766

Change-Id: I1d66678bc797cd4835701cd20c36e68b22ac880a
Reviewed-on: https://skia-review.googlesource.com/127338
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-05-17 17:06:24 +00:00
Cary Clark
c06754b046 mapRect should not fiddle with nonfinite values.
Docs-Preview: https://skia.org/?cl=128682
Bug: skia:7967
Change-Id: Ic43387b7705ee8385b8df2430886484ff856077c
Reviewed-on: https://skia-review.googlesource.com/128682
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-05-17 14:02:43 +00:00
Adrienne Walker
c48f776682 Driver bug workaround: pack_parameters_workaround_with_pack_buffer
Bug: chromium: 829614
Change-Id: I3fae2b4181e4a6e37fb31fe2f2e9a6cfacb1860f
Reviewed-on: https://skia-review.googlesource.com/128206
Commit-Queue: Adrienne Walker <enne@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-05-16 19:45:42 +00:00
Ben Wagner
bdf5433ab4 SkImage::onRefEncoded to return sk_sp.
This changes SkImage::onRefEncoded and downstack calls to return sk_sp.
All of the values returned are already sk_sp, so this just updates the
API. This change is currently behind the new flag
SK_IGNORE_SKIMAGE_ONREFENCODED_CHANGE so that Chromium can be updated.

Change-Id: Ic53a88ae23fa8b3b41b84c4abdc4b74e9879da38
Reviewed-on: https://skia-review.googlesource.com/128311
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2018-05-16 18:53:12 +00:00
Adrienne Walker
94f585ed09 Driver bug workaround: gl_clear_broken
Skia does not appear to use depth buffers and this appears to be
identical to ClearFramebufferResourceManager::ClearFramebuffer in
Chromium code.  Therefore, just hook up this workaround to turn
on these internal Skia workarounds.

Bug: chromium: 829614
Change-Id: Icc5f2eb981e39ffef487efa16940d2e50cdbc399
Reviewed-on: https://skia-review.googlesource.com/127220
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Adrienne Walker <enne@chromium.org>
2018-05-16 18:31:22 +00:00
Adrienne Walker
3ed3399a93 Driver bug workaround: restore_scissor_on_fbo_change
Bug: chromium: 829614
Change-Id: I333aed9a378ab9b7aafaa96bb495378d1db4a61d
Reviewed-on: https://skia-review.googlesource.com/127118
Commit-Queue: Adrienne Walker <enne@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-05-16 18:19:52 +00:00
Cary Clark
510e9e399b Reland "Reland "remove obsolete color defines""
This reverts commit d286aa73f1.

Reason for revert: fuchsia has rolled forward

Original change's description:
> Revert "Reland "remove obsolete color defines""
> 
> This reverts commit 05cfcff70c.
> 
> Reason for revert: breaks flutter
> 
> Original change's description:
> > Reland "remove obsolete color defines"
> > 
> > This reverts commit 3155d9c912.
> > 
> > Reason for revert: pdfium bots are no more
> > 
> > Original change's description:
> > > Revert "remove obsolete color defines"
> > > 
> > > This reverts commit 8afbecbcc0.
> > > 
> > > Reason for revert: broke pdfium
> > > 
> > > Original change's description:
> > > > remove obsolete color defines
> > > > 
> > > > The uses in Skia, Chrome, and Google3 have already
> > > > been removed. If I missed one or more, please let
> > > > me know (and feel free to revert).
> > > > 
> > > > TBR=reed@google.com,brianosman@google.com
> > > > Bug: skia:6898
> > > > Change-Id: I9d15b1a06f5abfc3a0fc6f3f1b4d348916c3d362
> > > > Reviewed-on: https://skia-review.googlesource.com/124840
> > > > Reviewed-by: Cary Clark <caryclark@skia.org>
> > > > Commit-Queue: Cary Clark <caryclark@skia.org>
> > > > Auto-Submit: Cary Clark <caryclark@skia.org>
> > > 
> > > TBR=brianosman@google.com,reed@google.com,caryclark@skia.org
> > > 
> > > Change-Id: Ic7c1003261cda5dee80e222da123c6717b4ea707
> > > No-Presubmit: true
> > > No-Tree-Checks: true
> > > No-Try: true
> > > Bug: skia:6898
> > > Reviewed-on: https://skia-review.googlesource.com/124880
> > > Reviewed-by: Cary Clark <caryclark@skia.org>
> > > Commit-Queue: Cary Clark <caryclark@skia.org>
> > 
> > TBR=brianosman@google.com,reed@google.com,caryclark@skia.org
> > 
> > # Not skipping CQ checks because original CL landed > 1 day ago.
> > 
> > Bug: skia:6898
> > Change-Id: I3605fa0ebb2bfecc26d198e9de008c82d31d747b
> > Reviewed-on: https://skia-review.googlesource.com/126001
> > Reviewed-by: Cary Clark <caryclark@google.com>
> > Commit-Queue: Cary Clark <caryclark@google.com>
> 
> TBR=brianosman@google.com,caryclark@google.com,reed@google.com,caryclark@skia.org
> 
> Change-Id: I469794b86487322c385e50275d548c1895c30cff
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:6898
> Reviewed-on: https://skia-review.googlesource.com/126040
> Reviewed-by: Cary Clark <caryclark@google.com>
> Commit-Queue: Cary Clark <caryclark@google.com>

TBR=brianosman@google.com,caryclark@google.com,reed@google.com,caryclark@skia.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: skia:6898
Change-Id: I03bd75d28dfad86455b48dea7930bebc95bf82d3
Reviewed-on: https://skia-review.googlesource.com/128500
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
2018-05-16 13:51:14 +00:00
Kevin Lubick
6ee268de12 Fix UBSAN warnings in SkPerlinNoiseShaderImpl
Also update the docs in places.

Bug: oss-fuzz:6138, oss-fuzz:6275, oss-fuzz:6118
Change-Id: Idfef4118dd6e58f8aa528365895f7d7b8ebc50e5
Reviewed-on: https://skia-review.googlesource.com/128300
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2018-05-16 12:40:44 +00:00
Adrienne Walker
d7c7978d8c Driver bug workaround: max_msaa_sample_count_4
Bug: chromium: 829614
Change-Id: I54054191815ace6159585dab7dd811ebdc863095
Reviewed-on: https://skia-review.googlesource.com/126983
Commit-Queue: Adrienne Walker <enne@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-05-15 22:10:43 +00:00
Adrienne Walker
001cae07d3 Driver bug workaround: disallow_large_instanced_draw
Bug: chromium: 829614
Change-Id: I3c64cd360674f08b4ca3c4a2d0ef946e40a5c60a
Reviewed-on: https://skia-review.googlesource.com/126751
Commit-Queue: Adrienne Walker <enne@chromium.org>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
2018-05-15 22:06:43 +00:00
Cary Clark
cc45cc7c17 remove typedef Info
typedef SkImageInfo Info saves a little typing at the cost of
obfuscating the parameter type. It's only used in a couple of
places so remove it.

The documentation catalog has gotten a bit stale, so update
that as well.

Docs-Preview: https://skia.org/?cl=128400
Bug: skia:6898
Change-Id: I621743a2b2d9a78d5f62742501eebf5f4327efa0
Reviewed-on: https://skia-review.googlesource.com/128400
Commit-Queue: Cary Clark <caryclark@skia.org>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Cary Clark <caryclark@skia.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-05-15 22:04:23 +00:00
Adrienne Walker
724afe8b2d Driver bug workaround: max_texture_size_limit_4096
Bug: chromium: 829614
Change-Id: I127157fa04df2ec6505411aa42f1232910e251d4
Reviewed-on: https://skia-review.googlesource.com/126608
Commit-Queue: Adrienne Walker <enne@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-05-15 19:56:23 +00:00
Mike Klein
fb8bafb352 remove unused SkColorSpace::Make
Since we reverted the dst-color-space CL, this is no longer used.

Change-Id: I50c5c1fbea2b94a1da130d50a17670c152615fb3
Reviewed-on: https://skia-review.googlesource.com/128317
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2018-05-15 19:47:43 +00:00
Ben Wagner
ecd35c16ef Remove non-smart SkFontConfigInterface::SetGlobal.
This method is no longer used and is superseded by the 'smart' version.

Change-Id: Ic27545a2ec2666d77966727630ba7e960eac5506
Reviewed-on: https://skia-review.googlesource.com/128316
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2018-05-15 19:42:13 +00:00
Adrienne Walker
0e38394ffc Reland "Driver bug workaround: disable_discard_framebuffer"
This is a reland of f31fece658

Original change's description:
> Driver bug workaround: disable_discard_framebuffer
>
> Bug: chromium: 829614
> Change-Id: I285b39b31a370247518e3a0b56ac4ea54f38c0c0
> Reviewed-on: https://skia-review.googlesource.com/126749
> Commit-Queue: Adrienne Walker <enne@chromium.org>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Auto-Submit: Adrienne Walker <enne@chromium.org>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

Bug: chromium: 829614
Change-Id: I6cc2de11a6315ff224c90551e8dd3e1d1dd4139a
Reviewed-on: https://skia-review.googlesource.com/128108
Commit-Queue: Adrienne Walker <enne@chromium.org>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Adrienne Walker <enne@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-05-15 18:58:23 +00:00
Adrienne Walker
683148419e Reland "Driver bug workaround: disable_blend_equation_advanced"
This is a reland of f31fece658

Original change's description:
> Driver bug workaround: disable_blend_equation_advanced
>
> Bug: chromium: 829614
> Change-Id: If8eaec6d22412ec36aad8a143f84080be05f2926
> Reviewed-on: https://skia-review.googlesource.com/126748
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Adrienne Walker <enne@chromium.org>

Bug: chromium: 829614
Change-Id: Idd36ff90a99336521ef5d47f0d7baf079c1bda09
Reviewed-on: https://skia-review.googlesource.com/128107
Commit-Queue: Adrienne Walker <enne@chromium.org>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Adrienne Walker <enne@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-05-15 18:09:43 +00:00
Adrienne Walker
ab7181daad Reland "Add driver bug workarounds to GrCaps"
This is a reland of 328490c6a1

Original change's description:
> Add driver bug workarounds to GrCaps
> 
> This moves GrDriverBugWorkarounds to include so that it can be included
> by GrCaps.  This also makes GrContextOptions a nearly empty class in
> the case of !SK_SUPPORT_GPU so that non-gpu builds don't need to build
> in GrDriverBugWorkarounds.cpp.
> 
> Bug: chromium: 829614
> Change-Id: Iedf73677fd09e9a487cfe618a696fd4b25c8703d
> Reviewed-on: https://skia-review.googlesource.com/126581
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Adrienne Walker <enne@chromium.org>

Bug: chromium: 829614
Change-Id: I7b539f99caa3032c8c595dd5068dc3b179747ccd
Reviewed-on: https://skia-review.googlesource.com/127304
Commit-Queue: Adrienne Walker <enne@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-05-14 23:46:49 +00:00
Ben Wagner
a20681c2ac Move SkFontConfigInterface to smart pointers.
This old interface may be easier to move away from if it isn't so
difficult to understand.

Change-Id: Ib04b00e55fd5c11aca8cc70bc6c7b0b5ba98dcae
Reviewed-on: https://skia-review.googlesource.com/127969
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2018-05-14 19:25:10 +00:00
Mike Reed
9236b02264 Revert "Revert "implement SkScalar versions in terms of float versions""
This reverts commit 0e6db75eeb.

Bug: skia:
Change-Id: I015d01efc58dfe03dae6bcc57c4b1102276e7566
Reviewed-on: https://skia-review.googlesource.com/127967
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-05-14 18:20:29 +00:00
Mike Reed
0e6db75eeb Revert "implement SkScalar versions in terms of float versions"
This reverts commit 4c3cb3767f.

Reason for revert: investigate asan failures

Original change's description:
> implement SkScalar versions in terms of float versions
> 
> Bug: skia:
> Change-Id: I44ce228290f7fda5b7e3553c8543dcf581b1ca3b
> Reviewed-on: https://skia-review.googlesource.com/127128
> Reviewed-by: Cary Clark <caryclark@google.com>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=caryclark@google.com,reed@google.com

Change-Id: Ic790b15130a67f46a0a99fdf991c5c08d682be5e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/128060
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-05-14 16:05:20 +00:00
Mike Reed
4c3cb3767f implement SkScalar versions in terms of float versions
Bug: skia:
Change-Id: I44ce228290f7fda5b7e3553c8543dcf581b1ca3b
Reviewed-on: https://skia-review.googlesource.com/127128
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-05-14 14:17:59 +00:00
Robert Phillips
5140f9a8e4 Minor refactoring to image filters
This pulls the boring parts out of: https://skia-review.googlesource.com/c/skia/+/127338 (Fix srcBounds computation in SkMatrixConvolutionImageFilter)

TBR=bsalomon@google.com
Change-Id: Iade788fcc96c4c16989d13e7592030a6a1d3f170
Reviewed-on: https://skia-review.googlesource.com/127573
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2018-05-14 12:01:59 +00:00
Brian Salomon
79bf7ac3f4 Include SkUnPremultiply.h in GrContext.h to fix Android compile
Change-Id: Iab23ebbc0e3c639d4f0589ab3e8ae458b85b3298
Reviewed-on: https://skia-review.googlesource.com/127396
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
2018-05-11 17:43:57 +00:00
Brian Salomon
103d6f616b Define ~GrContextThreadSafeProxy in GrContext.cpp
Otherwise GrCaps.h may be required in GrContext.h

Change-Id: I67b2116b3bad2e7ebbb2157375c48023d2964f5c
Reviewed-on: https://skia-review.googlesource.com/127394
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
2018-05-11 15:58:17 +00:00
Brian Salomon
c7fe0f708c Make GrCaps and GrShaderCaps private.
Moves getCaps() from GrContext to GrContextPriv and removes unused refCaps().

Change-Id: Ic6a8951b656c0d1b2773eae73bff8e88af819866
Reviewed-on: https://skia-review.googlesource.com/127389
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2018-05-11 14:47:27 +00:00
Florin Malita
5c560c90f7 Fix unchecked allocation in kImageFilter::Common::unflatten()
The bad news is we don't have a good way to validate the count against
the available data size.

The good news is we don't have to: most filters only use two inputs,
which will fit in the stack-reserved storage; for those who don't,
growing the input vector during deserialization should not be
problematic.

The CL drops the prea-allocation, and instead appends inputs iteratively.
Also switches the storage to SkSTArray for append/push_back() support.

Bug: oss-fuzz:8219
Change-Id: Ic6bf6e435e6e18b9e026aeb393612210c9e6e57a
Reviewed-on: https://skia-review.googlesource.com/127306
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
2018-05-10 22:43:56 +00:00
Brian Osman
a0ca909142 Revert "Remove GrBackendObject and all related functions from Skia."
This reverts commit ccd4cfc23e.

Reason for revert: Fuchsia not building again. (Flutter roll may have been reverted?)

Original change's description:
> Remove GrBackendObject and all related functions from Skia.
> 
> Bug: skia:
> Change-Id: I59434b7477c0bc26fd982bd81eb97ab94bbba073
> Reviewed-on: https://skia-review.googlesource.com/125822
> 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: Ie2c518b84b0c9513c0c622082de2831088b1ad8d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/127480
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-05-10 22:04:20 +00:00
Mike Klein
27fe397bc0 Revert "strip down SkICC.cpp"
This reverts commit eab50eb9c6
and this tiny bit of e61b969a07:

    https://skia-review.googlesource.com/c/skia/+/127122/3/tests/ICCTest.cpp

Change-Id: I4306e5118a4e5eb88c05078186a28bd443fd76f7
Reviewed-on: https://skia-review.googlesource.com/127305
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2018-05-10 21:44:56 +00:00
Brian Osman
1d686a962c Add SkColorSpace::toProfile
Now that A2B parsing is at least as strict as skcms_Parse, this can
never fail, so switch to void. Also use the new programmatic profile
helpers, which also ensures the data and profile space fields are set
correctly.

Bug: skia:
Change-Id: Ifc4d89a919ca178c484839bdf88dae8a162c3e4f
Reviewed-on: https://skia-review.googlesource.com/127336
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-05-10 19:14:26 +00:00
Brian Salomon
52aacd602f Add GrContextThreadSafeProxy and remove most friends of GrContextThreadSafeProxy
A step towards removing GrCaps from GrContext.h

Also adds operator== to GrContextThreadSafeProxy.

Change-Id: Ic0bae12299dfb0ac8817d9f1c56a1219d6df97d9
Reviewed-on: https://skia-review.googlesource.com/127329
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-05-10 19:14:16 +00:00
Mike Klein
ce4cf72e34 non-linear blending first steps
Code:
  - Add a non-linear blending bit and makeNonlinearBlending()
    to SkColorSpace
  - remove enough F16=linear checks to make it possible to
    create surfaces and encode pngs with nonlinear F16

Testing:
  - add "esrgb" software config to DM, run it
  - add "srgbnl" software config, run it
  - deemphasize importance of "srgb" config on bots
  - update unit tests to reflect relaxed F16 constraints
  - add a new unit test file with _really_ basic tests,
    and a new unit test that's not working yet

Bug: skia:7942

Change-Id: I8ac042bdf9f3d791765393b68fd9256375184d83
Reviewed-on: https://skia-review.googlesource.com/127325
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2018-05-10 18:26:22 +00:00
Greg Daniel
024615e975 Revert "Add driver bug workarounds to GrCaps"
This reverts commit 328490c6a1.

Reason for revert: Breaking compiles inside chrome

Original change's description:
> Add driver bug workarounds to GrCaps
> 
> This moves GrDriverBugWorkarounds to include so that it can be included
> by GrCaps.  This also makes GrContextOptions a nearly empty class in
> the case of !SK_SUPPORT_GPU so that non-gpu builds don't need to build
> in GrDriverBugWorkarounds.cpp.
> 
> Bug: chromium: 829614
> Change-Id: Iedf73677fd09e9a487cfe618a696fd4b25c8703d
> Reviewed-on: https://skia-review.googlesource.com/126581
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Adrienne Walker <enne@chromium.org>

TBR=bsalomon@google.com,enne@chromium.org

Change-Id: I3b35bf65a7b78d2fe16d7c2bcd0e4b3f9bb7fdff
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium: 829614
Reviewed-on: https://skia-review.googlesource.com/127303
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-05-10 17:30:00 +00:00
Greg Daniel
636d803322 Revert "Driver bug workaround: disable_blend_equation_advanced"
This reverts commit f31fece658.

Reason for revert: need to revert to revert original change breaking chrome compile

Original change's description:
> Driver bug workaround: disable_blend_equation_advanced
> 
> Bug: chromium: 829614
> Change-Id: If8eaec6d22412ec36aad8a143f84080be05f2926
> Reviewed-on: https://skia-review.googlesource.com/126748
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Adrienne Walker <enne@chromium.org>

TBR=bsalomon@google.com,enne@chromium.org

Change-Id: Ic870fbbad615d13569254c355ef6b8281332d60d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium: 829614
Reviewed-on: https://skia-review.googlesource.com/127301
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-05-10 17:25:26 +00:00
Greg Daniel
0b1e628835 Revert "Driver bug workaround: disable_discard_framebuffer"
This reverts commit 8aa0dca395.

Reason for revert: need to revert to revert original change breaking chrome compile

Original change's description:
> Driver bug workaround: disable_discard_framebuffer
> 
> Bug: chromium: 829614
> Change-Id: I285b39b31a370247518e3a0b56ac4ea54f38c0c0
> Reviewed-on: https://skia-review.googlesource.com/126749
> Commit-Queue: Adrienne Walker <enne@chromium.org>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Auto-Submit: Adrienne Walker <enne@chromium.org>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

TBR=bsalomon@google.com,enne@chromium.org

Change-Id: I563808025a8f77807478c0f0d42c3009c3b57ea5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium: 829614
Reviewed-on: https://skia-review.googlesource.com/127302
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-05-10 17:24:56 +00:00
Adrienne Walker
8aa0dca395 Driver bug workaround: disable_discard_framebuffer
Bug: chromium: 829614
Change-Id: I285b39b31a370247518e3a0b56ac4ea54f38c0c0
Reviewed-on: https://skia-review.googlesource.com/126749
Commit-Queue: Adrienne Walker <enne@chromium.org>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Adrienne Walker <enne@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-05-10 17:00:25 +00:00
Adrienne Walker
f31fece658 Driver bug workaround: disable_blend_equation_advanced
Bug: chromium: 829614
Change-Id: If8eaec6d22412ec36aad8a143f84080be05f2926
Reviewed-on: https://skia-review.googlesource.com/126748
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Adrienne Walker <enne@chromium.org>
2018-05-10 16:01:15 +00:00
Mike Reed
cab2549286 use 64bit math in TArray realloc
Bug: oss-fuzz:8217
Change-Id: Idecd1867e7047744477c7dfbb6c9bc5654a36ade
Reviewed-on: https://skia-review.googlesource.com/127324
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-05-10 15:30:16 +00:00
Adrienne Walker
328490c6a1 Add driver bug workarounds to GrCaps
This moves GrDriverBugWorkarounds to include so that it can be included
by GrCaps.  This also makes GrContextOptions a nearly empty class in
the case of !SK_SUPPORT_GPU so that non-gpu builds don't need to build
in GrDriverBugWorkarounds.cpp.

Bug: chromium: 829614
Change-Id: Iedf73677fd09e9a487cfe618a696fd4b25c8703d
Reviewed-on: https://skia-review.googlesource.com/126581
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Adrienne Walker <enne@chromium.org>
2018-05-10 14:54:15 +00:00
Greg Daniel
ccd4cfc23e Remove GrBackendObject and all related functions from Skia.
Bug: skia:
Change-Id: I59434b7477c0bc26fd982bd81eb97ab94bbba073
Reviewed-on: https://skia-review.googlesource.com/125822
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-05-10 14:44:55 +00:00
Ben Wagner
d813f9cdc7 Remove SkPaint::Flags::kDevKernFlag.
It isn't used any more.

Change-Id: I79fbbac13bb2595da0ae0cea7e42bca8fcccd8e8
Reviewed-on: https://skia-review.googlesource.com/127127
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2018-05-09 21:27:11 +00:00
Mike Klein
e61b969a07 SkColorSpace::Make(const skcms_ICCProfile&)
Change-Id: Ib12208d6c148f143fdd0b54538d852b97616a72d
Reviewed-on: https://skia-review.googlesource.com/127122
Commit-Queue: Mike Klein <mtklein@chromium.org>
Auto-Submit: Mike Klein <mtklein@chromium.org>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-05-09 19:36:01 +00:00
Mike Klein
eab50eb9c6 strip down SkICC.cpp
Most of SkICC{.h,.cpp} is unused and gone.

I've renamed the part that's left to SkWriteICCProfile() and tweaked its
API just a little, leaving SkICC:WriteToICC() a wrapper around it.

Most of the tests in ICCTest.cpp are moot and deleted, but a few looked
somewhat valuable so I've kept them with a little modification.

Change-Id: Ia1bb4c772af679885e17dac53d213c315ad0828c
Reviewed-on: https://skia-review.googlesource.com/127022
Auto-Submit: Mike Klein <mtklein@chromium.org>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2018-05-09 19:19:31 +00:00
Hal Canary
46cc3dabaf Revert "Revert "SkAdvancedTypefaceMetrics: factor out GlyphToUnicode""
This reverts commit 97c1108607.

Change-Id: Ic3c6addc64ced39766bbee3e10b4d88faf61ba2f
Reviewed-on: https://skia-review.googlesource.com/127021
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-05-09 18:00:35 +00:00
Brian Osman
06d374694a Add fPreferExternalImagesOverES3 to GrContextOptions
This forces us to use the ES2 shading language when we have an ES3
context, but the driver claims to only support GL_OES_EGL_image_external
(and not the _essl3 variant). Many of these devices will work correctly
if we blindly enable both extensions, but there are some that won't.

Bug: skia:
Change-Id: Id632003a1905ea61b46166befd30905a57cead69
Reviewed-on: https://skia-review.googlesource.com/126681
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-05-09 17:58:15 +00:00
Greg Daniel
97c1108607 Revert "SkAdvancedTypefaceMetrics: factor out GlyphToUnicode"
This reverts commit 1c2bcd8b14.

Reason for revert: breaking chrome roll

Original change's description:
> SkAdvancedTypefaceMetrics: factor out GlyphToUnicode
> 
> Change-Id: Iedce8c1ea2c405d5ab64ccac353970d5cd2b9d63
> Reviewed-on: https://skia-review.googlesource.com/126507
> Commit-Queue: Hal Canary <halcanary@google.com>
> Reviewed-by: Ben Wagner <bungeman@google.com>

TBR=halcanary@google.com,bungeman@google.com,reed@google.com

Change-Id: Ib1ff8484ffd09cdb88d461ac00745aa32c191124
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/127000
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-05-09 15:36:06 +00:00
Hal Canary
1c2bcd8b14 SkAdvancedTypefaceMetrics: factor out GlyphToUnicode
Change-Id: Iedce8c1ea2c405d5ab64ccac353970d5cd2b9d63
Reviewed-on: https://skia-review.googlesource.com/126507
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2018-05-09 14:24:45 +00:00
Leon Scroggins III
8a8a144952 Treat SkFILEStream's fOriginalOffset as the start
Bug: b/78866720

::rewind() rewinds to fOriginalOffset
::seek(position) seeks to position + fOriginalOffset
::move(offset) will not move < fOriginalOffset
::getPosition() returns position relative to fOriginalOffset
::getLength() returns full size minus fOriginalOffset
::duplicate() and ::fork() pass on fOriginalOffset

Android may create an SkFILEStream using a file descriptor whose offset
is at the beginning of the data that Android cares about. Treat all
positions in SkFILEStream as relative to that original offset.

This allows AnimatedImageDrawable to read directly from the
SkFILEStream, rather than using an SkFrontBufferedStream and forcing
SkGifCodec to cache data for later use.

This fixes a TODO that was introduced in
https://skia-review.googlesource.com/c/skia/+/9498 and takes it a step
further. In that CL, bungeman@ and I discussed the change and decided to
"leave this alone for now to avoid changing behavior". Doing a code
search today, the only two callers want the new behavior.

Change-Id: I9211394d5b730adf528fac0df0af7a664b1295be
Reviewed-on: https://skia-review.googlesource.com/126511
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2018-05-08 20:41:04 +00:00
Hal Canary
efb84e6734 sk_sp: check for self-assignment
Change-Id: I02e6ab8945c79c14458b36bd13ce6f6e14979460
Reviewed-on: https://skia-review.googlesource.com/126683
Reviewed-by: Ben Wagner <bungeman@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-05-08 18:47:14 +00:00
Hal Canary
5bdc4d590b SkAdvancedTypefaceMetrics: simplify more
Change-Id: I80c28c50aa96c28181d2fef13daad4a80ec91a12
Reviewed-on: https://skia-review.googlesource.com/120160
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-05-07 20:07:57 +00:00
Cary Clark
d286aa73f1 Revert "Reland "remove obsolete color defines""
This reverts commit 05cfcff70c.

Reason for revert: breaks flutter

Original change's description:
> Reland "remove obsolete color defines"
> 
> This reverts commit 3155d9c912.
> 
> Reason for revert: pdfium bots are no more
> 
> Original change's description:
> > Revert "remove obsolete color defines"
> > 
> > This reverts commit 8afbecbcc0.
> > 
> > Reason for revert: broke pdfium
> > 
> > Original change's description:
> > > remove obsolete color defines
> > > 
> > > The uses in Skia, Chrome, and Google3 have already
> > > been removed. If I missed one or more, please let
> > > me know (and feel free to revert).
> > > 
> > > TBR=reed@google.com,brianosman@google.com
> > > Bug: skia:6898
> > > Change-Id: I9d15b1a06f5abfc3a0fc6f3f1b4d348916c3d362
> > > Reviewed-on: https://skia-review.googlesource.com/124840
> > > Reviewed-by: Cary Clark <caryclark@skia.org>
> > > Commit-Queue: Cary Clark <caryclark@skia.org>
> > > Auto-Submit: Cary Clark <caryclark@skia.org>
> > 
> > TBR=brianosman@google.com,reed@google.com,caryclark@skia.org
> > 
> > Change-Id: Ic7c1003261cda5dee80e222da123c6717b4ea707
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Bug: skia:6898
> > Reviewed-on: https://skia-review.googlesource.com/124880
> > Reviewed-by: Cary Clark <caryclark@skia.org>
> > Commit-Queue: Cary Clark <caryclark@skia.org>
> 
> TBR=brianosman@google.com,reed@google.com,caryclark@skia.org
> 
> # Not skipping CQ checks because original CL landed > 1 day ago.
> 
> Bug: skia:6898
> Change-Id: I3605fa0ebb2bfecc26d198e9de008c82d31d747b
> Reviewed-on: https://skia-review.googlesource.com/126001
> Reviewed-by: Cary Clark <caryclark@google.com>
> Commit-Queue: Cary Clark <caryclark@google.com>

TBR=brianosman@google.com,caryclark@google.com,reed@google.com,caryclark@skia.org

Change-Id: I469794b86487322c385e50275d548c1895c30cff
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:6898
Reviewed-on: https://skia-review.googlesource.com/126040
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
2018-05-04 17:19:33 +00:00
Cary Clark
05cfcff70c Reland "remove obsolete color defines"
This reverts commit 3155d9c912.

Reason for revert: pdfium bots are no more

Original change's description:
> Revert "remove obsolete color defines"
> 
> This reverts commit 8afbecbcc0.
> 
> Reason for revert: broke pdfium
> 
> Original change's description:
> > remove obsolete color defines
> > 
> > The uses in Skia, Chrome, and Google3 have already
> > been removed. If I missed one or more, please let
> > me know (and feel free to revert).
> > 
> > TBR=reed@google.com,brianosman@google.com
> > Bug: skia:6898
> > Change-Id: I9d15b1a06f5abfc3a0fc6f3f1b4d348916c3d362
> > Reviewed-on: https://skia-review.googlesource.com/124840
> > Reviewed-by: Cary Clark <caryclark@skia.org>
> > Commit-Queue: Cary Clark <caryclark@skia.org>
> > Auto-Submit: Cary Clark <caryclark@skia.org>
> 
> TBR=brianosman@google.com,reed@google.com,caryclark@skia.org
> 
> Change-Id: Ic7c1003261cda5dee80e222da123c6717b4ea707
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:6898
> Reviewed-on: https://skia-review.googlesource.com/124880
> Reviewed-by: Cary Clark <caryclark@skia.org>
> Commit-Queue: Cary Clark <caryclark@skia.org>

TBR=brianosman@google.com,reed@google.com,caryclark@skia.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: skia:6898
Change-Id: I3605fa0ebb2bfecc26d198e9de008c82d31d747b
Reviewed-on: https://skia-review.googlesource.com/126001
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
2018-05-04 16:13:32 +00:00
Ben Wagner
da926dbd69 Remove fCacheKeys from SkImageFilter.
No public API changes.

Bug: skia:7666, skia:7887
Change-Id: I8ac4ec37dd3d0fcc050bc977db41439a8e18895f
Reviewed-on: https://skia-review.googlesource.com/125500
Commit-Queue: Ben Wagner <benjaminwagner@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Auto-Submit: Ben Wagner <benjaminwagner@google.com>
2018-05-04 14:33:32 +00:00
Greg Daniel
ba2c826038 Implement canCopySurface for GrMock and GrMtl.
Bug: skia:
Change-Id: I60730bacb03b43e872c68fd7eb8e845ac0910f67
Reviewed-on: https://skia-review.googlesource.com/125730
Commit-Queue: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Auto-Submit: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-05-03 20:13:02 +00:00
Yuqian Li
8ba34f82dd Change SkMatrix44::fTypeMask to atomic
Bug: skia:7886
Change-Id: If616b8bf3b50366356b4324760ad82cbc5fd937d
Reviewed-on: https://skia-review.googlesource.com/124460
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Yuqian Li <liyuqian@google.com>
2018-05-03 15:56:12 +00:00
Greg Daniel
b73a9f8b96 Add internal grsurface flag to track if using gl rectangle or external texture.
Bug: skia:
Change-Id: I84963833bbc3ae957c919a19f6e78fce2c9de7ef
Reviewed-on: https://skia-review.googlesource.com/125294
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-05-02 21:34:58 +00:00
Herb Derby
90864a21c4 Simplify textToGlyphs
Change-Id: I9f2ae8e669ab3c22b66f9b10bd2650b5f5ab0bd4
Reviewed-on: https://skia-review.googlesource.com/125345
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Auto-Submit: Herb Derby <herb@google.com>
2018-05-02 20:50:28 +00:00
Herb Derby
fcac00f2f1 Reland "Remove devKerning"
This is a reland of c86c5c0144

Original change's description:
> Remove devKerning
> 
> Dev kerning is not supported by any scalers. This is
> mostly removed. The remaining fields fRsbDelta and
> fLsbDelta are kept to keep Android compiling.
> 
> Change-Id: If1a9ee9bb599d4e1bdf4b3751ac0c65246350809
> Reviewed-on: https://skia-review.googlesource.com/124921
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Commit-Queue: Herb Derby <herb@google.com>

Change-Id: Ibf5fac5f1442c7e62392d5146ad460da27b10d5c
Reviewed-on: https://skia-review.googlesource.com/125300
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2018-05-02 15:15:08 +00:00
Herb Derby
efe39bcfb8 Take sk_sp<SkDevice> instead of SkDevice*
Change-Id: I0b296bf5b80adc19758a3dc99160be9d2ed05680
Reviewed-on: https://skia-review.googlesource.com/125160
Commit-Queue: Herb Derby <herb@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Auto-Submit: Herb Derby <herb@google.com>
2018-05-02 14:46:17 +00:00
Mike Klein
c76e26a6bb Revert "Remove devKerning"
This reverts commit c86c5c0144.

Reason for revert: 4 of 5

Original change's description:
> Remove devKerning
> 
> Dev kerning is not supported by any scalers. This is
> mostly removed. The remaining fields fRsbDelta and
> fLsbDelta are kept to keep Android compiling.
> 
> Change-Id: If1a9ee9bb599d4e1bdf4b3751ac0c65246350809
> Reviewed-on: https://skia-review.googlesource.com/124921
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Commit-Queue: Herb Derby <herb@google.com>

TBR=bungeman@google.com,herb@google.com,reed@google.com

Change-Id: If865f702868192a1b72cd811baa996dd1282bbce
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/125263
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-05-02 13:54:54 +00:00
Herb Derby
c86c5c0144 Remove devKerning
Dev kerning is not supported by any scalers. This is
mostly removed. The remaining fields fRsbDelta and
fLsbDelta are kept to keep Android compiling.

Change-Id: If1a9ee9bb599d4e1bdf4b3751ac0c65246350809
Reviewed-on: https://skia-review.googlesource.com/124921
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2018-05-01 21:12:15 +00:00
Cary Clark
3155d9c912 Revert "remove obsolete color defines"
This reverts commit 8afbecbcc0.

Reason for revert: broke pdfium

Original change's description:
> remove obsolete color defines
> 
> The uses in Skia, Chrome, and Google3 have already
> been removed. If I missed one or more, please let
> me know (and feel free to revert).
> 
> TBR=reed@google.com,brianosman@google.com
> Bug: skia:6898
> Change-Id: I9d15b1a06f5abfc3a0fc6f3f1b4d348916c3d362
> Reviewed-on: https://skia-review.googlesource.com/124840
> Reviewed-by: Cary Clark <caryclark@skia.org>
> Commit-Queue: Cary Clark <caryclark@skia.org>
> Auto-Submit: Cary Clark <caryclark@skia.org>

TBR=brianosman@google.com,reed@google.com,caryclark@skia.org

Change-Id: Ic7c1003261cda5dee80e222da123c6717b4ea707
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:6898
Reviewed-on: https://skia-review.googlesource.com/124880
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
2018-05-01 15:00:55 +00:00
Florin Malita
41dff6ef68 [skottie] Add support for round-corners geometry effects
TBR=
Change-Id: I5505561df28d5953526662d60fe2300cb112bc37
Reviewed-on: https://skia-review.googlesource.com/124769
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-05-01 14:54:14 +00:00
Cary Clark
8afbecbcc0 remove obsolete color defines
The uses in Skia, Chrome, and Google3 have already
been removed. If I missed one or more, please let
me know (and feel free to revert).

TBR=reed@google.com,brianosman@google.com
Bug: skia:6898
Change-Id: I9d15b1a06f5abfc3a0fc6f3f1b4d348916c3d362
Reviewed-on: https://skia-review.googlesource.com/124840
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
Auto-Submit: Cary Clark <caryclark@skia.org>
2018-05-01 14:29:44 +00:00
Brian Salomon
fb68b3bce2 Remove GrPrimitiveType::kTriangleFan
Change-Id: Ia121198ebcdc34e32a3ff99b0821047256df282d
Reviewed-on: https://skia-review.googlesource.com/124503
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-04-30 18:36:43 +00:00
Brian Salomon
cccafe8cfd Rewrite SkVertices specified with triangle fans as indexed triangles
Change-Id: Ifaacc426bc657b324f6a885a8ef70b347b048226
Reviewed-on: https://skia-review.googlesource.com/124349
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
2018-04-28 20:32:15 +00:00
Greg Daniel
a070ed7fcc Add InternalSurfaceFlag so we know if RenderTargetProxys and RenderTargets use GL FBO 0.
Bug: skia:7748
Change-Id: I2fda3cde12ccdef19fe06ff287a8024b58d28ef0
Reviewed-on: https://skia-review.googlesource.com/124048
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-04-26 21:44:43 +00:00
Cary Clark
d98f78cd01 alternative no anonymous enums
Anonymous enums play havoc with documentation;
there's no name to refer to. It may be that all
enums may either be named or replaced with constexpr
without breaking anything. Try replacing all
anonymous enums in include/core to see what happens.

This names SkCanvas::SaveLayerFlagsSet but leaves
SkCanvas::SaveLayerFlags as a uint32_t, to reduce
risk as compared to review.skia.org/123584.

There's also some chance that external linkage will
break if some client refers to anonymous enum in a way
that could require its address: see
https://stackoverflow.com/questions/22867654/enum-vs-constexpr-for-actual-static-constants-inside-classes
(This CL does not require definitions + declarations)

Brought bookmaker docs in line with this change.
This also tripped over missing code in bookmaker
handling constexpr so added that as well.

R=reed@google.com,bsalomon@google.com

Docs-Preview: https://skia.org/?cl=123920
Docs-Preview: https://skia.org/?cl=123584
Bug: skia:6898
Change-Id: I14a342edcfd59e139ef9e4501f562417c4c60391
Reviewed-on: https://skia-review.googlesource.com/123920
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Cary Clark <caryclark@skia.org>
2018-04-26 17:11:53 +00:00
Chris Dalton
218c29453f Remove the MSAA path renderer
Bug: skia:
Change-Id: Ib18bede613c8d27fd6326f655dc2d638e35870ff
Reviewed-on: https://skia-review.googlesource.com/123726
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2018-04-25 19:59:59 +00:00
Greg Daniel
25af671a3d Add GrCap check for whether we can do a copy or not, and implement in Vk backend
Today, we only know if we fail a copy during the flush so we have no
way to cleanly handle a failed copy. This will allow us to know if we'll
fail a copy during recording and allow us to do some appropriate fallback
and/or dropping of the draw.

Bug: skia:
Change-Id: I38f209dbd4ebb4e762210b4609147d4b0a1b01b1
Reviewed-on: https://skia-review.googlesource.com/123560
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-04-25 19:38:57 +00:00
Mike Reed
910ca0fd01 Experiment to track coverage in a layer
Bug: skia:
Change-Id: I5ed334f63e64991944394dc8103092a2c6280546
Reviewed-on: https://skia-review.googlesource.com/122000
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-04-25 17:34:27 +00:00
Hal Canary
47728258b0 include/private/SkTemplates: SkInPlaceNewCheck uses ...
Change-Id: Ia9af6daec20bdd4bfa7f34c8bff7b400f5775dd9
Reviewed-on: https://skia-review.googlesource.com/123503
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-04-24 19:29:16 +00:00
Hal Canary
6736236faf include/private/SkTemplates: Cleanup bare pointers.
include/private:
-  SkAutoTArray, SkAutoTMalloc no longer use bare pointers to owned memory,
-   SkTHash and SkAutoTArray are now std::move()able.
-   SkAutoTArray::swap no longer neccesary.
-   SkAutoTMalloc::operator=() defined.

src/pdf:
-   SkPDFCanon and SkPDFObjectSerializer are now std::move()able.
-   `template <class T> static void renew(T* t) { t->~T(); new (t) T; }` is gone.

Change-Id: I2f36a0780c47d1427a85da240121c898387fb4cf
Reviewed-on: https://skia-review.googlesource.com/123401
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-04-24 19:13:56 +00:00
Greg Daniel
849dce1d7b Update flag checks when validating surface being assigned to proxy.
Bug: skia:7748
Change-Id: Id87c0b1be2efbdefd96740e9591fd102e09b4d95
Reviewed-on: https://skia-review.googlesource.com/123423
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-04-24 18:59:16 +00:00
Leon Scroggins III
57e1f02011 (Mostly) respect FilterQuality in draw[stretchy]
Bug: b/77917978

For
  drawImageLattice
  drawBitmapLattice
  drawImageNine
  drawBitmapNine
, respect the SkFilterQuality on the SkPaint. Previously the GPU used
the lowest quality to avoid a bleeding effect, leading to ugly nine-
patches on Android.

For all backends, cap the filter quality at kLow_SkFilterQuality.
Update SkCanvas' documentation to specify this.

Change-Id: Id28c7753834975f039170f14bc51be4f2bd44d41
Reviewed-on: https://skia-review.googlesource.com/121891
Reviewed-by: Cary Clark <caryclark@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
Auto-Submit: Leon Scroggins <scroggo@google.com>
2018-04-23 14:27:30 +00:00
Yong-Hwan Baek
701a3ca157 Fixed SkVertices crashing on Windows DLL builds
SkVertices::Builder uses custom new operator but not exposed to dll.
While delete operator in SkVertices.h could be inlined, it causes crash on Windows DLL builds. This patch fixes this issue.
Change-Id: I8b635ad3aa4a3f496a392ce7840417947999e4b0
Reviewed-on: https://skia-review.googlesource.com/122480
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2018-04-22 14:42:01 +00:00
Brian Osman
2fda63abcd Fix argument names and documentation for SkMatrix44::set3x3()
Column-major is an implementation choice, not an interface. There is
exactly one acceptable subscript notation for indexing matrix elements,
and it's row first, then column. Having these named backwards was
unnecessarily confusing.

Note that this doesn't alter behavior in any way, it just brings this
function in line with expectations from any reasonable mathematician.

Change-Id: Ie4ceb40281ef507889d25403afbf24116514c45a
Reviewed-on: https://skia-review.googlesource.com/122790
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-04-20 18:08:18 +00:00
Robert Phillips
2748391716 Add ability to dump opList info at flush-time
When debugging DDL it is useful to just see which ops are being drawn instead of the entire reordering history.

Change-Id: I89708fecbd53c097b00e65b0da426bfb8046b0ee
Reviewed-on: https://skia-review.googlesource.com/122780
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-04-20 17:47:55 +00:00
Robert Phillips
ab4f5bde7f rm SkRRectsGaussianEdgeMaskFilter
Neat but unused.

Change-Id: I1b2d160df274b05cfb5582a5385085cc2db89f7d
Reviewed-on: https://skia-review.googlesource.com/121960
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-04-19 17:21:44 +00:00
Mike Klein
12ee97c991 crash rather than overflow in SkTDArray
This adds explicit overflow checks to the two likeliest
places where non-buggy code could overflow SkTDArray.

We have an #ifdef'd out PathMeasure_explosion GM that
overflows before this CL and aborts with it.

Bug: skia:7674

Change-Id: Ia0c430f4a8bb9bad687d13c875f604fd7da45aab
Reviewed-on: https://skia-review.googlesource.com/122342
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2018-04-19 16:45:45 +00:00
Mike Klein
23e4544e94 disallow negative setReserve() calls
We already assert that setCount()'s argument is non-negative.
This does the same for setReserve().

There was one call site I could find that was actually sometimes
passing negative values to setReserve(), guarded here.

Already reviewed: https://skia-review.googlesource.com/c/skia/+/115982

Change-Id: Ia52a286732bf4056e9baf09555d27bab9abf2554
Reviewed-on: https://skia-review.googlesource.com/122305
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2018-04-19 14:08:14 +00:00
Mike Klein
bd000a11c7 rm SkTDArray::select()
It's only used in one call site, which is clearer without it.

Already reviewed: https://skia-review.googlesource.com/c/skia/+/115982

Change-Id: I3d0f8c1f0756e01e29cdb9f9328b0f557d3650d3
Reviewed-on: https://skia-review.googlesource.com/122302
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2018-04-19 14:01:34 +00:00
Chris Dalton
91ab155884 Always call endFlush on opLists that might survive a flush
We were missing a few that got unreffed due to failed proxy
instantiation.

Bug: skia:7655
Bug: skia:7111
Change-Id: I95847a16890f2993a1433d4d9fdaa8a4a6c2f0b6
Reviewed-on: https://skia-review.googlesource.com/122121
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2018-04-18 20:00:53 +00:00
Brian Osman
061020eab4 With ES3, enable both ES2 and ES3 external image extensions
Bug: skia:7713
Change-Id: If06c0368e91c33bbac9e7715227d619c4834684f
Reviewed-on: https://skia-review.googlesource.com/121884
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-04-18 19:13:13 +00:00
Ben Wagner
a580fb3f9e Add paint flags to viewer GUI.
Overriding bits of the paint was added with keyboard bindings but
without being reflected in the GUI. This adds these flags to the GUI.

Change-Id: I633801fb776248952afe7cbe8857676ef8b57135
Reviewed-on: https://skia-review.googlesource.com/121796
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2018-04-17 16:10:14 +00:00
Brian Osman
77d085ef9f Add SkColorSpace::Make, taking an skcms_ICCProfile
Bug: skia:7419
Change-Id: I912d4ae842d9cab09395fac3136e2e900611c8e5
Reviewed-on: https://skia-review.googlesource.com/121358
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2018-04-17 15:18:14 +00:00
Hal Canary
84c0792ea5 SkColorSetARGB in constants
Change-Id: I5a6edb031c5d561d9def6d8e57a393b4f9c2e6fc
Reviewed-on: https://skia-review.googlesource.com/121588
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-04-17 12:25:13 +00:00
Ben Wagner
d234afdc2e Remove SkPaint::kGenA8FromLCD_Flag.
The original intent of this flag is now handled by SkPixelGeomety on
SkSurfaceProps on SkSurface.

BUG=skia:7515

Change-Id: I54bb1be072b5b5b2164a59196bfeacac254823c7
Reviewed-on: https://skia-review.googlesource.com/121346
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2018-04-16 21:11:10 +00:00
Greg Daniel
e320486489 Don't allow ganesh to allocate mip maps for wrapped textures.
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>
2018-04-16 17:05:20 +00:00
Greg Daniel
7444c3c518 Revert "Delete getRenderTargetHandle call on SkSurface."
This reverts commit c828109ebd.

Reason for revert: Need to fix flutter

Original change's description:
> Delete getRenderTargetHandle call on SkSurface.
> 
> All clients and internal code should be switched (once changes land soon)
> to the new getBackendRenderTarget call instead.
> 
> Bug: skia:
> Change-Id: I6f490b6d26a72f37f97216be04e541483206510d
> Reviewed-on: https://skia-review.googlesource.com/121103
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

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

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: skia:
Change-Id: I571298f839757fcdedcd8117519e740ac7ef1344
Reviewed-on: https://skia-review.googlesource.com/121480
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-04-14 18:08:12 +00:00
Mike Reed
408ee9fecd remove unused virtual onNotifyPixelsChanged
Bug: skia:
Change-Id: I993701a1059d7d309991b06147bd0cc4a1a4fe93
Reviewed-on: https://skia-review.googlesource.com/121350
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-04-13 21:23:07 +00:00
Brian Osman
584b501816 Support downscaling to max texture size when making cross-context images
This is one solution to https://github.com/flutter/flutter/issues/16454

Change-Id: Iacd59f07e1bf87b6caccb64df16ab8827dfc78b1
Reviewed-on: https://skia-review.googlesource.com/121342
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-04-13 20:41:12 +00:00
Heather Miller
d1999cacd8 Update Skia milestone to 68
TBR=reed

Bug: skia:
Change-Id: I17ff9424c674efbc782bf1b40477467c678cddd9
Reviewed-on: https://skia-review.googlesource.com/121321
Reviewed-by: Heather Miller <hcm@google.com>
Commit-Queue: Heather Miller <hcm@google.com>
2018-04-13 14:01:02 +00:00
Greg Daniel
c828109ebd Delete getRenderTargetHandle call on SkSurface.
All clients and internal code should be switched (once changes land soon)
to the new getBackendRenderTarget call instead.

Bug: skia:
Change-Id: I6f490b6d26a72f37f97216be04e541483206510d
Reviewed-on: https://skia-review.googlesource.com/121103
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-04-12 19:41:10 +00:00
Yuqian Li
9438790b66 Reland "Add private fIsBadForDAA bit to SkPath"
This reverts commit ed5e069dbb.

Reason for revert: add the guard flag

Original change's description:
> Revert "Add private fIsBadForDAA bit to SkPath"
> 
> This reverts commit 54aefc7410.
> 
> Reason for revert: Forget the guard flag. Pixel tests would fail.
> 
> Original change's description:
> > Add private fIsBadForDAA bit to SkPath
> > 
> > Bug: chromium:821353
> > Change-Id: Ic6585e76df692bb1853d0990d75f0e8d1dee22f4
> > Reviewed-on: https://skia-review.googlesource.com/120201
> > Commit-Queue: Yuqian Li <liyuqian@google.com>
> > Reviewed-by: Mike Reed <reed@google.com>
> 
> TBR=caryclark@google.com,liyuqian@google.com,reed@google.com
> 
> Change-Id: I2fe7cfcc3a80a51415f72d656da95a894a3240a4
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: chromium:821353
> Reviewed-on: https://skia-review.googlesource.com/120505
> Reviewed-by: Yuqian Li <liyuqian@google.com>
> Commit-Queue: Yuqian Li <liyuqian@google.com>

TBR=caryclark@google.com,liyuqian@google.com,reed@google.com

Change-Id: Iebf7caf9ca74f305dec25b1b6512e93cb41cc8ec
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:821353
Reviewed-on: https://skia-review.googlesource.com/120620
Commit-Queue: Yuqian Li <liyuqian@google.com>
Reviewed-by: Yuqian Li <liyuqian@google.com>
2018-04-12 16:24:40 +00:00
Robert Phillips
ba375a8884 Add SK_SUPPORT_LEGACY_BACKEND_OBJECTS
This relies on the Chrome CL: https://chromium-review.googlesource.com/c/chromium/src/+/999796 (Add SK_SUPPORT_LEGACY_BACKEND_OBJECTS to SkUserConfig.h) landing first.

Change-Id: Ie0a2b7b84cc02e46957765a0a7d6444a5320769d
Reviewed-on: https://skia-review.googlesource.com/119140
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-04-12 14:56:10 +00:00
Florin Malita
c6c5eade82 Reland "Fix handling of MaskFilter matrices"
This reverts commit c64ee20e13.

Reason for revert: initial failures should be fixed in https://skia.googlesource.com/skia.git/+/8eaf64ae12696d4189d3cea9f023658494cf82b8

Original change's description:
> Revert "Fix handling of MaskFilter matrices"
> 
> This reverts commit 2097fd03ff.
> 
> Reason for revert: This is breaking a lot of Windows bots (esp. on the shadermaskfilter_localmatrix)
> 
> Original change's description:
> > Fix handling of MaskFilter matrices
> > 
> > 1) extend GrFPArgs to track pre/post local matrices, add helpers for
> >    creating pre/post wrapper args
> > 
> > 2) add a SkShaderBase helper (totalLocalMatrix) to centralize the LM
> >    sandwich logic.
> > 
> > 3) update call sites to use the above
> > 
> > 4) rename SkMatrixFilter::makeWithLocalMatrix -> makeWithMatrix, to
> >    disambiguate vs. SkShader::makeWithLocalMatrix.
> > 
> > BUG=skia:7744
> > 
> > Change-Id: Ib2b7b007e6924979b00649dde7c94ef4b34771f1
> > Reviewed-on: https://skia-review.googlesource.com/119330
> > Commit-Queue: Florin Malita <fmalita@chromium.org>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> 
> TBR=bsalomon@google.com,robertphillips@google.com,fmalita@chromium.org,reed@google.com
> 
> Change-Id: I918dbb95bf00b3122e6699b84566ec82dbb5fc5c
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:7744
> Reviewed-on: https://skia-review.googlesource.com/120340
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

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

Change-Id: If194862a928d1abe22ed8fa968436c725d19a8fc
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7744
Reviewed-on: https://skia-review.googlesource.com/120480
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2018-04-11 20:13:22 +00:00
Mike Reed
1f275851ec remove unused/dumb methods from SkRect
Bug: skia:
Change-Id: I407dc94256a347c7a9343b75a5af43c4294891d3
Reviewed-on: https://skia-review.googlesource.com/119360
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Yuqian Li <liyuqian@google.com>
2018-04-11 19:40:57 +00:00
Yuqian Li
ed5e069dbb Revert "Add private fIsBadForDAA bit to SkPath"
This reverts commit 54aefc7410.

Reason for revert: Forget the guard flag. Pixel tests would fail.

Original change's description:
> Add private fIsBadForDAA bit to SkPath
> 
> Bug: chromium:821353
> Change-Id: Ic6585e76df692bb1853d0990d75f0e8d1dee22f4
> Reviewed-on: https://skia-review.googlesource.com/120201
> Commit-Queue: Yuqian Li <liyuqian@google.com>
> Reviewed-by: Mike Reed <reed@google.com>

TBR=caryclark@google.com,liyuqian@google.com,reed@google.com

Change-Id: I2fe7cfcc3a80a51415f72d656da95a894a3240a4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:821353
Reviewed-on: https://skia-review.googlesource.com/120505
Reviewed-by: Yuqian Li <liyuqian@google.com>
Commit-Queue: Yuqian Li <liyuqian@google.com>
2018-04-11 18:37:29 +00:00
Yuqian Li
54aefc7410 Add private fIsBadForDAA bit to SkPath
Bug: chromium:821353
Change-Id: Ic6585e76df692bb1853d0990d75f0e8d1dee22f4
Reviewed-on: https://skia-review.googlesource.com/120201
Commit-Queue: Yuqian Li <liyuqian@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2018-04-11 18:32:27 +00:00
Florin Malita
8eaf64ae12 Fix SkTCopyOnFirstWrite copy semantics
The implicit SkTCopyOnFirstWrite copy-ctor and assignment operator are
incorrect: fObj must point to the local copy, not to the source copy
(when a copy has been made).

Add corrected explicit copy (and move) ctor + assignment operator.

Also add a get() helper to facilitate rawptr access.

Change-Id: Ie3983e12c04eae4f32c40e3e267618cf02008c20
Reviewed-on: https://skia-review.googlesource.com/120442
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-04-11 17:25:07 +00:00
Greg Daniel
044b67d6c7 Remove guard around getBackendTexture/RenderTarget calls
Bug: skia:
Change-Id: Ia9ad987d4af183985724f32b022553af0fcb2b78
Reviewed-on: https://skia-review.googlesource.com/120124
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-04-11 13:38:26 +00:00
Robert Phillips
c64ee20e13 Revert "Fix handling of MaskFilter matrices"
This reverts commit 2097fd03ff.

Reason for revert: This is breaking a lot of Windows bots (esp. on the shadermaskfilter_localmatrix)

Original change's description:
> Fix handling of MaskFilter matrices
> 
> 1) extend GrFPArgs to track pre/post local matrices, add helpers for
>    creating pre/post wrapper args
> 
> 2) add a SkShaderBase helper (totalLocalMatrix) to centralize the LM
>    sandwich logic.
> 
> 3) update call sites to use the above
> 
> 4) rename SkMatrixFilter::makeWithLocalMatrix -> makeWithMatrix, to
>    disambiguate vs. SkShader::makeWithLocalMatrix.
> 
> BUG=skia:7744
> 
> Change-Id: Ib2b7b007e6924979b00649dde7c94ef4b34771f1
> Reviewed-on: https://skia-review.googlesource.com/119330
> Commit-Queue: Florin Malita <fmalita@chromium.org>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

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

Change-Id: I918dbb95bf00b3122e6699b84566ec82dbb5fc5c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7744
Reviewed-on: https://skia-review.googlesource.com/120340
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-04-11 12:38:47 +00:00
Florin Malita
2097fd03ff Fix handling of MaskFilter matrices
1) extend GrFPArgs to track pre/post local matrices, add helpers for
   creating pre/post wrapper args

2) add a SkShaderBase helper (totalLocalMatrix) to centralize the LM
   sandwich logic.

3) update call sites to use the above

4) rename SkMatrixFilter::makeWithLocalMatrix -> makeWithMatrix, to
   disambiguate vs. SkShader::makeWithLocalMatrix.

BUG=skia:7744

Change-Id: Ib2b7b007e6924979b00649dde7c94ef4b34771f1
Reviewed-on: https://skia-review.googlesource.com/119330
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-04-11 11:25:06 +00:00
Greg Daniel
323fbcf6d1 Move GrBackendRenderTarget over to new system of getting backed infos
Bug: skia:
Change-Id: I3927390894715e8424b3d0240dad3ee6cd03dc38
Reviewed-on: https://skia-review.googlesource.com/120181
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-04-11 11:14:58 +00:00
Greg Daniel
ff7fa50f0c Add ctor to GrVkImageInfo.
Adds an additional ctor so clients who used brace initialization on the
struct don't break.

Bug: skia:
Change-Id: I78ebdbe8242147e48859f2234265365141fe81b1
Reviewed-on: https://skia-review.googlesource.com/120185
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-04-10 17:41:32 +00:00
Greg Daniel
52e16d9848 Update getBackendInfo calls on GrBackendTexture to support VkImageLayout better.
The big api level change here is that the getBackendInfo calls now return by value
instead of a pointer. These changes are being made in support of Vulkan so that
the client can update the VkImageLayout on the GrBackendTexture and have that
update get reflected in our internal tracking of the image. This is done by storing
a ref counted GrVkImageLayout object on the GrBackendTexture and the GrVkImage.

Bug: skia:
Change-Id: I8c6158fd3a66eb61fef97ebf09ea5364bca3f1ae
Reviewed-on: https://skia-review.googlesource.com/119101
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-04-10 14:20:22 +00:00
Cary Clark
5c71518847 fix path to rect when missing close verb
R=brianosman@google.com,robertphillips@google.com
TBR=reed@google.com
Bug: 824145,skia:7792
Change-Id: I24f121cfa7d437c95b94bd917d3c4888a10c519e
Reviewed-on: https://skia-review.googlesource.com/119569
Commit-Queue: Cary Clark <caryclark@skia.org>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-04-10 11:53:53 +00:00
Brian Salomon
a7b8e74eb6 Reland "Remove deprectated GrContext::MakeGL overloads that take raw ptr"
This reverts commit 87f852d1a3.

Reason for revert: Google3 updated

Original change's description:
> Revert "Remove deprectated GrContext::MakeGL overloads that take raw ptr"
> 
> This reverts commit efa60a1d13.
> 
> Reason for revert: Surprise! Google3 still uses these.
> 
> Original change's description:
> > Remove deprectated GrContext::MakeGL overloads that take raw ptr
> > 
> > Change-Id: Iae12bf61fa1e2f5d4b13b98198cddb7482656fdf
> > Reviewed-on: https://skia-review.googlesource.com/118660
> > Reviewed-by: Greg Daniel <egdaniel@google.com>
> > Commit-Queue: Brian Salomon <bsalomon@google.com>
> 
> TBR=egdaniel@google.com,bsalomon@google.com
> 
> Change-Id: Ica09d80e1563924a286a4a6aa8a1f93cb5ca9c5d
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/119001
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

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

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I87c12253f759a97cb4da3ff35dc1ec846513caef
Reviewed-on: https://skia-review.googlesource.com/119921
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-04-09 17:14:46 +00:00
Brian Osman
0cfd547b46 Remove SK_SUPPORT_LEGACY_BLURMASKFILTER
Change-Id: I1d99d9bb83d8a612d1c1fd298c1f7ed706a2277b
Reviewed-on: https://skia-review.googlesource.com/118990
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-04-06 15:02:03 +00:00
Brian Salomon
c1b9c1005f Add versions of MakeGL() that don't require include GrGLInterface.h in order to use the GrGLMakeNativeInterface
Change-Id: I77bd3c683c284aecc50a3552bbf1fb901f1bcc44
Reviewed-on: https://skia-review.googlesource.com/119002
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-04-06 14:44:53 +00:00
Greg Daniel
9ca3065ca5 Don't use GrPixelConfig value as proxy for valid on GrBackendSurface.
Bug: skia:
Change-Id: I275b74b915240c9918bb2efa6a9708341f3bb189
Reviewed-on: https://skia-review.googlesource.com/119004
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-04-06 14:42:23 +00:00
Cary Clark
99885411ae remove SK_IGNORE_TO_STRING
SK_IGNORE_TO_STRING is not defined anywhere.
The same effect can be had by using a modern
linker.

Removing it simplifies bookmaker and makes
our includes easier to understand.

R=robertphillips@google.com
TBR=reed@google.com

Bug: skia:6898
Change-Id: Ib716f5ef1b42a7fbda0df43ece212d1b7c40289f
Reviewed-on: https://skia-review.googlesource.com/118963
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
2018-04-05 23:52:23 +00:00
Robert Phillips
87f852d1a3 Revert "Remove deprectated GrContext::MakeGL overloads that take raw ptr"
This reverts commit efa60a1d13.

Reason for revert: Surprise! Google3 still uses these.

Original change's description:
> Remove deprectated GrContext::MakeGL overloads that take raw ptr
> 
> Change-Id: Iae12bf61fa1e2f5d4b13b98198cddb7482656fdf
> Reviewed-on: https://skia-review.googlesource.com/118660
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

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

Change-Id: Ica09d80e1563924a286a4a6aa8a1f93cb5ca9c5d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/119001
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-04-05 19:37:49 +00:00
Brian Salomon
efa60a1d13 Remove deprectated GrContext::MakeGL overloads that take raw ptr
Change-Id: Iae12bf61fa1e2f5d4b13b98198cddb7482656fdf
Reviewed-on: https://skia-review.googlesource.com/118660
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-04-05 17:23:22 +00:00
Brian Salomon
f932a6328a Add maxTextureSize()/maxRenderTargetSize() to GrContext
This provides an alternative way to access these values which will allow removal GrContext::caps() from public API

Change-Id: I53d3c00563da8847e1fc14aea9750dc9fd90d1e5
Reviewed-on: https://skia-review.googlesource.com/118962
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-04-05 17:21:32 +00:00
Robert Phillips
8caf85f9f4 Add GrBackendTexture/RenderTarget accessors to SkSurface
Change-Id: I63477fd4b8d48dc50af72736f0f8df566cd96d4a
Reviewed-on: https://skia-review.googlesource.com/85220
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Cary Clark <caryclark@skia.org>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-04-05 14:21:07 +00:00
Robert Phillips
91749c8252 Add SK_API to SkSurfaceCharacterization
TBR=bsalomon@google.com
Change-Id: I111a6e3eef798d6ad904c17eb536bb64c3801bb2
Reviewed-on: https://skia-review.googlesource.com/118594
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-04-05 14:20:12 +00:00
Cary Clark
ba75aee952 tweak SkImage documentation
- fix syntactic nits
- add how to check result of getBackendTexture
- add example

R=robertphillips@google.com
TBR=reed@google.com
Docs-Preview: https://skia.org/?cl=118590
Bug: skia:6898
Change-Id: I60cfcf448dc2f201ecc34d33ead707d0c3e3b86b
Reviewed-on: https://skia-review.googlesource.com/118590
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Cary Clark <caryclark@skia.org>
2018-04-05 12:47:52 +00:00
Robert Phillips
c5509955b9 Add GrBackendTexture accessor to SkImage (take 2)
This makes accessing the GPU resource behind an SkImage a lot more typesafe. Additionally, the GrBackendObject is being deprecated so this is the path forward.

I split the controversial stuff off into https://skia-review.googlesource.com/c/skia/+/118575 (Add SkImage::setLayout call).

Change-Id: I297e72770e8fb360fac7c7cd74f050ae759ae133
Reviewed-on: https://skia-review.googlesource.com/118571
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-04-04 20:34:28 +00:00
Mike Reed
1fda0247a7 move SkIPoint16 to private header
Bug: skia:
Change-Id: Ib8045ac7cc24a44c4b70e73153c6faf098730b63
Reviewed-on: https://skia-review.googlesource.com/118721
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Cary Clark <caryclark@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-04-04 20:16:58 +00:00
Robert Phillips
c1267c6051 Add SkSurfaceCharacterization operator== && !=
TBR=bsalomon@google.com
Change-Id: Ic58849dcb3be1f00431f897af328f6f3c3f00d75
Reviewed-on: https://skia-review.googlesource.com/118340
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-04-04 15:41:48 +00:00
Robert Phillips
be77a02a67 Hide GrPixelConfig in SkSurfaceCharacterization
TBR=bsalomon@google.com
Change-Id: Ifc38d0ca2b18128d27c187f789461fea62d1edae
Reviewed-on: https://skia-review.googlesource.com/117440
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2018-04-04 13:32:01 +00:00
Khushal
42f8bc40fd Add API for SkTextBlob serialization into caller's memory.
R=reed@google.com

Change-Id: Iaeb67504aabf0dc036e81fa23c1a3c949b72b2b9
Reviewed-on: https://skia-review.googlesource.com/114262
Commit-Queue: Khusal Sagar <khushalsagar@chromium.org>
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2018-04-04 01:25:11 +00:00
Cary Clark
3a494f6eb4 fix SkImageInfo indentation
The presence of global functions threw off the
indentation of themselves and everything following.

TBR=reed@google.com
Bug: skia:6898
Change-Id: I3c6c21b62922f42157085fa7aaa19deb9560f16d
Reviewed-on: https://skia-review.googlesource.com/118380
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
2018-04-03 19:59:21 +00:00
Cary Clark
ecf548bf8a update autogenerated includes
SkImageInfo.h is generated for the first time.
Minor corrections in the other includes.

TBR=reed@google.com
Bug: skia:6898
Change-Id: I9a16753e234ace3bfbcc5b58381347fd0e63b1c8
Reviewed-on: https://skia-review.googlesource.com/118168
Commit-Queue: Cary Clark <caryclark@skia.org>
Reviewed-by: Cary Clark <caryclark@skia.org>
2018-04-03 16:33:10 +00:00
Mike Klein
22c1f373b7 Revert "implement SkTDArray with std::vector"
This reverts commit 80e1d56e19.

Reason for revert: SkRTree.cpp:57 asserting, probably this?

Original change's description:
> implement SkTDArray with std::vector
> 
> It's always worth seeing if we can get away with replacing custom data
> structures with ones from the standard library.  Our array-like types
> are all good candidates to replace with std::vector, and it's especially
> easy to start with SkTDArray.  Unlike the others, it has no preallocated
> S-variant, which is tricky to make work with std::vector.
> 
> SkTDArray also has known integer overflow bugs, leading to out of range
> writes.  It'd be _very_ nice to ditch it for a better standard vector.
> 
> I removed a bunch of unused or little-used methods, and updated a couple
> call sites that used methods in unusual or dangerous ways.
> 
> I've had to tweak GrAAConvexTessellator and SkBaseShadowTessellator just
> a touch to work within the constraints of an std::vector impl.  It's not
> intended to be legal to write to the reserved-but-not-counted elements
> of an SkTDArray, but you can get away with it in our old implementation.
> This version now uses setCount() to actually reserve and count them, and
> should have the same performance and use the same amount of memory.
> 
> The PathMeasure_explosion GM I added recently to reproduce this bug now
> draws without triggering undefined behavior or ASAN errors, provided you
> have ~40GB of RAM.
> 
> Bug: skia:7674
> 
> Change-Id: I4eacae18a976cd4a6d218102f8ca5d973d4d7d0e
> Reviewed-on: https://skia-review.googlesource.com/115982
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Mike Klein <mtklein@chromium.org>

TBR=mtklein@chromium.org,bungeman@google.com,brianosman@google.com

Change-Id: Icffd9f22fe89746a970ff598e1a05c774960bc0e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7674
Reviewed-on: https://skia-review.googlesource.com/117901
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2018-04-02 20:37:52 +00:00
Mike Klein
224edf0a3c Revert "In older STLs, std::vector::insert() returns void."
This reverts commit 7dd8ee9c60.

Reason for revert: going to revert primary CL

Original change's description:
> In older STLs, std::vector::insert() returns void.
> 
> CQ_INCLUDE_TRYBOTS=skia.primary:Build-Debian9-Clang-arm-Debug-Chromebook_GLES
> 
> Change-Id: I7bd15ecc7122965db16fbb51e51ee166b05dce2f
> Reviewed-on: https://skia-review.googlesource.com/117722
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Mike Klein <mtklein@chromium.org>

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

Change-Id: I9c126edbef74293d8e7a2b7e2365e464ba367ae5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Cq-Include-Trybots: skia.primary:Build-Debian9-Clang-arm-Debug-Chromebook_GLES
Reviewed-on: https://skia-review.googlesource.com/117900
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2018-04-02 20:37:13 +00:00
Mike Klein
7dd8ee9c60 In older STLs, std::vector::insert() returns void.
CQ_INCLUDE_TRYBOTS=skia.primary:Build-Debian9-Clang-arm-Debug-Chromebook_GLES

Change-Id: I7bd15ecc7122965db16fbb51e51ee166b05dce2f
Reviewed-on: https://skia-review.googlesource.com/117722
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2018-04-02 17:32:42 +00:00
Chris Dalton
7c7ff031a5 ccpr: Normalize homogeneous coords with frexp/ldexp
Hopefully increases cubic accuracy by manipulating exponents
instead of calling normalize().

Bug: skia:
Change-Id: I8d3596e858a2fbb6650c158753133c5a2e01e166
Reviewed-on: https://skia-review.googlesource.com/117009
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2018-04-02 16:05:05 +00:00