Commit Graph

601 Commits

Author SHA1 Message Date
Jorge Betancourt
2cddedd5f9 change method signature for FontChain
Change-Id: I1adf796be5ae1c6c7b70022cbe8e42ce9089f74d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/463258
Auto-Submit: Jorge Betancourt <jmbetancourt@google.com>
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
2021-10-28 01:57:32 +00:00
Jorge Betancourt
ebe2d82384 [JetSki] get TypeFace from FontMgr
Change-Id: Ied6cc2f67434757ed1cf6dd4edb6c40798ec206b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/450038
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
2021-10-20 19:33:30 +00:00
Jorge Betancourt
aa9656d8ca expose FontChain interface to Java with FontChainAdapter
initial commit to add fontChain to JetSki

Change-Id: Ic2e27b055888394b0b8202d817b0c09595ca9fa0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/457837
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
2021-10-14 19:58:29 +00:00
Jorge Betancourt
4d06441fca [JetSki] bind drawGlyphs to JetSki for Text rendering
Change-Id: I5cd691b5b3fda58afdc8ddd5213063c202b19672
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/447716
Reviewed-by: Florin Malita <fmalita@google.com>
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
2021-09-22 19:38:13 +00:00
Jorge Betancourt
151a6f34e1 expose Font to JetSki
Change-Id: Icea51ab00118b48898df70f4f1fa9ed985372589
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/444760
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
Reviewed-by: Florin Malita <fmalita@google.com>
2021-09-07 21:51:30 +00:00
Jorge Betancourt
c1727fc217 [JetSki] pass SkPaint into experimental SkText drawText calls
tests currently through jetski demo

Change-Id: I0847e98579b62104e5d9ddaa7ca008f5a75be5c7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/441427
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
2021-08-26 13:01:51 +00:00
Jorge Betancourt
e1fb47daac [JetSki] plumb experimental SkText to JetSki
Change-Id: I972ff5bd066ff9e8afa98f506e6fe9d6b9dc621a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/440597
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
2021-08-24 15:34:21 +00:00
Jorge Betancourt
14c4206d25 [androidkit] add seekTime and seekFrame for SkottieView util view
Change-Id: Ic714c0be2f63f62485e9d44f1db1e708f3c04dcd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/433056
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2021-07-29 14:12:54 +00:00
Jorge Betancourt
0b94acc132 [androidkit] initial upload of SkottieView util
Change-Id: I6f83ee6947121bef8a0c5b76b7a96ad85f24bd36
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/430018
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2021-07-26 15:47:10 +00:00
Jorge Betancourt
5514beaf3b [androidkit] bind SkImageFilters to java shared library
SkImageFilter::image
SkImageFilter::blend
SkImageFilter::dropShadow
Change-Id: Ie8cce8a06a2f50b2b3c905097740cc10b91a6c86
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/428577
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2021-07-16 16:18:55 +00:00
Florin Malita
1df8756419 [androidkit] Color filter support
Add MatrixColorFilter, HSLAMatrixColorFilter and ComposeColorFilter.

Change-Id: I047368adcd13452566a40e91a6f594dd525efd5f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/422517
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
2021-06-29 12:42:19 +00:00
Jorge Betancourt
4588910612 [androidkit] expose paint stroke settings
Change-Id: I9e34c319ff8b056e5b9cc0104be2ad50b37284c9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/422618
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2021-06-28 20:19:22 +00:00
Jorge Betancourt
0ce582790a [androidkit] introduce clipping to java Canvas
clipPath(), clipRect(), clipRRect(), clipShader()

Change-Id: Iee2571c6ab7c3f8cdfbfc4df223fd59d307b5c62
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/420880
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2021-06-28 16:04:49 +00:00
Florin Malita
b445cbeee2 [androidkit] Add remaining gradients
Consolidate the common logic in a Gradient base class, and add
radial/conical/sweep factories.

Change-Id: Ife15ae78e7c6df48cfa67fe20054f9bd9a8a1e90
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/420897
Commit-Queue: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
2021-06-24 17:43:38 +00:00
Jorge Betancourt
b75ee08162 [androidkit] add bounds and paint to canvas.saveLayer()
Change-Id: I55701ebb23bcf31a8f1e1533b030f685f2f10127
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/420117
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
2021-06-23 16:40:45 +00:00
Jorge Betancourt
7280b36687 [androidkit] add gaussian blur filter to java ImageFilters
Change-Id: I63f3f3feaf590971633c88857105ed14dbab2bb8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/420122
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2021-06-22 15:42:11 +00:00
Florin Malita
ca8191b0ad [androidkit] Add linear gradient
Change-Id: Ie08dcde421bb4f67b8467361bda563d5a65ddbd2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/416777
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
2021-06-17 20:55:53 +00:00
Jorge Betancourt
cfa4774f9a [androidkit] expose SkPath to androidkit
Change-Id: Ibc871459234ba72b0ab948c601e0895c15e21126
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/415797
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2021-06-16 20:23:20 +00:00
Florin Malita
dca72634f1 [android] Bump gradle heap size to 4GB
Change-Id: Ic6b1ff506fc11ee077be80cf8781ad0e6c5874e9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/418136
Commit-Queue: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
2021-06-15 19:15:48 +00:00
Florin Malita
4f382641ec [androidkit] Add pinch-zoom support to cube demo
Also add translate/scale Canvas helpers.

