Commit Graph

5788 Commits

Author SHA1 Message Date
Greg Daniel
92cbf3fc01 Don't create lazy proxys if their width/height is greater than max tex size
Bug: skia:
Change-Id: I53508c4e3bbd4c315be4b29a66716e0c5e7f25bf
Reviewed-on: https://skia-review.googlesource.com/121161
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-04-12 21:40:11 +00:00
Cary Clark
88ba9710b5 son of path is rect bug
This variation tricks SkPath::isRect by exploiting
that the implementation resets the point pointer to
process the close verb, and using the reset pointer
to walk over a series of points that don't move.

In addition to fixing this, rename variables to
make the line creation more obvious, since left,
right, and friends, are not the left and right.

R=robertphillips@google.com

Bug: 824145,skia:7792
Change-Id: If8ebbc3eedd270652670d6e111a5bc02e61f0eec
Reviewed-on: https://skia-review.googlesource.com/121122
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Cary Clark <caryclark@skia.org>
2018-04-12 20:45:32 +00:00
Ethan Nicholas
b809efbbfa workaround for buggy macOS GLSL shader compiler
Bug: skia:
Change-Id: Ib77e11d80f93f76e65eac6119dbf2bd03523aaf9
Reviewed-on: https://skia-review.googlesource.com/117626
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2018-04-12 20:26:51 +00:00
Cary Clark
31608c02c2 another rect is path fix
This addresses comment #17 of skbug.com/7792.

The bug overshoots the end and exploits that the
first point tracked by close isn't the first
point in the rectangle.

Fixing this slightly regresses the example
in comment #14; before it was treated as a filled
rect but now it is not; this conservative approach
doesn't cause any other regressions.

bug7792 in pathfill.cpp verifies that all paths
in the bug draw correctly by comparing CPU and GPU.

R=robertphillips@google.com

Bug: 824145,skia:7792
Change-Id: I55bea023d2ad7456c8c3ebd9d1df95fe34e0a0d4
Reviewed-on: https://skia-review.googlesource.com/120996
Commit-Queue: Cary Clark <caryclark@skia.org>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-04-12 15:05: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
Chris Dalton
21f6437764 Implement Sk2f Load2
Bug: skia:
Change-Id: I7d37a76bcb9df9c5a1c22eb1b0277387816df7bb
Reviewed-on: https://skia-review.googlesource.com/120602
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2018-04-12 14:49:00 +00:00
Chris Dalton
e3fda9310a Implement Sk4f min/max
Bug: skia:
Change-Id: Icf235dea81e9f125c1c8590ec87cb3591393036c
Reviewed-on: https://skia-review.googlesource.com/120281
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-04-12 14:29:00 +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
Cary Clark
8540e110f9 more path is rect bugs
More edge cases found; clean up the logic a bit
to make more clear where the rectangle points
start and stop.

R=robertphillips@google.com,brianosman@google.com
Bug: 824145,skia:7792
Change-Id: Ie24dfd1519f30875f44ffac68e20d777490b00b9
Reviewed-on: https://skia-review.googlesource.com/120422
Commit-Queue: Cary Clark <caryclark@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-04-11 19:13:07 +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
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
Jim Van Verth
872da6b571 Add initial support for simple concave shadows.
Adds support for spot shadow outlines. Since filling the penumbra still
needs to be done, this code is disabled for now.

Bug: skia:
Change-Id: I3369eb13832b47ad16dd29ce7c7d6a1a10b39aeb
Reviewed-on: https://skia-review.googlesource.com/22363
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-04-10 16:31:32 +00:00
Robert Phillips
2fbbd03530 Remove extra Vulkan submitCommandBuffer from deleteTestingOnlyBackendTexture
Change-Id: I6e2fd012d1c2af72a34be2d1971e210d7373fe21
Reviewed-on: https://skia-review.googlesource.com/120080
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-04-10 15:06:21 +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
58627cb8eb one more path is rect bug
Add a check to see that the close path generated line
is horizontal or vertical when determining that path
is a rect.

Also change several tests to defer their initialization
to reduce debugging interference.

R=brianosman@google.com,robertphillips@google.com
Bug: 824145,skia:7792
Change-Id: I4a081ee4ffd3558b499a7a1aede2d6232059715e
Reviewed-on: https://skia-review.googlesource.com/120081
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
2018-04-10 14:17:21 +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
Chris Dalton
42f02aa4e3 Implement Sk2f::Store2
Bug: skia:
Change-Id: Ifea5957458e5547ee428809d9599286e70f3f8f9
Reviewed-on: https://skia-review.googlesource.com/119860
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-04-09 11:43:04 +00:00
Hal Canary
83e0f1b1bb SkPDF: smarter Jpeg when libjpeg-turbo is present
The fallback code does not parse the color type for EXIF-only jpegs.
Since these exist in the wild, we need to find out if they are really
standard YUV or greyscale Jpegs and embed them in PDFs if they are.

