Commit Graph

1918 Commits

Author SHA1 Message Date
Brian Osman
ea7711d4a8 Tweak pointlight3d sample to work in Raster backend
- Once we add all the missing intrinsics, the locally defined ones
  can go away.
- Having the default interpreter vector width match the raster pipeline
  is a huge perf win.

Change-Id: I482e409e57791b78a0e6fb15929ae77eb0e76bf3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/265600
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-01-21 22:47:12 +00:00
Julia Lavrova
51a813db80 Calculating drawing area for a line with shadows
Change-Id: Ifb2de5573f4362332cf174012e7ef9bf8248cd59
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/265524
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-01-21 22:30:52 +00:00
Mike Reed
8c2ccc07ba use real normal-map texture
transpose(inverse(localToWorld)) does not seem to be working, so skipping
it for now.

Change-Id: I7dd5a01020f590dec02b36f54752092643acf3d8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/265401
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-01-21 15:29:00 +00:00
Mike Reed
9f22f1ff31 use transpose of inverse for transforming normals
Change-Id: I16d5167dcaed215a8009225765cd53c3620790dc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/265338
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-01-21 01:49:58 +00:00
Mike Reed
f0b7edf6cd hack up bump-map
Change-Id: Ib1e92359f0decd60bdcb628a5b11be1c597b4f82
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/265219
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-01-18 19:53:49 +00:00
Mike Reed
5344cc31ff clean up: remove artificial mouse loc rejects
Now that "point" is local (viewer may have modified it for zooming or panning),
it no longer makes sense to check for out-of-bounds.

Change-Id: I8881f8b27be96973cb7687b25d93a0de5a22f5db
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/265218
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-01-18 17:45:29 +00:00
Mike Reed
ee3216d8f8 Use SkSL to do point-light shading
- misc fixes to utilities
- hit-testing for 3D scenes (simple version)

Had to manually inform the shader of the local-to-world matrix.
Should try making that automatic in the future.

Note: due to bug in interpreter, point-light sample can't run in raster
(yet).

Change-Id: I7a30b7676ea6cd7eb264373dd2507133c901d85e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/264999
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-01-18 03:16:18 +00:00
Mike Reed
d4d3b33624 Make converting from 4x4 to 3x3 explicit
Change-Id: I4d190d6831cb517d5e9f22b3f872013367bddc08
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/264856
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-01-16 22:15:30 +00:00
Mike Reed
c43f2a0898 mark all exerimental (3d) apis as such
Bug: skia:9768
Change-Id: I10d8d3507df15ad45d827d2210d5bf2250ac1aaf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/264778
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-01-16 20:25:40 +00:00
Mike Reed
b18e74dcbd Expose camera matrix in SkCanvas
3 new getters:
- localToWorld
- localToCamera
- localToDevice (same as total-matrix)

The current tracking minimizes overhead, by using a computed inverse to
produce the localToWorld/Camera. This can be change as needed in the
future (more precision, but more memory/overhead), but for now is
sufficient to try out the new APIs.