Change-Id: I8c46d45f73a41907d8d8f83b355a4185b6975f06
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/416776
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
2021-06-15 14:06:17 +00:00
Jorge Betancourt
ed3c0ed9e4 [androidkit] fix parameter names for drawRect
Change-Id: Ieb8c7869654531c01e9000cc0a0af9f87822a2fb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/415762
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@google.com>
Auto-Submit: Jorge Betancourt <jmbetancourt@google.com>
2021-06-07 14:20:20 +00:00
Jorge Betancourt
f961bc256d [androidkit] expose image filters to androidkit library
Add DistantLitDiffuse lighting filter as template for future filters to be added


Change-Id: Ib641b26512b0501538dfd54b17ab127bdef98f88
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/414976
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2021-06-04 21:18:38 +00:00
Florin Malita
9500c8b1f9 [androidkit] See-through face for CubeActivity
Paint both sides (two passes), and skip a face for inside visibility.

Change-Id: I138d790578c4ce30c7d4df9400485a983c1f9e95
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/414900
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
2021-06-04 15:40:23 +00:00
Jorge Betancourt
416477a8af [androidkit] expose saveLayer
Additionally, pass return value from native save and saveLayer to java

Change-Id: I1a4e04305ba8e57f6a639978b00f8e2ca1a59f90
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/415170
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2021-06-04 15:29:53 +00:00
Florin Malita
c27e0dc64f [androidkit] Add an extra Skottie sample to CubeActivity
Also update SkottieSample to always clear its dest rect (for animations
which are not opaque).

Change-Id: I36c6172d468567ee8e03d97dd707e03ca968aa26
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/414898
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
2021-06-02 18:10:06 +00:00
Florin Malita
0844cfa839 [androidkit] Add touch scroll/drag support to CubeActivity
Change-Id: If1edf8e374650ac3f464c5c08b3cf6cbb11034f6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/414397
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
2021-06-02 18:09:26 +00:00
Florin Malita
a0317b8c41 [androidkit] Add runtime shader sample
Convert existing RuntimeShaderActivity to use RuntimeSample, and add
a couple to the cube demo.

Change-Id: Ibc6056cd6c7939c13bd902ce848c49a211b9b334
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/413737
Commit-Queue: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
2021-06-01 15:26:53 +00:00
Florin Malita
ce6fe3fe80 [androidkit] Add Skottie sample
Convert existing SkottieActivity to use a Skottie Sample, and also add
one to the cube demo.

Change-Id: I86193889d293ddd653b0cac7200e830fa873ea69
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/413736
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
2021-06-01 14:33:14 +00:00
Florin Malita
8c8abd8f9f [androidkit] Start implementing reusable samples
Introduce a Sample interface for abstracting out various demos/samples.

Implement a simple image shader sample for starters.

Update the cube demo to map samples to sides.

Change-Id: I9c9c70fa05634404ced7bd30739f6e884546b91d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/413441
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
2021-06-01 14:33:14 +00:00
Florin Malita
4abf558c9f [androidkit] Relative-sized cube sample
Update the cube sample to be centered and sized relative to the target
surface.

Also simplify projection handling:

  - pre-compute a full view matrix in onSurfaceInitialized()
  - set the origin to the surface center
  - compute perspective and camera transforms in local coordinates
    (instead of unit view cube)

Also fix (invert) fling Y direction.

Change-Id: I48a3d0b4547812fb3c9b49a9842fb18c0ed0d863
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/413436
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
2021-06-01 14:33:14 +00:00
Jorge Betancourt
614e398ed3 expose Matrix transpositions and setUniform to RuntimeEffectBuilder
Change-Id: I78b57c3ad5e735335d1e2cc34e6c51a2ced6fc03
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/412796
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2021-05-26 20:31:39 +00:00
Florin Malita
ee7e22acd2 [androidkit] Add fling support to cube demo
Change-Id: Id3c2eb72e70a3c9c2181c8aff7770aafa7a520d3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/412236
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
2021-05-25 18:31:26 +00:00
Jorge Betancourt
4453c9add2 [androidkit] add navigation spinner to demo
-add navigation ui element to demo layout
-simplify demo layout, inflates faster

Change-Id: I232bbc553cd0143893fc20e3c218fa5a6c4006ce
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/411311
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2021-05-25 15:25:11 +00:00
Jorge Betancourt
754e00e959 [androidkit] change main activity to be like practical app
Change-Id: Ic12e95eb09ebb40928ba64a26e480a0078bd13c2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/410976
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
2021-05-24 15:47:16 +00:00
Florin Malita
50cc5d4147 [androidkit] Image shader support
Tangential updates:

 - new encoded input stream Image factory
 - Paint setters now return the object to support a fluent workflow
 - cube demo updated to store face paints instead of colors