BUG=chromium:801430
Change-Id: I93eaf8b8fc22b7169b2fce9520e022b72ad0bf81
Reviewed-on: https://skia-review.googlesource.com/118992
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
2018-04-07 14:25:30 +00:00
Greg Daniel
3e8c3458f0 Make generated effects from sksl fp files not need SK_SUPPORT_GPU
Bug: skia:
Change-Id: I42a5c7fe7dc35a23290c8daa754c9fcce07f76fb
Reviewed-on: https://skia-review.googlesource.com/119010
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-04-06 18:27:53 +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
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
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
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
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
Stephen White
ea49523b5f GrTessellator: fix for points that become infinite on stroking.
stroke -> Inf -> NaN -> assert.

BUG=skia:7775

Change-Id: I086883bce90d1d473cff87f67e954718ea3181f6
Reviewed-on: https://skia-review.googlesource.com/118145
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-04-03 16:04:50 +00:00
Jim Van Verth
4db18edb95 Add SkOffsetSimplePolygon.
Performs inset and outset operations on simple polygons and returns
a simple polygon, if possible.

Bug: skia:
Change-Id: I6d468174ad70b5279b736c532e19cbb84ff9f955
Reviewed-on: https://skia-review.googlesource.com/116483
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-04-03 14:37:50 +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
Hal Canary
e9e19dd4a1 SkPDF/Clusterator: a second test
Change-Id: I805672d88f1c913acba58feca3ad950f5d82884d
Reviewed-on: https://skia-review.googlesource.com/117639
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-04-02 17:00:25 +00:00
Mike Klein
80e1d56e19 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>
2018-04-02 15:38:05 +00:00
Ethan Nicholas
c6a19f1d04 fix for frexp dataflow analysis
Bug: skia:
Change-Id: Ic20bedadfbf37fd78ce03872ece2d9552307cfcd
Reviewed-on: https://skia-review.googlesource.com/117243
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
2018-04-01 21:29:08 +00:00
Robert Phillips
6b6fcc7862 Add SkSurface factory that takes an SkSurfaceCharacterization
TBR=bsalomon@google.com
Change-Id: Ie38123dc7c35005bfe8500bf4a16e0d16bbf36bd
Reviewed-on: https://skia-review.googlesource.com/117236
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-03-30 19:12:26 +00:00
Hal Canary
1521c8a2b3 SkPDF/Clusterator: expose to the light of a unit test
Change-Id: I5667da133f608ab42f83daba3424134b8e956b1e
Reviewed-on: https://skia-review.googlesource.com/117006
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-03-29 20:32:15 +00:00
Derek Sollenberger
cf6da8c0f2 Dump additional details about the gpu resources.
GpuResources now dump optional string values that describe the type and
category of the resource.  The type provides a description of the kind
of resource it is (e.g. texture, buffer object, stencil, etc.) and the
category describes what the resource is currently tasked to do (e.g.
path masks, images, scratch, etc.)

This CL also refactors the dump logic in an attempt to consolidate
duplicated code into GrGpuResources.cpp.

Bug: b/74435803
Change-Id: I83cae825f41e6450a21398ab3ecea349c7c61c15
Reviewed-on: https://skia-review.googlesource.com/115989
Commit-Queue: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-03-29 18:08:15 +00:00
Stephen White
20010e80b6 Reland "GrTessellator: hang fix."
This is a reland of 050c86768a

Original change's description:
> GrTessellator: hang fix.
> 
> Some edges are not coincident with their own endpoints (because floating
> point). If this happens for an edge which is a right-enclosing-edge
> during the Bentley-Ottman simplify() pass, we end up an infinite loop
> attempting to split the edge, since the edge is never to the right of its
> endpoint.
> 
> The easiest fix is to simply remove the right-enclosing-edge splitting
> code. This code was originally added before we had proper
> active-edge-list rewinding, and should no longer be necessary.
> 
> BUG=802896
> 
> Change-Id: Id9f2942b73f01152af8c0088e8c6b1389891d827
> Reviewed-on: https://skia-review.googlesource.com/116920
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Stephen White <senorblanco@chromium.org>

Bug: 802896
Change-Id: I3e48346a8a358ae7d481299a586003e817a519ca
Reviewed-on: https://skia-review.googlesource.com/117121
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2018-03-29 14:28:55 +00:00
Ethan Nicholas
23463004df fixed type mismatches in SkSL comparison operators
Bug: skia:
Change-Id: I8f05088c561a80549264f7a65cb8161bbe7d8f4c
Reviewed-on: https://skia-review.googlesource.com/116982
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2018-03-29 13:41:25 +00:00
Mike Klein
f2590303b7 Revert "GrTessellator: hang fix."
This reverts commit 050c86768a.

Reason for revert: layout test diff in Chrome roll?

Original change's description:
> GrTessellator: hang fix.
> 
> Some edges are not coincident with their own endpoints (because floating
> point). If this happens for an edge which is a right-enclosing-edge
> during the Bentley-Ottman simplify() pass, we end up an infinite loop
> attempting to split the edge, since the edge is never to the right of its
> endpoint.
> 
> The easiest fix is to simply remove the right-enclosing-edge splitting
> code. This code was originally added before we had proper
> active-edge-list rewinding, and should no longer be necessary.
> 
> BUG=802896
> 
> Change-Id: Id9f2942b73f01152af8c0088e8c6b1389891d827
> Reviewed-on: https://skia-review.googlesource.com/116920
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Stephen White <senorblanco@chromium.org>