Change-Id: I85440318f36dca935124b782e110fe9c0152ae7a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/264648
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2020-01-16 19:35:40 +00:00
Mike Reed
c4b8eefe56 move SkV3 into header
Change-Id: I20284b415bbfe5ecc15fe9fe47dcbb65850d4368
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/264682
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-01-16 11:34:32 +00:00
Julia Lavrova
9bd8351ef3 RTL Paragraph + all it causes
Change-Id: Ia8711bf8a002af7ca9ae603cdd9a109c8af86360
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/264640
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-01-15 21:25:16 +00:00
Mike Reed
ee0a03a3f3 experimental: saveCamera()
bug: skia:9768
Change-Id: I84b8f32933023d3376b51c2b93cc843863008828
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/264476
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-01-15 19:27:34 +00:00
Julia Lavrova
4cf1874981 Fixing the cache
Change-Id: Ief6ce50095c73498307748d30608100c10790746
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/264399
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-01-15 16:58:14 +00:00
Mike Reed
7543587ee2 clean-up 3d sample's use of matrices
Propose a standard way to talk about the camera (etc) in SkCanvas:
- client provides 3 matrices: viewport, projection, camera
- canvas->concat(viewport * projection * camera * invert(viewport)
- camera and projection are taken straight from the textbook for 3D
- "viewport" means a matrix that transforms +-1 square about the origin
  to the clients working canvas. A simple way to describe it is:
  "specify the area-of-interest with a rectangle and z_scale"

Expose the ctm as a 44 from canvas for now. Likely we will add these
3 new matrices to canvas, and each may have a getter.

Bug: skia:
Change-Id: I6fa79c56956e060c17569848a81e13c13cb0981a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/264221
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2020-01-14 15:56:12 +00:00
Brian Salomon
bfb72113a7 Reland "Remove GrPaint::addColorTextureProcessor"
Chrome layout test suppression has landed.

This reverts commit 67d0f3fd72.

Change-Id: I5b9963b306f29a41cf36e1802e7eebda010f186d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/264016
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-01-13 16:46:42 +00:00
Julia Lavrova
70e9301c26 Formatting paragraph with width=0
Change-Id: I0a4f2db10835661b33d0ffa69d27e8994b473b24
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/263704
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-01-13 14:22:22 +00:00
Mike Reed
69ace2a0ad sample3d
Change-Id: Idae6792f0ed1150c1cd167690403c7b97795e5ea
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/263817
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-01-11 21:23:27 +00:00
Mike Reed
f6d70a8e3f Revert "Revert "forward concat44 in nway canvas""
This reverts commit 3723fb7e85.

Fix: don't call the inherited methods on canvas

bug: skia: 9768
Change-Id: Ifb913bd30452ba8389399f709d40c7b58d6157d8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/263776
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-01-10 22:01:41 +00:00
Mike Reed
3723fb7e85 Revert "forward concat44 in nway canvas"
This reverts commit 8964bc13da.

Reason for revert: break flutter unittest?

Original change's description:
> forward concat44 in nway canvas
> 
> Change-Id: If4eb791c0701fb7055283e721308bd3c633576d7
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/263572
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=reed@google.com

Change-Id: I0c8e3b3d0df05948f935ffa6d72ea84ef420b7cc
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/263714
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-01-10 20:27:12 +00:00
Mike Reed
8964bc13da forward concat44 in nway canvas
Change-Id: If4eb791c0701fb7055283e721308bd3c633576d7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/263572
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-01-10 17:23:51 +00:00
Julia Lavrova
f6a3f8eb74 height_override without a multiplier
Change-Id: I07b8631928de3e4920393124bac37fefbbaf4c2a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/263568
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-01-10 16:44:41 +00:00
Julia Lavrova
c48687a0cc Ellipsis attached to cluster, not word
Change-Id: I3bcef7e57a8f95a12743325363463a3a4039776e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/263206
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2020-01-10 14:40:41 +00:00
Jim Van Verth
67d0f3fd72 Revert "Remove GrPaint::addColorTextureProcessor"
This reverts commit a92320d4e6.

Reason for revert: Blocking Chrome roll.

Original change's description:
> Remove GrPaint::addColorTextureProcessor
> 
> Just make the effect and then add it.
> 
> Makes it easier to make changes to GrTextureEffect::Make going forward.
> 
> Also add default param for matrix (identity).
> 
> Change-Id: I52073f11a0a78b971bb512627198ee1724bfdac7
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/263518
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

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

Change-Id: I2618844f5a8f5f1873dd79142caafd8939384e9e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/263560
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-01-09 21:33:24 +00:00
Brian Salomon
a92320d4e6 Remove GrPaint::addColorTextureProcessor
Just make the effect and then add it.

Makes it easier to make changes to GrTextureEffect::Make going forward.

Also add default param for matrix (identity).

Change-Id: I52073f11a0a78b971bb512627198ee1724bfdac7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/263518
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-01-09 19:28:24 +00:00
Greg Daniel
e20fcad156 Reland "Move makeDeferredRenderTargetContext calls to factory on RTC."
This reverts commit a4f207eb67.

Reason for revert: Landing with fix

Original change's description:
> Revert "Move makeDeferredRenderTargetContext calls to factory on RTC."
>
> This reverts commit 1c16b43033.
>
> Reason for revert: Red on tree
> Original change's description:
> > Move makeDeferredRenderTargetContext calls to factory on RTC.
> >
> > Change-Id: Iaa8f5829d9f8650ff27a60f75fb2216f016ab85e
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262058
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
>
> TBR=egdaniel@google.com,bsalomon@google.com
>
> Change-Id: I9e3c9d13c66b5437c87ad7136d283fa4ac81df1f
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/263019
> Reviewed-by: Jim Van Verth <jvanverth@google.com>
> Commit-Queue: Jim Van Verth <jvanverth@google.com>

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

Change-Id: If4ec8316a952fb482471c22273f4724f9b30a998
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/263022
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2020-01-08 19:13:14 +00:00
Jim Van Verth
a4f207eb67 Revert "Move makeDeferredRenderTargetContext calls to factory on RTC."
This reverts commit 1c16b43033.

Reason for revert: Red on tree
Original change's description:
> Move makeDeferredRenderTargetContext calls to factory on RTC.
> 
> Change-Id: Iaa8f5829d9f8650ff27a60f75fb2216f016ab85e
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262058
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

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

Change-Id: I9e3c9d13c66b5437c87ad7136d283fa4ac81df1f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/263019
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2020-01-08 13:31:21 +00:00
Greg Daniel
1c16b43033 Move makeDeferredRenderTargetContext calls to factory on RTC.
Change-Id: Iaa8f5829d9f8650ff27a60f75fb2216f016ab85e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262058
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-01-07 21:14:13 +00:00
Chris Dalton
b832ce61ee Add a path renderer that uses GPU tessellation
Implements a simple first pass for a path renderer that uses the
classic Red Book "stencil then cover" method, and linearizes curves
with GPU tessellation shaders.

The new path renderer is disabled by default, and can only be enabled
in the viewer UI or by passing the "--pr gtess" flag.

Change-Id: Ic9354952e93c8b108577961760b4f0daa82d35aa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/261715
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-01-07 20:00:22 +00:00
Brian Salomon
b8f098d372 Reland "Rename GrSimpleTextureEffect->GrTextureEffect"
This reverts commit d7436a37ff.

Restores old file order in gpu.gni until Mac/Metal issue can be
debugged.

Change-Id: I6e2ee3bdc3b39270aeaaf28b9613e4ac49d38e1e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262801
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2020-01-07 18:44:42 +00:00
Brian Salomon
d7436a37ff Revert "Rename GrSimpleTextureEffect->GrTextureEffect"
This reverts commit 90673ec665.

Reason for revert: Causes metal bot failures

Original change's description:
> Rename GrSimpleTextureEffect->GrTextureEffect
>
> It will become less simple.
>
> Change-Id: I409d0faba386597ae05738273d5ff773501eb358
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262383
> Auto-Submit: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

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

Change-Id: Id25c9cde3c2048149409745f163e42c588de70c1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262514
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-01-07 15:07:09 +00:00
Brian Salomon
90673ec665 Rename GrSimpleTextureEffect->GrTextureEffect
It will become less simple.

Change-Id: I409d0faba386597ae05738273d5ff773501eb358
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262383
Auto-Submit: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-01-06 21:49:44 +00:00
Chris Dalton
e7ee06926f Move "set_path_pt" from SampleAAGeometry into ToolUtils
Copies the function wholesale so it can be reused by other tooling
code.

Change-Id: I8b8f8ceb7dabb12e9e67b8339735f618dc2ccf2a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262348
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2020-01-06 19:00:13 +00:00
Julia Lavrova
53c1447848 Small bug fixes: leading spaces affect all width measurements,
longest line and so on.

Change-Id: I497022269ad38e3cf6a1920f67b1d9217aa6d805
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/260778
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2020-01-06 14:57:41 +00:00
Mike Reed
fe2d3c7334 SkBlurMaskFilter.h is only needed for (deprecated) emboss
Change-Id: I1308d29470e8127e65a9f2c33ca68a613e077a6e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/261737
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-12-30 15:40:46 +00:00
Mike Reed
c880346ba5 Detect when perspective is really affine, and update the matrix as we handoff
the ctm to the device.

This catches cases where the matrix bottom-row might look like
   [ 0, 0, not_one ]

That would get categorized as perspective, but in reality that matrix
behaves like affine. If we can detect that pattern, and scale the entire
matrix by 1/not_one, we don't change its behavior, but it will now be
categorized as affine (seen as simpler/faster).

bug: skia:9698
Change-Id: Ib77b647c1d32f73538b1c0d8e9e49ec533610b3a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/260776
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2019-12-18 21:25:43 +00:00
Mike Reed
190b82d67c Add clipping for perspective triangles
more UI for halfplanes in SampleClip

bug: skia:9698
Change-Id: I9463fe9860fa482ef05fc2113114e61524c38fc0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/260500
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-12-17 23:24:18 +00:00
Mike Reed
cbeabd969b Can't fold ctm and color matrix when in perspective
Will work on clipping in follow-up CL

Change-Id: I1e4cc485555a435c740a4e5b50445f21e9ec20c7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/260404
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-12-17 10:49:42 +00:00
Mike Klein
f46d5ca492 use std::make_unique
Change-Id: I7c672ff6b8eb95ec8c1123a5bfdb202e1644f494
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/259281
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-12-12 22:32:45 +00:00
Julia Lavrova
90bfd1c1c3 Small changes
Change-Id: Ic9c41a2dd11b4df8ab24037df0109e36536ec6c3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/257892
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2019-12-09 21:58:13 +00:00
Mike Reed
0483b46f11 fix make_path to not care about param-eval-order
Change-Id: I2ed4568768628fd1870acda0272056dc7e9920fc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/258516
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-12-05 23:05:11 +00:00
Mike Reed
fae46e4043 move perspective-clipper into SkPathPriv
From here we can start trying it out for real
- skottie could call it directly
- SkDraw could call it for the raster-backend

Change-Id: I703838241d67c539afd3d3e31d0ddf1c66645799
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/258001
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-12-05 16:18:52 +00:00
Mike Reed
6344c29379 some cleanups for halfplanes
Plan is to next move the clipper into utils / SkCanvas itself

Change-Id: Ia79c5bc2750a3a2719f901d255890a8c43ef1b42
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/257916
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-12-04 18:27:17 +00:00
Jim Van Verth
c336315d3c Some more tweaks to perspective path clipping
Bug: skia:9546
Change-Id: Ib91880e09ae6373bc133d684aa7510c67681ec1e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/257629
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2019-12-03 17:35:10 +00:00
Robert Phillips
03e4c95c31 Move creation of GrProgramDesc to GrCaps-derived classes
We need a means of creating GrProgramDescs pre-flush w/o needing to know the specific backend in play.

Bug: skia:9455
Change-Id: Iac14ff8eda262ee6d2ad666c5d2e27e7a375c210
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/256698
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-11-27 13:22:02 +00:00
Mike Reed
7d34dc7747 Revert "Revert "switch to new filltype for SkPath""
This reverts commit 3e7af41224.

Change-Id: Id4f66b3956f4bdbe690db20fc478b7365ee89717
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/256676
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-11-26 17:43:14 +00:00
Michael Ludwig
704d5408db Allow Tessellator to operate on provided GrQuads
To facilitate this, the GrQuadBuffer::Iter's local GrQuads that are
modified on each next() are now allowed to be operated on for the AA
inset/outsetting. Previously this required additional GrQuads on the
stack to hold the results, and additional guards for accessing localQuad()
when the entry didn't have actual coords.

With this change, a 2D op should have its device and src GrQuads' Ws
set to 1 once, and then they are completely ignored for all iteration
and tessellation, without any more redundant initialization. In all
likelihood we won't see the needle move on powerful platforms, but may
help lower end devices.

Change-Id: I457205786766403a760918e779d36ba056d69cde
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/256097
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-11-26 14:57:44 +00:00
Mike Reed
3e7af41224 Revert "switch to new filltype for SkPath"
This reverts commit 3a50981a83.

Reason for revert: chrome win build found compile-problem in xpsdevice

Original change's description:
> switch to new filltype for SkPath
> 
> Change-Id: I7793324a9acf4afb0eb38c1e20fbb38eac25d636
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/256102
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Mike Reed <reed@google.com>

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

Change-Id: Iacb3566da61c2512b9bd6b7e42b592febc85e031
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/256530
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-11-26 03:34:30 +00:00
Mike Reed
3a50981a83 switch to new filltype for SkPath
Change-Id: I7793324a9acf4afb0eb38c1e20fbb38eac25d636
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/256102
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2019-11-25 22:31:46 +00:00
Julia Lavrova
c028b42717 Ellipsis again
Change-Id: I895fd394dedc50acd648eeed4f398c375a9812ee
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/256224
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2019-11-25 19:57:15 +00:00
Brian Salomon
fc118442f6 Reland "Revert "Revert "Make FP optimizations helpers use SkAlphaType not GrColorType"""
This is a reland of 997b37fdb9

Layout tests have been suppressed.

Original change's description:
> Revert "Revert "Make FP optimizations helpers use SkAlphaType not GrColorType""
>
> This reverts commit 078e8faa26.
>
> Change-Id: I67b2970584db5a1afbf9928b77c5444947ef71a3
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255897
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

Change-Id: I6db4cff8b71ef1f29ac47f7729b9514d009f730a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/256225
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-11-25 15:46:35 +00:00
Robert Phillips
50299de399 Reland "Revert "Make FP optimizations helpers use SkAlphaType not GrColorType""
This reverts commit 997b37fdb9.

Reason for revert: May be blocking Chrome roll

Original change's description:
> Revert "Revert "Make FP optimizations helpers use SkAlphaType not GrColorType""
> 
> This reverts commit 078e8faa26.
> 
> Change-Id: I67b2970584db5a1afbf9928b77c5444947ef71a3
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255897
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

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

Change-Id: I0d2754ac7f4672f0758e4d00cd9e06998637846a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/256196
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-11-23 15:21:08 +00:00
Brian Salomon
997b37fdb9 Revert "Revert "Make FP optimizations helpers use SkAlphaType not GrColorType""
This reverts commit 078e8faa26.

Change-Id: I67b2970584db5a1afbf9928b77c5444947ef71a3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255897
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-11-23 00:51:03 +00:00
Mike Reed
30bc527fd6 Revert "Reland "Revert "Use flat version of path-direction enum"""
This reverts commit 7cda6f3743.

Reason for revert: legacy convexity code removed -- google3 should be ok

Original change's description:
> Reland "Revert "Use flat version of path-direction enum""
>
> This reverts commit 1792b19485.
>
> Reason for revert: need to update legacy_convexity, still used by google3
>
> Original change's description:
> > Revert "Revert "Use flat version of path-direction enum""
> >
> > This reverts commit 0dacc6b7d3.
> >
> > Change-Id: Ie103e9f36b07e4ee256a3688a4decf3a6dd74314
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255832
> > Auto-Submit: Mike Reed <reed@google.com>
> > Reviewed-by: Mike Reed <reed@google.com>
> > Commit-Queue: Mike Reed <reed@google.com>
>
> TBR=reed@google.com
>
> Change-Id: I0ecea0eb8a237298c6b908cc4bfd1cacdfc5b900
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255976
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=reed@google.com

Change-Id: I3529139bb391c4f62ce5cd0744cdf38a13b71d78
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255984
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-11-22 19:09:54 +00:00
Michael Ludwig
189c98042f GrQuadPerEdgeAA::Tessellator owns GrVertexWriter
Change-Id: I3c8bf48dda061aa9d318b9f81f22608fdd68fcbd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255786
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-11-22 17:31:34 +00:00
Mike Reed
7cda6f3743 Reland "Revert "Use flat version of path-direction enum""
This reverts commit 1792b19485.

Reason for revert: need to update legacy_convexity, still used by google3

Original change's description:
> Revert "Revert "Use flat version of path-direction enum""
> 
> This reverts commit 0dacc6b7d3.
> 
> Change-Id: Ie103e9f36b07e4ee256a3688a4decf3a6dd74314
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255832
> Auto-Submit: Mike Reed <reed@google.com>
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=reed@google.com

Change-Id: I0ecea0eb8a237298c6b908cc4bfd1cacdfc5b900
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255976
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-11-22 11:03:34 +00:00
Brian Salomon
078e8faa26 Revert "Make FP optimizations helpers use SkAlphaType not GrColorType"
This reverts commit 7a538b1eec.

Reason for revert: ios failures

Original change's description:
> Make FP optimizations helpers use SkAlphaType not GrColorType
> 
> Change-Id: I3b7cde6e7f68192af5419fb09c7d59e7a803a4d5
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255818
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>

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

Change-Id: Id41daa47fb3ccac434bb9d71a697f32e36c87367
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255835
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-11-22 04:10:34 +00:00
Brian Salomon
7a538b1eec Make FP optimizations helpers use SkAlphaType not GrColorType
Change-Id: I3b7cde6e7f68192af5419fb09c7d59e7a803a4d5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255818
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-11-22 03:30:32 +00:00
Mike Reed
1792b19485 Revert "Revert "Use flat version of path-direction enum""
This reverts commit 0dacc6b7d3.

Change-Id: Ie103e9f36b07e4ee256a3688a4decf3a6dd74314
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255832
Auto-Submit: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-11-22 00:51:22 +00:00
Mike Reed
0dacc6b7d3 Revert "Use flat version of path-direction enum"
This reverts commit e0fbe94351.

Reason for revert: need to add guard flag to flutter

Original change's description:
> Use flat version of path-direction enum
> 
> Bug: skia:9663
> Change-Id: I00077d9f2b14b3e983e6a46ef6f560cabdb1678d
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/242557
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Florin Malita <fmalita@chromium.org>

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

Change-Id: If47173d9b203b2d3a175af290a15d986accb4703
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:9663
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255831
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-11-21 22:10:32 +00:00
Mike Reed
e0fbe94351 Use flat version of path-direction enum
Bug: skia:9663
Change-Id: I00077d9f2b14b3e983e6a46ef6f560cabdb1678d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/242557
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-11-21 21:45:20 +00:00
Michael Ludwig
73dbea669b Specialize vertex writing function for common quad VertexSpecs
Change-Id: I204f04596809e1e33f20b67b454cdd0e1f269630
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255303
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-11-20 19:58:11 +00:00
Mike Reed
63edc57c97 restructure EdgeClipper to accommodate other callers (e.g. half-plane)
This allows us to clip a path against a half-plane (an arbitrary
diagonal line), in an effort to handle perspective correctly with
the near-plane.

Change-Id: I2082a750acf858340e4500ad46cf581472cefc6b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/253996
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-11-18 18:22:19 +00:00
Julia Lavrova
2e30fde046 Font resolution: all unit tests working
Change-Id: Ie6ee30901d599ceefa42651add79bb0288c54c48
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/249004
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Julia Lavrova <jlavrova@google.com>
2019-11-08 17:24:14 +00:00
Brian Osman
e36d030016 SkColorMatrix cleanup
Remove the RGB/YUV helpers (use SkYUVMath instead), along with the
unused get20/set20.

Change-Id: Id83467a1b7f33657869e0a933af75387a4e36a88
Bug: skia:9543
Change-Id: Id83467a1b7f33657869e0a933af75387a4e36a88
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/252188
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-11-04 15:20:15 +00:00
Robert Phillips
c554dcf4b5 Add helper to determine the index buffer that will be used
This CL doesn't use the new VertexSpec member variable but should clarify the path forward (i.e., we will determine the index buffer option at characterize time and enforce that decision at onPrepare time for all the meshes).

This also refactors the GrTextureOp::characterize call.

Change-Id: I7010385abf5a462c12fd47e314aad893bca85fb9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/251002
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2019-10-28 16:36:02 +00:00
Greg Daniel
c594e62698 Plumb GrColorType through all ops/processors that sample textures.
This change also allows for the remove of GrPixelConfigIsOpaque function.

Bug: skia:6718
Change-Id: I7e7b70f02d911eda67640d648fb6348091e0f55d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/248698
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-10-15 18:34:37 +00:00
Julia Lavrova
f3ed273b32 Adding line/style metrics
Fixed some bugs for flutter tests

Change-Id: I43f4b4b185152a8d642127370da5f80fb96f1e9e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239444
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-10-07 15:07:48 +00:00
Robert Phillips
405413fcec Clarify that the OpArgs' outputSwizzle comes from its GrRenderTargetProxy
Since we want to collect shader information early, this attempts to make clear that numSamples, origin and outputSwizzle can all be obtained from the target renderTargetProxy.


Change-Id: I42e0fd79e2163f17673ccdd344a31fbaadac5f53
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/246298
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-10-04 18:03:32 +00:00
Brian Salomon
9241a6d394 Reland "Reland "SkSurface asynchronous read APIs allow client to extend pixel lifetime""
This is a reland of 6fc04f88a8

Original change's description:
> Reland "SkSurface asynchronous read APIs allow client to extend pixel lifetime"
> 
> This is a reland of ce240cc6fd
> 
> Original change's description:
> > SkSurface asynchronous read APIs allow client to extend pixel lifetime
> > 
> > Previously the pixel data passed to the client was only valid during
> > the client's callback. This meant if the client wanted to defer
> > processing of the data a copy was necessary.
> > 
> > Now we pass an object to the callback and the pixel lifetime is tied
> > to the lifetime of that object.
> > 
> > The object may be holding a GPU transfer buffer mapped. We don't assume
> > that the object will be released on the direct GrContext thread. So
> > when the object is destroyed it posts a message to a new type,
> > GrClientMappedBufferManager, hanging off the direct context. The direct
> > context will periodically check for messages and unmap and then unref
> > buffers so that they can be reused. Currently this is done in
> > GrContext::performDeferredCleanup() and GrDrawingManager::flush().
> > 
> > The old API is kept around for backwards compatibility but it is
> > reimplemented as a bridge on top of the new mechanism.
> > 
> > Also a utility function to SkImageInfo is added to directly make a new
> > info with a specified dimensions rather than passing the width and
> > height separately to makeWH().
> > 
> > Bug: chromium:973403
> > Bug: skia:8962
> > 
> > Change-Id: Id5cf04235376170142a48e90d3ecd13fd021a2a6
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245457
> > Reviewed-by: Brian Osman <brianosman@google.com>
> > Commit-Queue: Brian Salomon <bsalomon@google.com>
> 
> Bug: chromium:973403, skia:8962
> Change-Id: I5cecd36276c8b6dc942cf549c7095db2df88530c
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245678
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

Bug: chromium:973403, skia:8962
Change-Id: Ie584c1c3ef8021c976f71b708e53871c693cc450
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/246057
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-10-03 19:14:22 +00:00
Ravi Mistry
cb55010652 Revert "Reland "SkSurface asynchronous read APIs allow client to extend pixel lifetime""
This reverts commit 6fc04f88a8.

Reason for revert: Chrome roll failure suspect because of:
* https://chromium-review.googlesource.com/c/chromium/src/+/1837131 (22 commits)
* https://chromium-review.googlesource.com/c/chromium/src/+/1837214 (24 commits)

Original change's description:
> Reland "SkSurface asynchronous read APIs allow client to extend pixel lifetime"
>
> This is a reland of ce240cc6fd
>
> Original change's description:
> > SkSurface asynchronous read APIs allow client to extend pixel lifetime
> >
> > Previously the pixel data passed to the client was only valid during
> > the client's callback. This meant if the client wanted to defer
> > processing of the data a copy was necessary.
> >
> > Now we pass an object to the callback and the pixel lifetime is tied
> > to the lifetime of that object.
> >
> > The object may be holding a GPU transfer buffer mapped. We don't assume
> > that the object will be released on the direct GrContext thread. So
> > when the object is destroyed it posts a message to a new type,
> > GrClientMappedBufferManager, hanging off the direct context. The direct
> > context will periodically check for messages and unmap and then unref
> > buffers so that they can be reused. Currently this is done in
> > GrContext::performDeferredCleanup() and GrDrawingManager::flush().
> >
> > The old API is kept around for backwards compatibility but it is
> > reimplemented as a bridge on top of the new mechanism.
> >
> > Also a utility function to SkImageInfo is added to directly make a new
> > info with a specified dimensions rather than passing the width and
> > height separately to makeWH().
> >
> > Bug: chromium:973403
> > Bug: skia:8962
> >
> > Change-Id: Id5cf04235376170142a48e90d3ecd13fd021a2a6
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245457
> > Reviewed-by: Brian Osman <brianosman@google.com>
> > Commit-Queue: Brian Salomon <bsalomon@google.com>
>
> Bug: chromium:973403, skia:8962
> Change-Id: I5cecd36276c8b6dc942cf549c7095db2df88530c
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245678
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

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

Change-Id: I9e01d1b82fb399b94292441d91da51176bb161d9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:973403, skia:8962
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245956
Reviewed-by: Ravi Mistry <rmistry@google.com>
Commit-Queue: Ravi Mistry <rmistry@google.com>
2019-10-03 09:19:24 +00:00
Brian Salomon
6fc04f88a8 Reland "SkSurface asynchronous read APIs allow client to extend pixel lifetime"
This is a reland of ce240cc6fd

Original change's description:
> SkSurface asynchronous read APIs allow client to extend pixel lifetime
> 
> Previously the pixel data passed to the client was only valid during
> the client's callback. This meant if the client wanted to defer
> processing of the data a copy was necessary.
> 
> Now we pass an object to the callback and the pixel lifetime is tied
> to the lifetime of that object.
> 
> The object may be holding a GPU transfer buffer mapped. We don't assume
> that the object will be released on the direct GrContext thread. So
> when the object is destroyed it posts a message to a new type,
> GrClientMappedBufferManager, hanging off the direct context. The direct
> context will periodically check for messages and unmap and then unref
> buffers so that they can be reused. Currently this is done in
> GrContext::performDeferredCleanup() and GrDrawingManager::flush().
> 
> The old API is kept around for backwards compatibility but it is
> reimplemented as a bridge on top of the new mechanism.
> 
> Also a utility function to SkImageInfo is added to directly make a new
> info with a specified dimensions rather than passing the width and
> height separately to makeWH().
> 
> Bug: chromium:973403
> Bug: skia:8962
> 
> Change-Id: Id5cf04235376170142a48e90d3ecd13fd021a2a6
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245457
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

Bug: chromium:973403, skia:8962
Change-Id: I5cecd36276c8b6dc942cf549c7095db2df88530c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245678
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-10-03 01:41:35 +00:00
Brian Salomon
9c219785a8 Revert "SkSurface asynchronous read APIs allow client to extend pixel lifetime"
This reverts commit ce240cc6fd.

Reason for revert: crashing in chrome unit test, abandoned context related?

Original change's description:
> SkSurface asynchronous read APIs allow client to extend pixel lifetime
> 
> Previously the pixel data passed to the client was only valid during
> the client's callback. This meant if the client wanted to defer
> processing of the data a copy was necessary.
> 
> Now we pass an object to the callback and the pixel lifetime is tied
> to the lifetime of that object.
> 
> The object may be holding a GPU transfer buffer mapped. We don't assume
> that the object will be released on the direct GrContext thread. So
> when the object is destroyed it posts a message to a new type,
> GrClientMappedBufferManager, hanging off the direct context. The direct
> context will periodically check for messages and unmap and then unref
> buffers so that they can be reused. Currently this is done in
> GrContext::performDeferredCleanup() and GrDrawingManager::flush().
> 
> The old API is kept around for backwards compatibility but it is
> reimplemented as a bridge on top of the new mechanism.
> 
> Also a utility function to SkImageInfo is added to directly make a new
> info with a specified dimensions rather than passing the width and
> height separately to makeWH().
> 
> Bug: chromium:973403
> Bug: skia:8962
> 
> Change-Id: Id5cf04235376170142a48e90d3ecd13fd021a2a6
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245457
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

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

Change-Id: Ic14cf07a7629b167c9f34a651aa87a0326e74207
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:973403, skia:8962
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245721
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-10-02 22:51:15 +00:00
Ben Wagner
1ca50524c4 Allow better font fallback.
The intent is to allow the creation of a MakeFontMgrRunIterator which
uses the passed font's typeface as the primary typeface, but uses a
given family name and style as for the request for fallback fonts. This
allows the user to provide the actual request for the primary typeface
as opposed to making a request based on the resolved primary typeface
(which may not be the right thing to do).

To support this, the selection of language for fallback is also added.
Since this information is already in the language iterator, this change
makes the font iterator the lowest priority iterator for consume,
allowing the font iterator to rely on the current value of the language
iterator to provide the language.

In order to allow these changes to be exercised, this also adds a few
generic 'Make' methods for bidi and script. These new methods will use
the best available implementation. These are needed since the most
capable implementations may not always be available (such as on our
testing ios builds).

Change-Id: I1b8d9c9007058adcb2a26e0581d903b835a6118f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245460
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2019-10-02 22:19:13 +00:00
Brian Salomon
ce240cc6fd SkSurface asynchronous read APIs allow client to extend pixel lifetime
Previously the pixel data passed to the client was only valid during
the client's callback. This meant if the client wanted to defer
processing of the data a copy was necessary.

Now we pass an object to the callback and the pixel lifetime is tied
to the lifetime of that object.

The object may be holding a GPU transfer buffer mapped. We don't assume
that the object will be released on the direct GrContext thread. So
when the object is destroyed it posts a message to a new type,
GrClientMappedBufferManager, hanging off the direct context. The direct
context will periodically check for messages and unmap and then unref
buffers so that they can be reused. Currently this is done in
GrContext::performDeferredCleanup() and GrDrawingManager::flush().

The old API is kept around for backwards compatibility but it is
reimplemented as a bridge on top of the new mechanism.

Also a utility function to SkImageInfo is added to directly make a new
info with a specified dimensions rather than passing the width and
height separately to makeWH().

Bug: chromium:973403
Bug: skia:8962

Change-Id: Id5cf04235376170142a48e90d3ecd13fd021a2a6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245457
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-10-02 19:20:08 +00:00
Greg Daniel
5faf474fab More bounds fixes for StrokeRect and DefaultPath when using MSAA for non-aa.
Change-Id: Ia9c2a47675eac8f3ac1220c0e1089766aa141fc1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245364
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-10-01 19:49:15 +00:00
Kevin Lubick
7aeabcfa6a [SkParagraph] Require len if using addText(const char*)
Bug: skia:9469
Change-Id: Ie3ae11db9be4b1cf1645e8db0bf29dc8e59bc4cd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/244877
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-09-29 11:39:34 +00:00
Mike Reed
4241f5e0a8 Revert "add guard to switch to SkPathTypes"
This reverts commit e1af44498b.

Reason for revert: breaking google3?

Original change's description:
> add guard to switch to SkPathTypes
> 
> Change-Id: I44d8b5ae8a5172d11a6d4cd9d994373dd3816d6f
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/241278
> Reviewed-by: Kevin Lubick <kjlubick@google.com>
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Mike Reed <reed@google.com>

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

Change-Id: If1fffb6310921ee6f213af000da793afcf62ab0b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/241560
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-09-14 19:13:44 +00:00
Mike Reed
e1af44498b add guard to switch to SkPathTypes
Change-Id: I44d8b5ae8a5172d11a6d4cd9d994373dd3816d6f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/241278
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2019-09-14 01:26:38 +00:00
Jim Van Verth
d0cf5da20d Hook up pinch-zoom and swipe gestures.
Sets UIPinchGestureRecognizer and UISwipeGestureRecognizers and
passes the result down to the sk_app::Window. To simplify detection,
swipes take precedence over pans, and pans require a single touch.
This is less flexible for the app, but in most cases I think is
what we want.

Bug: skia:8737
Change-Id: Ib031b6ad465d3a353da29d7e0b48a666d4ff8b9a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239776
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-09-10 13:34:47 +00:00
Michael Ludwig
b6e8922955 Clean up prior backdrop-filter CL
This addresses reviewer comments from https://skia-review.googlesource.com/c/skia/+/239108 that were postponed to get the first CL landed ASAP.

Additionally, removes the now unnecessary applyCTMForBackdrop() function.

Bug: skia:9074
Change-Id: Ibc3ac4a4edd7e5546fa83145346869a68efc33f4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239440
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-09-05 19:59:46 +00:00
Michael Ludwig
6d1c0d4196 Avoid use of SkMatrixImageFilter to handle CTM for backdrop filtering
The DrawDeviceWithFilter function used to rely on SkImageFilter's
applyCTMForBackdrop, which would create a new DAG and use an
SkMatrixImageFilter node to account for the transformation. However,
that filter is really meant to perform a transformation prior to the
CTM matrix. Abusing matrix math to instead have it map the backdrop
contents back into the CTM local space grossly inflated the size of the
temporary images needed when under many perspective transforms.

This CL instead takes over control of the CTM decomposition and draws
the backdrop (src) content into a temporary layer directly, and then
feeds that through the image filtering. The code is somewhat cumbersome
to follow because of the combination of coordinate spaces and need to
make everything relative to the top left corner of the images.

When the rest of my image filter refactor is more underway, I believe that
a lot of the coordinate space math and image origin accounting will
be much cleaner, but the overall backdrop filtering strategy would remain
similar to this new implementation.

Bug: skia:9074
Change-Id: Ibd2995e81d2b308c74b2d298da5e38daa74c8677
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239108
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-09-05 16:35:18 +00:00
Julia Lavrova
526df26b03 Reshuffling bidi regions + empty text sizes + some font resolution bugs
Change-Id: Icc0d688985de7253f3113e5c9657544f68b4e01d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/236217
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-09-04 20:42:15 +00:00
Hal Canary
b1f411ac05 tools/skui: put all enums in a common namespace
Change-Id: Icd331e8946d80652750b8b6ea0db65f5f676ac3e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/238058
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2019-08-29 15:39:32 +00:00
Mike Reed
92b33354dd more rect api simplifications
set --> setLTRB
set(pts, count) --> setBounds

Bug: skia:9328
Change-Id: I807c0598a8b23b2f721db118ec41c1607114205a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237038
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-08-25 10:12:57 +00:00
Mike Reed
9ea6315692 remove redundant rect methods
Bug: skia:9328
Change-Id: Idc20e125a4a4725c88e291b49e33cc56805836ae
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235832
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-08-23 17:49:27 +00:00
Brian Salomon
bf6b9795f6 GrSurfaceContext not ref counted.
Also don't specify redundant width/height to SkGpuDevice.

Change-Id: I389df5c4b073c2c05632ba6b7c95b02a22dfaf98
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235824
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-08-21 15:31:23 +00:00
Ben Wagner
ad9a3919d1 Move initilization of Lighting sample.
This Sample is asserting on resource loading in the constructor. Delay
this to onOnceBeforeDraw to improve startup and debugging.

Change-Id: Ic341d5599a95b682bcb018b1a40b8789d6f8b51f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/233419
Auto-Submit: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
2019-08-09 20:42:39 +00:00
Julia Lavrova
db9f669eb1 Dealing with ghost spaces
Change-Id: I9cf133e915658f17d00f279ee1fa2662effa2021
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/231646
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Julia Lavrova <jlavrova@google.com>
2019-08-09 18:56:13 +00:00
Julia Lavrova
b7b0b3ad53 Paragraph cache: caching the shaped results only.
That makes layout phase 10 times faster (since the shaping takes 90% of it).

LRU cache is attached to the FontCollection object and has the same life time.
Currently it has hardcoded limit on the entry numbers (128).
One the number reached, the least recently used element is removed from the cache
to free the space for a new one.

Change-Id: I597e334422614e33715d7a9ed13acf7b1f9cd0e4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230755
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Julia Lavrova <jlavrova@google.com>
2019-08-09 16:51:41 +00:00
Hal Canary
bcfed55a8c experimental/editor: mouse drag select, modifierkeys cleanup.
Change-Id: I8c8de54ad6309424bdf18987ccf3eac6bdd41c19
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/233080
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-08-08 02:33:44 +00:00
Jim Van Verth
220988189b Add adjustable max size for Metal dynamic allocation ring buffer.
Maximum ring buffer size is based on the maxBufferLength of
the system. Also includes a sample for testing upload pressure.

Bug: skia:8243
Change-Id: I36863b725ba9cbcb02d575b2ab9695d186fcd529
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/232759
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2019-08-07 15:59:42 +00:00
Michael Ludwig
8ee6cf3691 Move SkImageFilter functionality into private SkImageFilter_Base
Bug: skia:9281
Change-Id: I189dbf652580805641f8c4b9a6587cf15a9049dd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/231256
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-08-02 18:56:39 +00:00
Michael Ludwig
a861106e49 Update docs and samplecode to use new image filter factories
Bug: skia:9280
Change-Id: I03ba9bf1cc952dec77664721fdb3a311f47f7e89
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230884
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
2019-08-02 14:47:35 +00:00
Mike Reed
9dc0b9e2f8 remove code now that loopers are dead (w.r.t. canvas and paint)
We can't remove the loopers themselves, as they are still used
by android and chrome (they just don't ever pass them to skia).

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

Bug: skia:4783
Change-Id: I5f507e6bb82280f2bc7c0b21eebe59c287aa9265
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230579
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2019-07-30 12:49:28 +00:00
Mike Klein
52337de95c re-run tools/rewrite_includes.py
PS2 adds a rewrite for Skia #include <...> to #include "...", letting
them be otherwise rewritten and sorted too.  (We do need one exception
for the Vulkan headers, which will otherwise be rewritten to always
point to our own.)  I don't think it's particularly important to
favor "" or <>, but picking one keeps things consistent.

PS3 adds a missing SkMutex.h include.

PS4 fixes a terrible readability problem.

Change-Id: Id9fe752727ef30e802b1daf755ee2ed15e267577
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229742
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-07-25 15:40:33 +00:00
Mike Reed
21a940d42f refactor paragraph samples
Change-Id: Ibcd93ccd2eef17728b0d2f0fb9f55b91cda93f3a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229282
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-07-23 14:45:09 +00:00
Julia Lavrova
5207f35f33 The current version...
Adding cache
Caching shaped results
Base+Index for referencing arrays
The very first and naive version of cache
Cache measurement, lines and picture
Added text blob cache for lines
Removed Run* from Cluster
Removed const char* from Cluster and Run
Few minor changes

Change-Id: I444a1defa950aed5999cfa1c3545fd83ccb54ce9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227840
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-07-23 13:31:39 +00:00
Mike Reed
b7dad44040 Reland "hide drawlooper from paint"
This reverts commit 6dc14ded91.

Reason for revert: add flag to google3

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

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

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

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

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

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

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

Change-Id: I1d0ad1683a2e8345d8ea13db9b69b568ada827dc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228573
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2019-07-22 16:25:41 +00:00
Chris Dalton
c3318f09cd ccpr: Add an MSAA atlas mode
Adds the option to use a multisampled (or mixed sampled) atlas, and
uses the sample mask and stencil buffer instead of coverage counts.

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

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

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

Bug: skia:7211
Change-Id: If14570afb4189cebc75f3815e8ccdde05cb074e1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228438
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-07-19 15:41:11 +00:00
Michael Ludwig
4a412aca07 Improve image-filter sample layout/rendering
This tweaks the colors of the filterBounds boxes that are drawn.
It switches DAG layout to be left-to-right instead of top-down.
Visualizes node results/bounds in the local filter space instead of
transforming into the final space.
Improves the source content so that the different branches of the filter
DAG have more meaningful differences.

Change-Id: Icca586dcbcc3156e13f9689ee19af9c03a0ed1eb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228059
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-07-17 21:55:59 +00:00
Michael Ludwig
43c6da2a15 First pass at ImageFilter DAG visualizer sample
Change-Id: I04493af0a6ce1425c4acf68365135722dd3c218b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227857
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-07-17 20:59:37 +00:00
Hal Canary
d7639aff10 Samples: clean up cruft
- replace virtual with override.
  - remove default constructor.
  - use default field initializers
  - move work from constructor into onOnceBeforeDraw
  - mark everything private
  - enum { N = 100 }; constants to constexpr
  - remove unused variables

Change-Id: I8c7a19bc24fec416a6b88d634ee948d3e842b986
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228056
Commit-Queue: Ben Wagner <bungeman@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-07-17 18:29:50 +00:00
Hal Canary
e574f1e409 [reland] SkMetaData: move from src/ to tools/
Original: https://skia-review.googlesource.com/c/skia/+/227436
Change-Id: Iec326027319f39b0402e1b5c03b327cb26249159
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227778
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2019-07-17 13:14:38 +00:00
Hal Canary
ff2e8fe65f sk_app, Sample: Unify InputState enum.
replace() {
      if git grep -q "$1")";
      then sed -i -e "s#${1}#${2}#g" $(git grep -l "$1");
      fi
    }
    replace 'k\([A-Za-z]*\)_InputState' 'InputState::k\1'
    replace '\(\(sk_app::\|\)Window\|Sample\|\)::InputState' 'InputState'

Change-Id: I4cc18814fb1fbdd1f240aabba05aae79c54a4841
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227642
Commit-Queue: Hal Canary <halcanary@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-07-16 14:51:03 +00:00
Hal Canary
0afbd9f5f9 Samle:🐭 fix wrong assert
Change-Id: Ifa17d524f4505514ed02716214e408fdda3ac3e8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227641
Reviewed-by: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2019-07-16 14:12:36 +00:00
Greg Daniel
12e7585495 Revert "SkMetaData: move from src/ to tools/"
This reverts commit 9d844d8ce5.

Reason for revert: breaking google3

Original change's description:
> SkMetaData: move from src/ to tools/
> 
> Change-Id: If581c8ceeaa76985535cb7b6772742f0011cfe8e
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227436
> Commit-Queue: Hal Canary <halcanary@google.com>
> Commit-Queue: Ben Wagner <bungeman@google.com>
> Auto-Submit: Hal Canary <halcanary@google.com>
> Reviewed-by: Ben Wagner <bungeman@google.com>

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

Change-Id: Ifadad46f0663b743d3e57bb6317707f2a2fac07d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227636
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-07-16 00:28:44 +00:00
Hal Canary
9d844d8ce5 SkMetaData: move from src/ to tools/
Change-Id: If581c8ceeaa76985535cb7b6772742f0011cfe8e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227436
Commit-Queue: Hal Canary <halcanary@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-07-15 18:45:09 +00:00
Hal Canary
fcf6359ce8 Sample not RefCnted; ClickHandling moved out of viewer
Change-Id: I23456144b267192928a1253692daf846329f2ab5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227067
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2019-07-15 17:59:15 +00:00
Ben Wagner
acf98df7a1 Remove WallTimer class.
Only used in three somewhat dubious places.

Change-Id: I7ccd1aef41f826d0eb62606751f4d3f0ceda267d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227065
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-07-15 16:06:11 +00:00
Hal Canary
8918d532ab Sample/AAGeometry: stop leaking linked list
Change-Id: I8bba87244becf1352e713c08aee355ebbd83e45f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227058
Auto-Submit: Hal Canary <halcanary@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-07-12 15:06:00 +00:00
Hal Canary
41248071ac tools: separate TimeUtils from AnimTimer
gm, slides, and samples no longer need to know about the implementation
details of AnimTimer.

This
    virtual bool onAnimate(const AnimTimer&);
becomes this:
    virtual bool onAnimate(double /*nanoseconds*/);
which is much easier to reason about.

AnimTimer itself is now part of viewer.

Change-Id: Ib70bf7a0798b1991f25204ae84f70463cdbeb358
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/226838
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2019-07-12 15:05:01 +00:00
Hal Canary
455c41a014 Sample/Camera: make it work without /skimages
Change-Id: I7e876ffb7e59ccedb3da80ef3cd5ca385ab89873
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/225547
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2019-07-11 14:22:51 +00:00
Julia Lavrova
35f88226bb Adding locale
Change-Id: I4f118f37a1226f4259d0e5be3b6b557b38b3b316
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/222785
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-07-09 20:55:51 +00:00
Hal Canary
3a85ed12bf ModifierKey unifies sk_app::Window::ModifierKey & Sample::Click::ModifierKey
Change-Id: Idb5dfe57a7f6e3d6078ab1e68d542b084114cfbe
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/225735
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-07-09 16:16:41 +00:00
Hal Canary
352f0917a3 Sample/Shaders: use resources; cleanup code
Change-Id: Icd71734927ebb50c8db55730107deb29faf0c61a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/225716
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-07-08 19:31:42 +00:00
Hal Canary
a1e88e7fb3 Sample/Lines remove boring sample
Change-Id: I8d266641d283af298a5d44b2889d4fdd4173aeee
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/225722
Auto-Submit: Hal Canary <halcanary@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-07-08 19:09:43 +00:00
Hal Canary
6cc65e1fda Samples: simplify Sample::Event
Change-Id: I1daaa9dcf56812bfd29dab64ee04dae63c2660e1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/225545
Commit-Queue: Ben Wagner <bungeman@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-07-08 19:09:42 +00:00
Hal Canary
5f4a754ea6 Sample/Patch: use resources; cleanup code
Change-Id: I8450193a6033e8b4262c1f23929a9b3d964a785a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/225550
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-07-08 17:50:05 +00:00
Hal Canary
b021f3e3fb Sample/Filter2View: make it work without /skimages
Change-Id: I8958e026ca9e2c5a6c99a7a1cd1ec97088c25fe9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/225548
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-07-08 17:05:23 +00:00
Hal Canary
8010c17dc1 SamplePdfFileViewer: delete dead code
Change-Id: I4ba5f22e4370665699546c82f0948a14f9396526
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/225543
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2019-07-03 20:15:44 +00:00
Hal Canary
8a027312cd Samples: add name() virtual
Change-Id: I9b6e39bc7e35346bb73dfe014de1c8daa5a92f2a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/225428
Auto-Submit: Hal Canary <halcanary@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-07-03 17:41:16 +00:00
Brian Salomon
27ae52c6f4 Make deferred render target context without config or format
config is completely redundant. No caller really cares what the backend
format is.

Change-Id: I93f1feb3ee61db6c21b7915bab3ee3fba5656f92
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/225194
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-07-03 16:53:48 +00:00
Brian Salomon
d628747dfb Make GrColorSpaceInfo store GrColorType.
This is largely redundant with GrPixelConfig. However, we intend to
remove GrPixelConfig.

Bug: skia:7580

Change-Id: I03d92303be832711f7821f8a97d36387c9b04a9f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/222883
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-06-25 14:29:09 +00:00
Chris Dalton
6ce447a4ec Eliminate mixed samples as an FBO type or AA type
From now on, sample counts always refer to the number of actual color
samples, and render targets don't have separate color and stencil
sample counts.

If mixed samples support is available when making a
"GrAAType::kCoverage" draw, then an op may attach and use a mixed
sampled stencil buffer internally. But this will all be invisible to
the client.

After this CL, we temporarily won't have a mode to use nvpr with mixed
samples. That will soon be fixed by a follow-on CL that enables nvpr
with mixed samples in the normal "gl" and "gles" configs.

Bug: skia:
Change-Id: I1cb8277f0d2d0d371f24bb9f39cd473ed5c5c83b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221878
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-06-24 04:08:45 +00:00
Julia Lavrova
9af5cc4d98 Adding TestFontCollection
Change-Id: I43c20616dd842e9ffeaac614c853be4702a819a7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/222104
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-06-20 20:42:46 +00:00
Greg Daniel
2c3398dc26 Switch from querying swizzle on caps to using swizzles stored on proxies.
Change-Id: I03f4a3affd6dda7a83bee8eec768dcaa93a6b801
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/220534
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2019-06-20 13:38:05 +00:00
Julia Lavrova
6e6333fba4 Refactor font resolution out of font iterator;
few minor bug fixes

Change-Id: Ibc60e972480f3503965af873f36001ed233382ec
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221544
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2019-06-18 19:23:33 +00:00
Greg Daniel
f91aeb259e Move a bunch of gpu files out of include/private and into src/gpu.
In GrRecordingContext I moved the auditTrail onto the heap and only there
when compiling for tests. This allowed us to move a lot of files out of
include private.

Change-Id: Ib76ac211c0c6fd10bacaccf0c5f93f21a59f35d5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221344
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Auto-Submit: Greg Daniel <egdaniel@google.com>
2019-06-18 14:24:42 +00:00
Julia Lavrova
f39124b076 Baseline for empty text
Change-Id: I7c172bfb8f35f684030489f75cd997acdbbe3a75
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/220298
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2019-06-11 21:49:49 +00:00
Julia Lavrova
a3552c5e6d Reland "SkParagraph"
This is a reland of 10ad0b9b01

Original change's description:
> SkParagraph
>
> Change-Id: I0a4be75fd0c18021c201bcc1edfdfad8556edeff
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/192100
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Julia Lavrova <jlavrova@google.com>

Change-Id: I46cf43eae693edf68e45345acd0eb39e04e02bfc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/219863
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2019-06-11 17:20:36 +00:00
Herb Derby
07cd38dc13 Revert "SkParagraph"
This reverts commit 10ad0b9b01.

Reason for revert: Breaks google3 build

Original change's description:
> SkParagraph
> 
> Change-Id: I0a4be75fd0c18021c201bcc1edfdfad8556edeff
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/192100
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Julia Lavrova <jlavrova@google.com>

TBR=borenet@google.com,djsollen@google.com,halcanary@google.com,bungeman@google.com,kjlubick@google.com,reed@google.com,drott@chromium.org,jlavrova@google.com

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

Change-Id: I3f4ef2f34b7489d008c2fe92527d39fba0e16ff7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/219858
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-06-10 13:16:53 +00:00
Julia Lavrova
10ad0b9b01 SkParagraph
Change-Id: I0a4be75fd0c18021c201bcc1edfdfad8556edeff
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/192100
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2019-06-07 17:23:23 +00:00
Ben Wagner
2b4dcd381c Remove duplicate simple samples, make one a gm.
SampleBigBlur is super simple and now covered by gms and AnimBlur
sample.

SampleBigGradient now has a gm shallow_gradient_linear.

SampleConcavePaths has a more complete gm concavepaths.

SamplePoints now has an almost exact gm.

RasterAllocatorSample is made into a gm so that it will be run by d. It
appears to be the only test of SkRasterHandleAllocator, so it should
probably run.

Change-Id: Iad7b99d0f92898fc4b2fdccc5aae35d0277f2fff
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/219400
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-06-07 01:39:32 +00:00
Herb Derby
ac7182773e Make FindOrCreateStrikeWithNoDeviceExclusive analog for SkStrikeSpec
Add MakeWithNoDevice to avoid the threshold of converting to
paths when using MakeCanonicalized.

Change-Id: I73b49dd35ffb2f4fa3b70ba3324bfcb348ca913b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/218960
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-06-07 01:29:21 +00:00
Herb Derby
36a54c1b1a Rename SkStrikeSpecStorage -> SkStrikeSpec
SkStrikeSpecStorage was a temporary name until all uses of
SkStrikeSpec were cleaned up. Do the final rename.

Change-Id: Iaba987ecdfe46ca9eee8d530d5095840cdca300d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/219209
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-06-06 18:01:02 +00:00
Michael Ludwig
de4c58cbac Combine GrPerspQuad and GrQuad
Also moves GrQuadType to an inner enum of GrQuad as GrQuad::Type.
Renames some of the types for improved clarity (IMO)

Change-Id: I2c91d60374d2b7c414034e9fe0b0113a794bd610
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/216604
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-06-05 14:42:21 +00:00
Herb Derby
baf64786ba Convert over more sites to SkStrikeSpecStorage, and remove unused calls
Convert over remaining callsights for strike lookup, and reduce the SkStrikeCache
API.

- one friend decl.

Change-Id: I109a747061030f26ff908472ea55a4424d5c10f1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209109
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-06-04 14:11:45 +00:00
Michael Ludwig
663afe501a Move GrPathUtils, GrRect, and GrShape into src/gpu/geometry/
Change-Id: I864d3c2452f3affdc744bf8b11ed3b3e37d6d922
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/216602
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-06-04 13:36:05 +00:00
Michael Ludwig
fd4f4df3ea Move GrQuad to src/gpu/geometry folder
Change-Id: I3d1b8e8268c2cd0d1ceec93c847069494b9aa965
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/216601
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-05-31 19:56:59 +00:00
Brian Osman
c6568afa0b Remove Nima from DEPS, experiments, Viewer, etc.
Change-Id: Ide69d3c9f0f02e886bd0d52723d425a548edd2e0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/214187
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-05-16 17:02:11 +00:00
Ben Wagner
51e15a69ce Use SkTextEncoding enum instead of macros.
Change-Id: I4b6259590fa0693ee0522b4999a1c0fe250b173d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/212504
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-05-07 20:54:16 +00:00
Mike Reed
e869a1ed96 stop calling legacy 255-biased colormatrix
... but keep the apis for now

Bug: skia:4872
Bug: skia:9012
Change-Id: I3a9b0c9194be6897c0e59b7edd972b7218168183
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/211343
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-04-30 16:59:36 +00:00
Michael Ludwig
d3aeecd010 Visualize geometry domains in degenerate quad sample
Change-Id: Iba2d376fedfa2fd2258bc0d0f50038a426f9d290
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/210423
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-04-26 14:13:47 +00:00
Mike Klein
c0bd9f9fe5 rewrite includes to not need so much -Ifoo
Current strategy: everything from the top

Things to look at first are the manual changes:

   - added tools/rewrite_includes.py
   - removed -Idirectives from BUILD.gn
   - various compile.sh simplifications
   - tweak tools/embed_resources.py
   - update gn/find_headers.py to write paths from the top
   - update gn/gn_to_bp.py SkUserConfig.h layout
     so that #include "include/config/SkUserConfig.h" always
     gets the header we want.

No-Presubmit: true
Change-Id: I73a4b181654e0e38d229bc456c0d0854bae3363e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209706
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-04-24 16:27:11 +00:00
Mike Klein
4941a2239e switch some idiosyncratic <includes> to ""
Change-Id: I099f8a635df7dd0ddd3902459615250ea2c120c5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209874
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-04-23 17:54:48 +00:00
Jim Van Verth
7a7a97d3c7 Make Metal render loop more stable
Bug: skia:8737
Change-Id: Ib825e5f0c9502692cbecc60fbb68d0d1a2bc635f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/208672
Auto-Submit: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-04-17 14:41:11 +00:00
Mike Reed
e3f17b911f remove SkMixer, since we have explicit lerps/blends in SkShader
Change-Id: I937861df9d8ae89c0587ea59dd740989bebd35a4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/207305
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-04-10 20:59:30 +00:00
Mike Reed
c8bea7deb6 New factories for SkShaders
Bug: skia:8937
Change-Id: Ic253b70fbf89059321185912aa771b1c1de7d231
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206693
Reviewed-by: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-04-09 19:15:01 +00:00
Mike Reed
b286bc2da8 Introduce new factory for SkColorFilters
Idea: transition callers to this, so we can later typedef SkColorFilter
and SkShader to the same thing.

Bug: skia:8937
Change-Id: I000c882e11622091aa44c141aa6ddd1216414f46
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206685
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-04-08 21:03:59 +00:00
Mike Reed
50acf8f04b add makeShader() to SkBitmap, and deprecate SkShader version
Bug: skia:8937
Change-Id: I42f011e04937a751222bd8ecc6c69b45cf9626a2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206681
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2019-04-08 17:56:34 +00:00
Mike Reed
fae8fceb4a Use SkTileMode instead of nested enum
Add guard to transition clients

Change-Id: Ia7a3e8f95722f91e84af262168dadf89a78707da
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205720
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-04-03 15:24:18 +00:00
Brian Osman
47ba54d382 Remove samples that aren't built
Change-Id: Ied09d28149cdb38ab1b4a4b704c993a726324220
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205488
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-04-02 18:07:18 +00:00
Brian Osman
4428f2c39f Remove SkScalarSinCos
This differed from the separate versions in that it snapped to zero.
It was also strictly worse than calling the two separate versions.
Most clients don't need the snapping, so just call the two existing
functions. For clients that need the snapping, call new variants of
each that do snap.

Change-Id: Ia4e09fd9651932fe15caeab1399df7f6281bdc17
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205303
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-04-02 15:46:57 +00:00
Ben Wagner
3bdb69c55f Clean up shaper handler.
Change-Id: Icb741ba9013747528e893c94df3b9242562028ba
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205341
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-04-02 14:56:26 +00:00
Florin Malita
fb4bce8322 [sksg] Refactor gradient implementation
Currently, gradients are PaintNode subclasses - which limits their
applicability to leaf DAG nodes.

In order to support generalized gradient/shader effects:

  * introduce a new Shader base class
  * refactor gradients as Shader subclasses
  * introduce ShaderPaint (to support current Gradient-as-paint use)
  * introduce ShaderEffect (to support future Gradient-as-effect use)

Tangentially:

  * rename SkSGPaintNode.h -> SkSGPaint.h
  * consolidate sksg::Color into SkSGPaint.h

Change-Id: I94ba949f4504c09cfde4a4f030d927411fdd66a2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205263
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-04-01 18:43:43 +00:00
Mike Reed
5ee611b26f Add sample to show strokeandfill and better alternatives
Change-Id: Ib4efd6ecc8d9dda67d6032405779c02c402b370d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205121
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-04-01 03:11:16 +00:00
Chris Dalton
2c5e01104f Split GrCCCoverageProcessor into subclasses
Makes separate subclasses for geometry and vertex shaders.

Bug: skia:
Change-Id: Ifced79af3092090a71d03fe252fb4da76738cf08
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/204545
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-03-29 18:59:43 +00:00
Mike Klein
cd5104e942 SkAnimTimer -> AnimTimer
Change-Id: I700b7c0461475062ac66712cc29070f150cf777d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/202315
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-20 18:26:35 +00:00
Mike Klein
ea3f014e2b sk_tool_utils -> ToolUtils, and git clang-format
sk_tool_utils doesn't really fit the naming convention
the rest of code under tools/ tends to use.

Change-Id: I45326a174101c6eb4b6149e9c742f658f2fd23b1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/202313
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-20 18:05:42 +00:00
Mike Reed
79a7542081 allow mixer to defer to a shader
- reverse sense of Blend mixer to be (dst, src, mode)
- change pipeline register convention to be (dst, src)

Bug: skia:
Change-Id: I1f1d990001ad941cb8d44e1488c5f14077e181f8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201386
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-03-15 20:24:21 +00:00
Brian Osman
5ced0bfd00 Add shader based blending of kPlus for configs that need clamping
This effectively reverts https://skia-review.googlesource.com/c/skia/+/140500
and relands https://skia-review.googlesource.com/c/skia/+/48183.

Bug: skia:8871
Change-Id: I6b1d5daa3d319e0c078e553926ed9166cca9a24a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199930
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-03-15 14:54:17 +00:00
Michael Ludwig
e6266a2d16 Handle arbitrary and degenerate quadrilaterals in GrQuadPerEdgeAA
Updates the handling of perspective quads to calculate the correct,
degenerate-safe projected quad and then derive from that the proper
perspective quad.

In 2D, updated to determine if the optimized outset/inset procedure
is valid, and if not goes through a more robust procedure that is
based on line equation intersections. In particular, the degenerate
inset/outset approach is used when the quad has a zero-length edge,
if insetting/outsetting normally would create a self-intersecting shape,
or if near parallel edge angles would create numerical instabilities.

Performance testing by forcing all rectangle draws through the degenerate
code path suggests that it is about 10% slower than the optimal approach,
at least on my workstation...

Bug: skia:
Change-Id: I2973da8d97949eacebb09a1b27c334d62c1c948e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/194008
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-03-11 20:04:03 +00:00
Mike Reed
ca9b2082d1 rename mixer to lerp (in prep for SkMixer)
Bug: skia:
Change-Id: I55d879dd76e10c8ef9a01f2dd7cff725e8a82433
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/199932
Commit-Queue: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-03-11 19:32:31 +00:00
Chris Dalton
b8fff0dfce Make mixed samples detection automatic
Previously, we relied on ops to deduce whether a draw would have
hardware coverage modulation as a result mixed samples. This is
problematic because *any* draw can have mixed samples coverage if
there is a multisampled stencil clip. No ops were checking for stencil
clip, and most just said they never used mixed samples.

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

Bug: skia:
Change-Id: Ib69b84bc03b12f6efb8e7d6ed721ae1612785315
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197281
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-03-05 21:27:15 +00:00
Mike Reed
541ae450f4 array of unique verts
Bug: skia:
Change-Id: I883176c77d57cd58f8a0418b5fe592e300d8fa0a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197900
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-03-05 20:17:25 +00:00
Mike Reed
72542816ca add sample for retained vertices
Bug: skia:
Change-Id: I79d9aa533af3f912017b83cec59c23859a822dd9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/197241
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-03-05 15:47:03 +00:00
Ben Wagner
7465943b1e Remove fuzz samples.
We now have a real fuzzer, and these samples only run on local dev
machine anyway, so their current utility is quite low since they don't
demonstrate any specific behavior.

Bug: skia:8259
Change-Id: If44a0eaa161b1d7688dd3de6431414a84b7bd6c6
Reviewed-on: https://skia-review.googlesource.com/c/194862
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-02-25 16:55:26 +00:00
Ben Wagner
b059194c08 Make SkShaper an interface.
The interface here is not ideal, but there will need to be some build
clean-up before it can be changed.

Change-Id: Ic4d55634405f4c8d9c194e4e6f368287c9669dcd
Reviewed-on: https://skia-review.googlesource.com/c/193036
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-02-19 22:06:47 +00:00
Florin Malita
f2965060c3 add mixer colorfilter
BUG=skia:

Change-Id: Icbee96056b17c5396a9d3783055ddd0b7d4fd3ff
Reviewed-on: https://skia-review.googlesource.com/c/9514
Commit-Queue: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-02-15 19:22:33 +00:00
Ben Wagner
83597ce581 Remove typeface from SkShaper constructor.
It isn't used anymore.

Change-Id: I4079ff9944aa2483a0cd42130d0e69fb98935731
Reviewed-on: https://skia-review.googlesource.com/c/192820
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
2019-02-14 21:41:28 +00:00
Mike Reed
be89130dbf update sample-sg with hittesting
Bug: skia:
Change-Id: Ic7e9d011bd1e7b3d27d3cea9dc38f2ad65294451
Reviewed-on: https://skia-review.googlesource.com/c/191663
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2019-02-12 20:50:52 +00:00
Mike Reed
ec80d901b9 starter sample for playing with SG.
will flesh out more over time.

Bug: skia:
Change-Id: If5eaf0a7c404b9209b93871eb3ac3d74da8c65dd
Reviewed-on: https://skia-review.googlesource.com/c/191003
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2019-02-12 17:03:40 +00:00
Ben Wagner
454e5fb745 Fix cluster reporting from shaper.
Bug: skia:8420
Change-Id: I7eea8c6b3af2153a1ac1189782fc6cbaaf9ee5c6
Reviewed-on: https://skia-review.googlesource.com/c/190821
Reviewed-by: Hal Canary <halcanary@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-02-11 21:59:33 +00:00
Ben Wagner
80634eb51e Don't include .cpp file in SampleCCPRGeometry.cpp
Doing so resulted in a bunch of surprisingly duplicated symbols.

Change-Id: Ie3003122909a3b82470046256de12e27c0b23a05
Reviewed-on: https://skia-review.googlesource.com/c/190305
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-02-07 20:21:51 +00:00
Mike Reed
8619a34bb8 Revert "Hide setDrawLooper -- deprecate loopers"
This reverts commit c877ea2657.

Reason for revert: wow, this is going to be really hard to update callers

Original change's description:
> Hide setDrawLooper -- deprecate loopers
> 
> Guarded with SK_SUPPORT_LEGACY_DRAWLOOPER
> 
> Bug: skia:4783
> Change-Id: I4a47513624bc5c09816f44e107917dc8028adb94
> Reviewed-on: https://skia-review.googlesource.com/c/189871
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>
> Auto-Submit: Mike Reed <reed@google.com>

TBR=reed@google.com

Change-Id: Ia49f421c8a96a8091ab87533361fde4bf570d6e4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:4783
Reviewed-on: https://skia-review.googlesource.com/c/190303
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-02-07 19:00:36 +00:00
Brian Salomon
dbf7072a59 Use different classes for client side arrays and GPU buffer objects.
GrBuffer is a base class for GrGpuBuffer and GrCpuBuffer. GrGpuBuffer is a
GrGpuResource and the others are not. This allows GrCpuBuffers to exist
outside of the GrGpuResourceCache.

Also removes flags from GrResourceProvider buffer factory function. The
only flag still in use was kRequireGpuMemory. Now CPU buffers are made
without using GrResourceProvider.

Change-Id: I82670d1316e28fd6331ca36b26c8c4ead33846f9
Reviewed-on: https://skia-review.googlesource.com/c/188823
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-02-07 18:04:15 +00:00
Mike Reed
c877ea2657 Hide setDrawLooper -- deprecate loopers
Guarded with SK_SUPPORT_LEGACY_DRAWLOOPER

Bug: skia:4783
Change-Id: I4a47513624bc5c09816f44e107917dc8028adb94
Reviewed-on: https://skia-review.googlesource.com/c/189871
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-02-07 13:33:30 +00:00
Robert Phillips
dbaf317cd4 Move GrContextPriv methods to their own .cpp file
Centralize these for my sanity. Most will also be parceled out to other contexts.

Change-Id: If0e7e98bcf66c4d8a3391f9b04e643ccc91af4ad
Reviewed-on: https://skia-review.googlesource.com/c/189488
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-02-06 21:15:58 +00:00
Brian Salomon
ae64c194fe Convert GrBufferType to enum class, rename, and remove dead values
Renamed to GrGpuBufferType in anticipation of splitting GrBuffer
into GrGpuBuffer and GrCpuBuffer types.

There were two unused values in the enum that are removed, DrawIndirect
and Texel.

Change-Id: Icb6b3da689adbd8e10495c10fd0470a6ee0120b5
Reviewed-on: https://skia-review.googlesource.com/c/189280
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-02-05 15:04:48 +00:00
Robert Phillips
9da87e0e98 Rename GrContext::contextPriv to priv
Mechanical. This makes the priv() accessor the same for all the context types.

Change-Id: I40850eb05a33b8d7cc3eabdd42226d24b2ba58aa
Reviewed-on: https://skia-review.googlesource.com/c/189164
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-02-04 22:13:14 +00:00
Brian Salomon
9c7a006a8e Remove NoPendingIO flags from buffer creations.
Now that we're keeping refs on GrBuffers during flush, we shouldn't
need to specify this flag.

Change-Id: Idbe08e84d23690d6c9e94f23f2c4507a2e965aff
Reviewed-on: https://skia-review.googlesource.com/c/188635
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-02-03 16:59:43 +00:00
Mike Reed
5892553ad0 delete orphaned sample
Bug: skia:
Change-Id: I50b832d742ecf08fe8a851b556ba1ca862c24d3c
Reviewed-on: https://skia-review.googlesource.com/c/188025
Reviewed-by: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2019-02-01 15:23:43 +00:00
Mike Reed
fdb876d4ee remove breakText, and all utf cache accessors
Bug: skia:
Change-Id: Ib7219e0844a4401f12f89d91eab60dbb7dda0121
Reviewed-on: https://skia-review.googlesource.com/c/188580
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-02-01 15:20:23 +00:00
Robert Phillips
d0fe875455 Remove destination GrRenderTargetProxy from GrPipeline
Change-Id: Ie2ee3d51220163fde8a959255dd5f6cce4e27ad8
Reviewed-on: https://skia-review.googlesource.com/c/188038
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-02-01 13:36:53 +00:00
Michael Ludwig
d20cf33472 Add new thin anti-aliasing demo
Bug: skia:
Change-Id: I3c29dee38f6fb43a2d1d5d429193fcf4a719a2cb
Reviewed-on: https://skia-review.googlesource.com/c/186863
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-01-31 14:55:52 +00:00
Robert Phillips
4217ea7ee5 Add outline of new GrContext hierarchy
This begins the process of splitting GrContext into:

GrContext_Base, GrImageContext, GrRecordingContext and GrDirectContext.

Change-Id: I3c43045f2a5549b049e95791d65f74d4e16de36f
Reviewed-on: https://skia-review.googlesource.com/c/186878
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-01-30 18:36:11 +00:00
Brian Salomon
12d2264c26 Convert GrBuffer owners to sk_sp
Change-Id: Id49d775c30f01f4de05f385227c5ed5d90d6839e
Reviewed-on: https://skia-review.googlesource.com/c/187920
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2019-01-29 21:11:27 +00:00
Mike Reed
9cd2a5c6ba IWYU
fissioned from https://skia-review.googlesource.com/c/skia/+/185460

Bug: skia:
Change-Id: I92857df460ffec402101bfa4c90678db889ea9c5
Reviewed-on: https://skia-review.googlesource.com/c/185697
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-01-22 20:48:15 +00:00
Chris Dalton
4b62aed973 Return GrProcessorSet::Analysis from GrDrawOp::finalize
Bug: skia:8671
Change-Id: Ib35d1642659021419f408bf19b1b0dc0066e8df2
Reviewed-on: https://skia-review.googlesource.com/c/184160
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-01-16 21:22:38 +00:00
Herb Derby
5fd955e36d Rename SkGlyphCache -> SkStrike
Change-Id: I51ca9f61feb0d4f7352ed634b7070327f31ccf05
Reviewed-on: https://skia-review.googlesource.com/c/184400
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-01-16 18:28:28 +00:00
Florin Malita
950243df0e Hack up SkShaper to pass additional callback info
- rename LineHandler -> RunHandler (since it gets called per run)
- pass additionl run info:

  * line index
  * cumulative advance
  * ascent/descent/leading

Bug: skia:
Change-Id: Ie848e5a35243088b99989c73fdec44c6a1bdd051
Reviewed-on: https://skia-review.googlesource.com/c/183300
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-01-11 17:04:26 +00:00
Hal Canary
a70ae1a70f drawText Cleanup, part 5
Change-Id: I2e6cb63839ec9c6f9d5b829505472f97b076a82c
Reviewed-on: https://skia-review.googlesource.com/c/182260
Auto-Submit: Hal Canary <halcanary@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-01-09 16:10:30 +00:00
Hal Canary
4484b8f1e3 drawText Cleanup, part 4
Change-Id: I2b48b6f507fe567cf44836c8755871c2a2f61ec0
Reviewed-on: https://skia-review.googlesource.com/c/182220
Auto-Submit: Hal Canary <halcanary@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-01-09 16:06:13 +00:00
Hal Canary
89a644b635 sed s/drawSimpleText/drawString/
for f in $(git grep -l drawSimpleText); do
    sed -i 's/wSimpleText(\([[:alnum:]]\), strlen(\1), kUTF8_SkTextEncoding,/wString(\1,/g' "$f"
    sed -i 's/wSimpleText(\([[:alnum:]]*\)\.c_str(), \1\.size(), kUTF8_SkTextEncoding,/wString(\1,/g' "$f"
done
git checkout @~ include/core/SkCanvas.h samplecode/SampleCusp.cpp
git cl format

Change-Id: Ibc0c3afd30f86465a645fadb26177d61919f57fd
Reviewed-on: https://skia-review.googlesource.com/c/181561
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
2019-01-08 19:50:09 +00:00
Mike Reed
023403ba99 hide setTextEncoding
Bug: skia:
Change-Id: Ia9d3acadc1ef8a9b3c175dba501a5324179d27e9
Reviewed-on: https://skia-review.googlesource.com/c/181566
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-01-07 18:34:55 +00:00
Mike Reed
b579f07110 change textutils to require font param
Bug: skia:
Change-Id: I8ba252e3fc5c0970fd9d83f73c32b68f3c68452e
Reviewed-on: https://skia-review.googlesource.com/c/180771
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-01-03 21:11:52 +00:00
Mike Reed
89126e4550 use drawSimpleText
Bug: skia:
Change-Id: I4aa6190e66478595a409f93a406fd42f19394302
Reviewed-on: https://skia-review.googlesource.com/c/180927
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-01-03 18:27:23 +00:00
Mike Reed
919191365b use font instead of paint for text
Bug: skia:
Change-Id: I508ecbd6c4dad41f67f5f2ce6da6c0065dacba6c
Reviewed-on: https://skia-review.googlesource.com/c/180365
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-01-02 17:45:30 +00:00
Mike Reed
f78b7ea945 don't use paint's gettextpath
Bug: skia:
Change-Id: I8ad0b924195f46a29b095e85a8c0573912f0045d
Reviewed-on: https://skia-review.googlesource.com/c/179986
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2018-12-26 03:32:31 +00:00
Mike Reed
212e9060ed don't use drawPosText
Skia can now build if we mark drawPosText as private,
Will hide/remove next (after Chrome CL)

Bug: skia:
Change-Id: I156560b025c119af302545bb5bd60678f7b8e8f7
Reviewed-on: https://skia-review.googlesource.com/c/179985
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2018-12-25 23:07:35 +00:00
Mike Reed
12a6d452b1 use font for measuring
Bug: skia:
Change-Id: I451c61d5b98cb42440a4eaa889d9404638a72f5c
Reviewed-on: https://skia-review.googlesource.com/c/179980
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-12-22 12:23:07 +00:00
Florin Malita
9867f61160 SkShaper per-line callback
Tweak SkShaper to call out for each line, instead of bundling everything
as a text blob.

Change-Id: Ic522f88afcf31cefd873dc8b5cde1ac2e107c64f
Reviewed-on: https://skia-review.googlesource.com/c/176592
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-12-12 17:54:12 +00:00
Ben Wagner
ee4db8eb59 Move Arc sample to onOnceBeforeDraw.
Doing work in the constructor makes it difficult to debug other tests.

Change-Id: I0aabd031ce7caf492cde6e7d32be7586c7f0b9d3
Reviewed-on: https://skia-review.googlesource.com/c/173767
Auto-Submit: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2018-12-05 05:17:40 +00:00
Mike Reed
97f3cc2085 flag to convert to SkTextEncoding
Bug: skia:
Change-Id: I9628bcabc5c6f902b79009e4f21badff3e8cca94
Reviewed-on: https://skia-review.googlesource.com/c/173980
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2018-12-03 15:20:36 +00:00
Brian Salomon
2335644771 Fix occurrences of "-Wextra-semi-stmt"
Docs-Preview: https://skia.org/?cl=173761
Change-Id: Iefdb91cd28eabb4b01b7b42a4f300b0b4caf05d9
Reviewed-on: https://skia-review.googlesource.com/c/173761
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-11-30 23:23:09 +00:00
Ben Wagner
06602e7b73 Remove FontScalerTest sample.
This sample has had a gm counterpart for a long time now, and is also full
of dead code. It isn't adding anything to our understanding of Skia, so
remove it.

Change-Id: I6f3b0ff454b603815d66480ec11c8426717578be
Reviewed-on: https://skia-review.googlesource.com/c/173764
Commit-Queue: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Auto-Submit: Ben Wagner <bungeman@google.com>
2018-11-30 21:30:34 +00:00
Mike Reed
32c6066ea8 Force clients to specify font when requesting strikecache
Bug: skia:
Change-Id: If56222039239df085d6c40e835060e91fe70940b
Reviewed-on: https://skia-review.googlesource.com/c/173166
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-11-28 16:14:02 +00:00
Hal Canary
2a1848d2aa SkShaper->SkFont
Change-Id: I6293f08c426650e3d1da8b2f94a81f7b0a65e8a3
Reviewed-on: https://skia-review.googlesource.com/c/172969
Commit-Queue: Ben Wagner <bungeman@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2018-11-27 18:53:32 +00:00
Greg Daniel
4065d45d2d Reland "Reland "Have a GrBackendFormat be stored on gpu proxies.""
This is a reland of 2f9a5ea639

Original change's description:
> Reland "Have a GrBackendFormat be stored on gpu proxies."
> 
> This reverts commit 919c9e77c3.
> 
> Reason for revert: Flutter change has landed and fixed memory issue.
> 
> Original change's description:
> > Revert "Have a GrBackendFormat be stored on gpu proxies."
> >
> > This reverts commit 51b1c12bbc.
> >
> > Reason for revert: reverting till flutter gets to 1.1 to fix build issues.
> >
> > Original change's description:
> > > Have a GrBackendFormat be stored on gpu proxies.
> > >
> > > Bug: skia:
> > > Change-Id: Iaf1fb24ab29a61d44e5fa59a5e0867ed02dcda90
> > > Reviewed-on: https://skia-review.googlesource.com/c/168021
> > > Reviewed-by: Brian Osman <brianosman@google.com>
> > > Commit-Queue: Greg Daniel <egdaniel@google.com>
> >
> > TBR=egdaniel@google.com,bsalomon@google.com,brianosman@google.com
> >
> > Change-Id: I574fdc084ef5994596c51fb0d60423b5dc01b885
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Bug: chromium:903701 chromium:903756
> > Reviewed-on: https://skia-review.googlesource.com/c/169835
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > Reviewed-by: Greg Daniel <egdaniel@google.com>
> 
> TBR=egdaniel@google.com,bsalomon@google.com,brianosman@google.com
> 
> Change-Id: Ifd9b6b8e194af9fb9258fa626644e76e6ecf090d
> Bug: chromium:903701 chromium:903756
> Reviewed-on: https://skia-review.googlesource.com/c/170104
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

Bug: chromium:903701 chromium:903756
Change-Id: Id1360067d8e928b0a4e1848dae8bc1e7f1994403
Reviewed-on: https://skia-review.googlesource.com/c/171660
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-11-19 18:51:07 +00:00
Brian Salomon
588cec7f91 Reenable GrOp chaining.
GrRenderTargetOpList maintains an array of op chains. When it receives a
new op it tries to add it to an existing chain, working backwards from
the end of the current array. If the op can be added to a chain it
additionally tries to merge the new op with ops already in the chain
before adding it to the tail of the chain.

In forward combining it tries to concatenate chains. If chains can
concatenate it also attempts to merge ops between the two chains.

Now op chaining results reported by Op subclasses must be transitive.
Moreover, if op A is able to merge with B then it must be the case that
any op that can chain with A will either merge or chain with any op that
can chain to B.

Bug: skia:8491

Change-Id: Ib6a2a669acd4257134a37d271289b8b3f247cd3f
Reviewed-on: https://skia-review.googlesource.com/c/170351
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-11-14 19:20:59 +00:00
Greg Daniel
d7157b2ccf Revert "Reland "Have a GrBackendFormat be stored on gpu proxies.""
This reverts commit 2f9a5ea639.

Reason for revert: breaking fuchsia

Original change's description:
> Reland "Have a GrBackendFormat be stored on gpu proxies."
> 
> This reverts commit 919c9e77c3.
> 
> Reason for revert: Flutter change has landed and fixed memory issue.
> 
> Original change's description:
> > Revert "Have a GrBackendFormat be stored on gpu proxies."
> >
> > This reverts commit 51b1c12bbc.
> >
> > Reason for revert: reverting till flutter gets to 1.1 to fix build issues.
> >
> > Original change's description:
> > > Have a GrBackendFormat be stored on gpu proxies.
> > >
> > > Bug: skia:
> > > Change-Id: Iaf1fb24ab29a61d44e5fa59a5e0867ed02dcda90
> > > Reviewed-on: https://skia-review.googlesource.com/c/168021
> > > Reviewed-by: Brian Osman <brianosman@google.com>
> > > Commit-Queue: Greg Daniel <egdaniel@google.com>
> >
> > TBR=egdaniel@google.com,bsalomon@google.com,brianosman@google.com
> >
> > Change-Id: I574fdc084ef5994596c51fb0d60423b5dc01b885
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Bug: chromium:903701 chromium:903756
> > Reviewed-on: https://skia-review.googlesource.com/c/169835
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > Reviewed-by: Greg Daniel <egdaniel@google.com>
> 
> TBR=egdaniel@google.com,bsalomon@google.com,brianosman@google.com
> 
> Change-Id: Ifd9b6b8e194af9fb9258fa626644e76e6ecf090d
> Bug: chromium:903701 chromium:903756
> Reviewed-on: https://skia-review.googlesource.com/c/170104
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

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

Change-Id: Ia0556355e5775b2100901b7bfa37f97bb6ccd90f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:903701 chromium:903756
Reviewed-on: https://skia-review.googlesource.com/c/171002
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-11-14 15:28:15 +00:00
Greg Daniel
2f9a5ea639 Reland "Have a GrBackendFormat be stored on gpu proxies."
This reverts commit 919c9e77c3.

Reason for revert: Flutter change has landed and fixed memory issue.

Original change's description:
> Revert "Have a GrBackendFormat be stored on gpu proxies."
>
> This reverts commit 51b1c12bbc.
>
> Reason for revert: reverting till flutter gets to 1.1 to fix build issues.
>
> Original change's description:
> > Have a GrBackendFormat be stored on gpu proxies.
> >
> > Bug: skia:
> > Change-Id: Iaf1fb24ab29a61d44e5fa59a5e0867ed02dcda90
> > Reviewed-on: https://skia-review.googlesource.com/c/168021
> > Reviewed-by: Brian Osman <brianosman@google.com>
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
>
> TBR=egdaniel@google.com,bsalomon@google.com,brianosman@google.com
>
> Change-Id: I574fdc084ef5994596c51fb0d60423b5dc01b885
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: chromium:903701 chromium:903756
> Reviewed-on: https://skia-review.googlesource.com/c/169835
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>

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

Change-Id: Ifd9b6b8e194af9fb9258fa626644e76e6ecf090d
Bug: chromium:903701 chromium:903756
Reviewed-on: https://skia-review.googlesource.com/c/170104
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-11-14 14:52:44 +00:00
Mike Reed
b5784ace85 use SkFontMetrics so we can deprecated the typedef
Bug: skia:
Change-Id: Icd40c042b0a8251bbd0b39dd3ee1a4634fff379f
Reviewed-on: https://skia-review.googlesource.com/c/170344
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-11-12 15:03:03 +00:00
Herb Derby
c34150079a Reland "Move remove ptr args to MakeRecAndEffects"
This is a reland of b07aba4214

Original change's description:
> Move remove ptr args to MakeRecAndEffects
>
> Move this conversion out through the transitive closure of calls. As you
> move up the stack, everything becomes refs instread of pointers.
>
> Reorder args of MakeRecAndEffects and setupCache to match the majority of other
> calls.
>
> Change-Id: I72baf457cd9140f76ee5f7122493284c4be5bcd0
> Reviewed-on: https://skia-review.googlesource.com/c/169765
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Commit-Queue: Herb Derby <herb@google.com>

Change-Id: I2ff7f218ecc7b18ae6a2b293cecdb059eea77562
Reviewed-on: https://skia-review.googlesource.com/c/170222
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2018-11-09 20:01:42 +00:00
Herb Derby
1062963232 Revert "Move remove ptr args to MakeRecAndEffects"
This reverts commit b07aba4214.

Reason for revert: Changes GMs

Original change's description:
> Move remove ptr args to MakeRecAndEffects
> 
> Move this conversion out through the transitive closure of calls. As you
> move up the stack, everything becomes refs instread of pointers.
> 
> Reorder args of MakeRecAndEffects and setupCache to match the majority of other
> calls.
> 
> Change-Id: I72baf457cd9140f76ee5f7122493284c4be5bcd0
> Reviewed-on: https://skia-review.googlesource.com/c/169765
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Commit-Queue: Herb Derby <herb@google.com>

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

Change-Id: I29e54cea5b7b5709dd6db6816cb6556d73e003e0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/170221
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2018-11-09 19:01:08 +00:00
Herb Derby
b07aba4214 Move remove ptr args to MakeRecAndEffects
Move this conversion out through the transitive closure of calls. As you
move up the stack, everything becomes refs instread of pointers.

Reorder args of MakeRecAndEffects and setupCache to match the majority of other
calls.

Change-Id: I72baf457cd9140f76ee5f7122493284c4be5bcd0
Reviewed-on: https://skia-review.googlesource.com/c/169765
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2018-11-09 18:11:50 +00:00
Greg Daniel
919c9e77c3 Revert "Have a GrBackendFormat be stored on gpu proxies."
This reverts commit 51b1c12bbc.

Reason for revert: reverting till flutter gets to 1.1 to fix build issues.

Original change's description:
> Have a GrBackendFormat be stored on gpu proxies.
>
> Bug: skia:
> Change-Id: Iaf1fb24ab29a61d44e5fa59a5e0867ed02dcda90
> Reviewed-on: https://skia-review.googlesource.com/c/168021
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

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

Change-Id: I574fdc084ef5994596c51fb0d60423b5dc01b885
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:903701 chromium:903756
Reviewed-on: https://skia-review.googlesource.com/c/169835
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2018-11-09 15:33:23 +00:00
Greg Daniel
51b1c12bbc Have a GrBackendFormat be stored on gpu proxies.
Bug: skia:
Change-Id: Iaf1fb24ab29a61d44e5fa59a5e0867ed02dcda90
Reviewed-on: https://skia-review.googlesource.com/c/168021
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-11-08 19:44:55 +00:00
Mike Reed
9edbf42e75 Revert[4] "hide nested hinting enum"
This reverts commit 8e12cc6dfe.

Bug: skia:
Change-Id: Ice5e3480adad75ab77d97f7366495015f36b15a6
Reviewed-on: https://skia-review.googlesource.com/c/169520
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-11-08 16:33:04 +00:00
Mike Klein
8e12cc6dfe Reland "Revert "hide nested hinting enum""
This reverts commit f49563bf92.

Reason for revert: Google3 also.

Original change's description:
> Revert "Revert "hide nested hinting enum""
> 
> This reverts commit 6bd19df9fa.
> 
> Restores original CL, but adds guards for flutter.
> 
> Bug: skia:
> Change-Id: I380b4ea87d293355026d734249aa2b8c397da144
> Reviewed-on: https://skia-review.googlesource.com/c/169345
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Mike Reed <reed@google.com>
> Auto-Submit: Mike Reed <reed@google.com>

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

Change-Id: I26a07555df56ce92e86b114ecf4ab64643e71ed1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/169441
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-11-07 23:56:24 +00:00
Mike Reed
f49563bf92 Revert "Revert "hide nested hinting enum""
This reverts commit 6bd19df9fa.

Restores original CL, but adds guards for flutter.

Bug: skia:
Change-Id: I380b4ea87d293355026d734249aa2b8c397da144
Reviewed-on: https://skia-review.googlesource.com/c/169345
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2018-11-07 22:47:53 +00:00
Mike Reed
6bd19df9fa Revert "hide nested hinting enum"
This reverts commit fbebecee0e.

Reason for revert: need staging guard for flutter

Original change's description:
> hide nested hinting enum
> 
> Bug: skia:2664
> Bug: skia:8527
> Change-Id: I8f4b832d5524fb792bcc608d6bd515229881b048
> Reviewed-on: https://skia-review.googlesource.com/c/168270
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Florin Malita <fmalita@chromium.org>

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

Change-Id: I19496daa059932574f36ac47061068a81d5524c3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:2664, skia:8527
Reviewed-on: https://skia-review.googlesource.com/c/169344
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-11-07 22:06:01 +00:00
Mike Reed
fbebecee0e hide nested hinting enum
Bug: skia:2664
Bug: skia:8527
Change-Id: I8f4b832d5524fb792bcc608d6bd515229881b048
Reviewed-on: https://skia-review.googlesource.com/c/168270
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2018-11-07 21:42:28 +00:00
Brian Osman
9a9baae125 Use SkPMColor4f throughout clear APIs
Bug: skia:
Change-Id: I5386e27edbcf39233880d869841a6632ecb9416c
Reviewed-on: https://skia-review.googlesource.com/c/168261
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-11-05 20:36:24 +00:00
Mike Reed
16d91aaf44 remove empty devKern from SkPaint
Bug: skia:
Change-Id: I59f1bc11324755b536f93c83180c9b92e799c50d
Reviewed-on: https://skia-review.googlesource.com/c/168024
Auto-Submit: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2018-11-04 14:44:24 +00:00
Kevin Lubick
d969932474 Refactor Nima code
There were two copies of a Nima "player" and this moves them out of
samplecode/ and viewer/ to experimental/ where it is a bit more
accessible (e.g. for WebAssembly).

Bug: skia:
Change-Id: I05419a352f0d13d16b462a374578107513eb1243
Reviewed-on: https://skia-review.googlesource.com/c/166441
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-10-30 19:32:52 +00:00
Mike Reed
3a42ec0ee7 hide the SkPaint::Align enum entirely
Bug: skia:2664
Change-Id: I080b015dbcb3a3cd73bb6847f3243a996d5f7b7d
Reviewed-on: https://skia-review.googlesource.com/c/166282
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2018-10-30 17:26:47 +00:00
Mike Reed
a697df98d7 use utils for deprecated TextAlign
Bug: skia:8493
Change-Id: Ie7162d6e9099ce6499f05024205bd39fdd944c2b
Reviewed-on: https://skia-review.googlesource.com/c/165300
Auto-Submit: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2018-10-26 14:35:28 +00:00
Mike Reed
c88cc779ef remove (unused) vertical-text
Bug: skia:8487
Change-Id: Ia6715346a0214b0db2fc67294e45b5e04c1c24d8
Reviewed-on: https://skia-review.googlesource.com/c/163889
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2018-10-23 16:33:02 +00:00
Mike Klein
fa5f6ce872 rename some flattenable routines
Initialize felt a little too nebulous, and I think
the verb for "define registrar entry" is "register".

Change-Id: I52f2eb5df5acd46a8b38bb9ea9bb07f4ac8f3789
Reviewed-on: https://skia-review.googlesource.com/c/163990
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-10-20 14:08:32 +00:00
Mike Klein
a3d4099b86 small tweaks to SkFlattenable::Register
The NameToType() function and type argument passed to Register are never
used, so remove them.

While we're at it, switch the stragglers over to use the
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY macro.  The only remaining direct
calls to Register are for legacy effect names, to be deleted in another
CL.

Change-Id: Ia304f960360a6f55b25f6e4eb2aa45533ee13476
Reviewed-on: https://skia-review.googlesource.com/c/163987
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-10-20 12:30:58 +00:00
Mike Klein
4fee323522 override getTypeName() instead of using table
This should let getTypeName() and serialization work even
when deserialization factories haven't been registered.

I've made getTypeName() pure virtual like getFactory(),
and moved all the overrides into SK_FLATTENABLE_HOOKS,
cleaning up all the various ways we've done it before.

All the subclasses override getTypeName() and getFactory()
privately, so there should be no need to document them?

Change-Id: I723cb20099d250c2f2a10be266e3aacc6a061937
Reviewed-on: https://skia-review.googlesource.com/c/163543
Reviewed-by: Cary Clark <caryclark@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-10-19 18:07:04 +00:00
Greg Daniel
bdf12ad8d5 Move GrBackend enum to enum class.
Bug: skia:
Change-Id: I8add2470313549723be6720b543091c444d2eb4f
Reviewed-on: https://skia-review.googlesource.com/c/161680
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-10-12 14:01:58 +00:00
Mike Reed
1eb9af9029 delete textonpath code -- not used anywhere
Bug: skia:
Change-Id: Ib645f7c140f87123429170a0bf6f7ed86ce53b3f
Reviewed-on: https://skia-review.googlesource.com/158224
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2018-10-01 16:52:32 +00:00
Chris Dalton
d004e0b55c Cleanup resource flags
Converts GrResourceProvider::Flags and GrResourceCache::ScratchFlags
to "enum class" and fixes a case where we were accidentally using the
wrong type of flag. Makes sure to allocate GrSWMaskHelper proxies with
kNoPendingIO.

Bug: skia:8351
Change-Id: Ibcaa26314a53d0cb31ae22915ab94ab0fc07e76d
Reviewed-on: https://skia-review.googlesource.com/157280
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2018-09-27 23:40:23 +00:00
Brian Osman
82e0e444a5 Remove a largue quantity of 4444 and/or dithering code
Most of this was entirely unused. Some was only used by the dithering
sample (which is now also deleted).

Bug: skia:
Change-Id: Ibafe61e9b19cae8738fd8df2c94dca182722e2e6
Reviewed-on: https://skia-review.googlesource.com/155921
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-09-21 00:50:06 +00:00
Hal Canary
8a00144035 test,tools: whitespace changes for clang-format
Change-Id: I67529f6c0ac26da603f60af22c620f8f603d8a19
Reviewed-on: https://skia-review.googlesource.com/155564
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
2018-09-19 17:50:51 +00:00
Ben Wagner
9d289e2775 Use onOnceBeforeDraw instead of constructor for glyphs.
The PathText samples extracted glyph paths in the constructor, which
means that this is done when the sample is created instead of when it is
actually going to be drawn. This interferes with debugging other
samples, so delay extracting the glyph paths until onOnceBeforeDraw.

Change-Id: I342cc728b79426203273e5a19fb5ba3718c50fd6
Reviewed-on: https://skia-review.googlesource.com/155000
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2018-09-17 19:52:27 +00:00
Cary Clark
a24712e4dc Revert "makeSurface defaults to raster"
This reverts commit 29a4a684af.

Reason for revert: some configs fail

Original change's description:
> makeSurface defaults to raster
> 
> Rather that returning nullptr for a recording
> canvas, return a raster canvas instead.
> 
> R=​reed@google.com,robertphillips@google.com
> 
> Bug: skia:
> Change-Id: I211d8ef368b9aec6d14cc72d1652ac6a03f3fa7b
> Reviewed-on: https://skia-review.googlesource.com/151666
> Commit-Queue: Cary Clark <caryclark@skia.org>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

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

Change-Id: I82d2c3e4589a2ca8523bbf86884ed68b1431631d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/151824
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
2018-09-05 18:41:45 +00:00
Cary Clark
29a4a684af makeSurface defaults to raster
Rather that returning nullptr for a recording
canvas, return a raster canvas instead.

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

Bug: skia:
Change-Id: I211d8ef368b9aec6d14cc72d1652ac6a03f3fa7b
Reviewed-on: https://skia-review.googlesource.com/151666
Commit-Queue: Cary Clark <caryclark@skia.org>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-09-05 17:36:49 +00:00
Chris Dalton
09a7bb2221 Reland "ccpr: Implement stroking with fine triangle strips"
This is a reland of 2f2757fa6b

Original change's description:
> ccpr: Implement stroking with fine triangle strips
>
> Implements strokes by linearizing the curve into fine triangle strips
> and interpolating a coverage ramp for edge AA. Each triangle in the
> strip emits either positive or negative coverage, depending on its
> winding direction. Joins and caps are drawn with the existing CCPR
> shaders for triangles and conics.
>
> Conic strokes and non-rigid-body transforms are not yet supported.
>
> Bug: skia:
> Change-Id: I45a819abd64e91c2b62e992587eb85c703e09e77
> Reviewed-on: https://skia-review.googlesource.com/148243
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Allan MacKinnon <allanmac@google.com>

TBR=robertphillips@google.com

Bug: skia:
Change-Id: I3f0065e80975ee8334300bc5e934231b66b49178
Reviewed-on: https://skia-review.googlesource.com/151188
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
2018-09-03 10:16:28 +00:00
Cary Clark
db16001d6a add circles to stroked cubics with cusps
Add a circle at the cusp to match Adobe Illustrator,
Microsoft Edge, and our own CCPR implementation.

R=reed@google.com,csmartdalton@google.com
Bug: skia:5623
Change-Id: Ia46c910643f373e50c4b30303fcac5f79d77be62
Reviewed-on: https://skia-review.googlesource.com/150370
Commit-Queue: Cary Clark <caryclark@skia.org>
Reviewed-by: Mike Reed <reed@google.com>
2018-08-31 19:55:44 +00:00
Jim Van Verth
0b7645f6d9 Simplify perspective shadows to match future MD specs.
* For ambient we outset a constant amount around the perspective shape.
* For spot we compute the projection of the bounds from the light's
  perspective, and from that compute a matrix to transform the path.

Bug: skia:7971
Change-Id: I7fffdd1446423956773d145ff4fae0a81602ad5b
Reviewed-on: https://skia-review.googlesource.com/150471
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-08-31 18:15:19 +00:00
Chris Dalton
02e6efe0a4 Revert "ccpr: Implement stroking with fine triangle strips"
This reverts commit 2f2757fa6b.

Reason for revert: issues with DDL

Original change's description:
> ccpr: Implement stroking with fine triangle strips
> 
> Implements strokes by linearizing the curve into fine triangle strips
> and interpolating a coverage ramp for edge AA. Each triangle in the
> strip emits either positive or negative coverage, depending on its
> winding direction. Joins and caps are drawn with the existing CCPR
> shaders for triangles and conics.
> 
> Conic strokes and non-rigid-body transforms are not yet supported.
> 
> Bug: skia:
> Change-Id: I45a819abd64e91c2b62e992587eb85c703e09e77
> Reviewed-on: https://skia-review.googlesource.com/148243
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Allan MacKinnon <allanmac@google.com>

TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com,caryclark@google.com,csmartdalton@google.com,reed@google.com,allanmac@google.com

Change-Id: I1980b09976df8275817eaffb6766dbd9fd3e59c7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/150980
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2018-08-31 14:45:44 +00:00
Chris Dalton
2f2757fa6b ccpr: Implement stroking with fine triangle strips
Implements strokes by linearizing the curve into fine triangle strips
and interpolating a coverage ramp for edge AA. Each triangle in the
strip emits either positive or negative coverage, depending on its
winding direction. Joins and caps are drawn with the existing CCPR
shaders for triangles and conics.

Conic strokes and non-rigid-body transforms are not yet supported.

Bug: skia:
Change-Id: I45a819abd64e91c2b62e992587eb85c703e09e77
Reviewed-on: https://skia-review.googlesource.com/148243
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Allan MacKinnon <allanmac@google.com>
2018-08-31 12:51:47 +00:00
Mike Reed
a62d036586 textonpath no longer in canvas
Prev behavior available via utils SkDrawTextOnPath

Bug: skia:7554
Change-Id: I3d71963c632cc947e418757bb83cdc18ec3b184e
Reviewed-on: https://skia-review.googlesource.com/150123
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2018-08-29 14:04:45 +00:00