Change-Id: I6142a229b18165112ef1fe76acae38bc4b27480d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/410789
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
2021-05-21 17:30:43 +00:00
Florin Malita
6e5d64b160 [androidkit] Add SamplingOptions
Mirroring SkSamplingOptions.

Change-Id: I6c4d21fb3f123e7931271fcc830d82f6b0215c40
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/410786
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
2021-05-20 20:29:55 +00:00
Florin Malita
934c02142e [androidkit] Introduce Image support
Two sources from now:

  - encoded data factory
  - Surface.makeImageSnapshot()

Change-Id: Icbf2f855e489839dc82db425916c8644418a2fb7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/410324
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
2021-05-20 20:28:55 +00:00
Florin Malita
f83a232fed [akdroidkit] Release the surface when exiting SurfaceRenderer's loop
To ensure we're deallocating GL/VK resources on the same thread.

Change-Id: I6df7e89f11439474c46715789db10b247734ef3c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/410322
Commit-Queue: Florin Malita <fmalita@chromium.org>
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
Auto-Submit: Florin Malita <fmalita@chromium.org>
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
2021-05-19 16:03:54 +00:00
Florin Malita
a1304f513e [androidkit] Add SurfaceRenderer utility
Most samples use the same render thread boilerplate -- consolidate as
a utility base class.

Also add Canvas.getWidth/getHeight.

Change-Id: I27c9f51b4fd9d228a39593fbd4650a66d10240c2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/409896
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
2021-05-18 19:37:44 +00:00
Florin Malita
5e8d88ef29 [androidkit] Add support for Skottie animations
Change-Id: Ibba2c0c8ad5b10d90f0bb30a3a859dacb94a03ad
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/409400
Commit-Queue: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2021-05-18 14:49:43 +00:00
Jorge Betancourt
a5654567f6 [androidkit] use cube face normals to prioritize cube face draws
Change-Id: I595a11c8cd5d9ba6ff64aee5ff91b9051ea8415e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/409337
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
2021-05-18 14:23:44 +00:00
Jorge Betancourt
ec978bbc4d expose canvas.localToDevice to androidKit
Change-Id: Ia6af3a06b9be078fd0b281a89fad0641082fd0ee
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/409336
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
2021-05-17 18:41:20 +00:00
Jorge Betancourt
025b914468 [androidkit] add getter for matrices
Change-Id: I0fd42b2506d794622852bd55aa4e8c2545216312
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/407916
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2021-05-13 19:29:53 +00:00
Jorge Betancourt
e3f8030494 [androidkit] implement ThreadedSurface backed by WindowSurface
This moves ownership of the SkSurface to ThreadedSurface::fWindowSurface.

When we pass a Message to the SurfaceThread, we will include  a pointer to ThreadedSurface.fWindowSurface so we can call:
getCanvas() to draw the SkPicture
WindowSurface's constructor so it can hold the WindowContext made during the init

To reference WindowSurface in SurfaceThread, we need to make a header for Surface.cpp (added in this cl)

Change-Id: I8c67223eee301a1b6e0d05934e1f8597cf70bc64
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/404918
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2021-05-13 17:15:49 +00:00
Jorge Betancourt
2446196688 3d cube initial demo
Change-Id: Idc3d05eeac13715d2cb57d5930e9642181fc670d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/406436
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
2021-05-12 15:41:52 +00:00
Jorge Betancourt
e3934b937e [androidkit] expose lookAt, perspective, and inverse Matrix construction
Change-Id: I94de24b2e47365cd65025166d83dd8b6c8fda90a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/405857
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2021-05-10 23:25:54 +00:00
Jorge Betancourt
c44ede6c78 [androidkit] expose minimal stroke settings to Java
Change-Id: I012aa2760ff2b39f0c21d6e235cf6731d13bfe3f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/405856
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
2021-05-10 16:33:32 +00:00
Jorge Betancourt
062793401d [androidkit] optimize JNI calls in AndroidKit.Matrix transformations
Note: Shouldn't add or change the Skia API, only accepts an optional z value to preScale()

Change-Id: Ic73c723ebc2b75acca1fce5395953434ef1582e6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/404376
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
2021-05-07 16:17:09 +00:00
Florin Malita
71863fa787 [androidkit] Canvas save/concat/restore
Change-Id: Ide67a67e542b4e0962475e0638b95d3edb416c68
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/405279
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
2021-05-06 17:39:57 +00:00
Jorge Betancourt
14efdd3d50 [androidkit] add transformation operations to Matrix
Change-Id: I5a81087eb56f10786c136df7cf68bb0e34742abf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/402676
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2021-04-30 14:07:18 +00:00