TBR=robertphillips@google.com,senorblanco@chromium.org

Change-Id: Icb928db6c052a21c6d327da9492cb991f769186f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 802896
Reviewed-on: https://skia-review.googlesource.com/117120
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2018-03-29 13:21:16 +00:00
Stephen White
050c86768a GrTessellator: hang fix.
Some edges are not coincident with their own endpoints (because floating
point). If this happens for an edge which is a right-enclosing-edge
during the Bentley-Ottman simplify() pass, we end up an infinite loop
attempting to split the edge, since the edge is never to the right of its
endpoint.

The easiest fix is to simply remove the right-enclosing-edge splitting
code. This code was originally added before we had proper
active-edge-list rewinding, and should no longer be necessary.

BUG=802896

Change-Id: Id9f2942b73f01152af8c0088e8c6b1389891d827
Reviewed-on: https://skia-review.googlesource.com/116920
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2018-03-28 19:55:34 +00:00
Robert Phillips
6eba063b63 Add new GrResourceCache::purgeUnlockedResources variant
TBR=bsalomon@google.com
Change-Id: I05bef1f8a271474db878a046cc1f6ac7b60a15f1
Reviewed-on: https://skia-review.googlesource.com/116801
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-03-28 18:56:14 +00:00
Jim Van Verth
41964ed46e Rename SkInsetConvexPolygon to SkOffsetPolygon.
Prep for adding new offset routines.

Change-Id: I261c22d9998e5ae4567b697c5f20a31f20777ac1
Reviewed-on: https://skia-review.googlesource.com/116800
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2018-03-28 14:49:14 +00:00
Ethan Nicholas
26a9aad63b initial SkSLJIT checkin
Docs-Preview: https://skia.org/?cl=112204
Bug: skia:
Change-Id: I10042a0200db00bd8ff8078467c409b1cf191f50
Reviewed-on: https://skia-review.googlesource.com/112204
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2018-03-27 18:39:13 +00:00
Ben Wagner
6ce482aed4 Remove include/svg from public.bzl includes.
It's strange to include it since public.bzl currently excludes all of
the source files that define the symbols declared in the headers in this
directory.

This also fixes the two files which needed to put some of these includes
behind the SK_XML macro. The public.bzl never defines the SK_XML macro,
so there is no need to ever have the include/svg directory on the
include path, even for DM.

Change-Id: I6cc18908aa16cfc914ed9b7ab174d03a0a242aa4
Reviewed-on: https://skia-review.googlesource.com/116547
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-03-27 16:36:29 +00:00
Brian Osman
052ef69570 Pin color type when a cross-context image is constructed
Fixes issues with gray images that may be incorrectly re-interpreted as
alpha when re-wrapped. (https://github.com/flutter/flutter/issues/15600)

Change-Id: I4a78466073e14d212108d168eed0b2df1bc92ffe
Reviewed-on: https://skia-review.googlesource.com/116484
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2018-03-27 14:45:14 +00:00
Brian Osman
094fba9cd6 Add SkColorSpaceXform_skcms
Currently only enabled in Skia dev builds. Has some diffs
in GMs and images, but (hopefully) nothing major.

Bug: skia:
Change-Id: Ifdf5d2804e59f555a3dc84f657e438dd589a2751
Reviewed-on: https://skia-review.googlesource.com/116520
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2018-03-27 13:15:24 +00:00
Mike Klein
68ff92f78a specialize arm64 allTrue()/anyTrue()
aarch64 added vector-wise add/mul/min/max instructions.
We can use min and max to implement allTrue() and anyTrue(),
respectively.

(This CL is mostly so I don't forget these intrinsics exist.)

In assembly, these actually compile to two instructions,
the folding operation into a vector register, then a move
from the vector register to a general purpose register.

Change-Id: Ia6a999ac250740de765e871094e911979a8711c7
Reviewed-on: https://skia-review.googlesource.com/116482
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2018-03-26 18:48:23 +00:00
Chris Dalton
ae18d07a7d Revert "Implement Sk2f::Store2"
This reverts commit 8a8a8e9dd5.

Reason for revert: Needs non-SIMD impl

Original change's description:
> Implement Sk2f::Store2
> 
> Bug: skia:
> Change-Id: Ieedd05ced376a7604936e9d2729fc20a8669496e
> Reviewed-on: https://skia-review.googlesource.com/115531
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Mike Klein <mtklein@google.com>

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

Change-Id: I8dfbd87c5871b041a4fc6ef3816f121c72083a20
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/116240
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2018-03-23 21:18:01 +00:00
Chris Dalton
8a8a8e9dd5 Implement Sk2f::Store2
Bug: skia:
Change-Id: Ieedd05ced376a7604936e9d2729fc20a8669496e
Reviewed-on: https://skia-review.googlesource.com/115531
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-03-23 19:28:30 +00:00