Commit Graph

20 Commits

Author SHA1 Message Date
Chris Dalton
2d18f41858 Resurrect pathfinder in viewer and rename to "bisect"
Bug: skia:
Change-Id: If8d2f46b8f27fefc3a0f983eb649654e0fb4afcb
Reviewed-on: https://skia-review.googlesource.com/108685
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-02-20 20:44:33 +00:00
Jim Van Verth
fc4f768e5a Use int when possible to calculate atlas indices in shaders.
On certain iOS devices half has a mantissa of only 10 bits, which is not
enough to perform the floating point trickery to get the lower bits
out of the "texture coordinates". Instead we use int if available, and
float if not available.

Also re-enables multitexturing for iOS and adds a sample which
stresses the issue, and a version of fontcache that tests multitexturing.

Bug: skia:7285
Change-Id: Ia541b6a418c1860c941071750ceb26459eb846ea
Reviewed-on: https://skia-review.googlesource.com/99800
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2018-01-26 13:54:54 +00:00
Leon Scroggins III
7a10b332a3 Add an SkDrawable for animated images (e.g. GIF)
Bug: b/63909536

SkAnimatedImage is a simple drawable for animating a GIF. Thread-safety
is left up to the client. At most two bitmaps are stored in the
drawable; one for the current frame and one for a frame that may need to
be restored. The backup frame prevents some cases where we would
otherwise have to re-decode from the beginning of the image.

The API lets the client set the time value, and decodes to match that
time.

TODO:
- Callback for when the animation is complete
- Ability to use SkAndroidCodec
- Modify the loop count (or leave that up to client?)
- Better and/or client-specific caching

Other changes:
- Add a sample which animates a GIF
- Reenable SK_CODEC_PRINTF for debug builds and Android

Change-Id: I945ffbccdb6008f2a05ed4d9b2af869a261fb300
Reviewed-on: https://skia-review.googlesource.com/93420
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2018-01-12 19:36:11 +00:00
Florin Malita
4aa4441186 Initial scene graph (SkSG)
Sketching a thin (as in close-to-skia-semantics) scene graph API, focused on
external animation, inval tracking and minimal repaint.

Only a few concrete classes/features so far:

* Rect/Color/Transform/Group
* basic inval tracking
* a trivial animated sample with inval visualization

Pretty much everything (especially naming) is volatile, so treat accordingly.

The interesting bits to review are likely in Node.{h,cpp} for inval and
SampleSGInval.cpp for usage.

Initial class hierarchy:

  * Node: invalidation/ancestors tracking
  |
   -- * RenderNode: onRender(SkCanvas)
  |   |
  |    -- * Draw (concrete): rendering a [geometry, paint] tuple
  |   |
  |    -- * Group (concrete): grouping multiple RenderNodes
  |   |
  |    -- * EffectNode: single-descendant effect wrapper
  |       |
  |        -- * Transform (concrete): transform effect
  |
   -- * PaintNode: onMakePaint()
  |   |
  |    -- * Color (concrete): SkColor paint wrapper
  |
   -- * GeometryNode: onComputeBounds(), onDraw(SkCanvas, SkPaint)
      |
       -- * Rect (concrete): SkRect wrapper

TBR=

Change-Id: Iacf9b773c181a7582ecd31ee968562f179d1aa1b
Reviewed-on: https://skia-review.googlesource.com/85502
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2017-12-21 20:56:32 +00:00
Brian Osman
ede860e91c Delete even more unused views code
Bug: skia:
Change-Id: I41480aa89dfcd8cb7e016e477cbabe354f35ce8a
Reviewed-on: https://skia-review.googlesource.com/75480
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-11-29 18:12:35 +00:00
Jim Van Verth
c02cb8a86c Revert "Use int when possible to calculate atlas indices in shaders."
This reverts commit 999ec57291.

Reason for revert: Causing issues with NexusPlayer Vulkan.

Original change's description:
> Use int when possible to calculate atlas indices in shaders.
> 
> On certain iOS devices half has a mantissa of only 10 bits, which is not
> enough to perform the floating point trickery to get the lower bits
> out of the "texture coordinates". Instead we use int if available, and
> float if not available.
> 
> Also re-enables multitexturing for iOS and adds a sample which
> stresses the issue.
> 
> Bug: skia:7285
> Change-Id: I365532c7cbbcca7c7753af209bef46e05be49e11
> Reviewed-on: https://skia-review.googlesource.com/71181
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Jim Van Verth <jvanverth@google.com>

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

Change-Id: I82801a73a2a8067588049b213f010ff25f4014f3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7285
Reviewed-on: https://skia-review.googlesource.com/74001
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2017-11-20 22:11:39 +00:00
Jim Van Verth
999ec57291 Use int when possible to calculate atlas indices in shaders.
On certain iOS devices half has a mantissa of only 10 bits, which is not
enough to perform the floating point trickery to get the lower bits
out of the "texture coordinates". Instead we use int if available, and
float if not available.

Also re-enables multitexturing for iOS and adds a sample which
stresses the issue.

Bug: skia:7285
Change-Id: I365532c7cbbcca7c7753af209bef46e05be49e11
Reviewed-on: https://skia-review.googlesource.com/71181
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2017-11-20 18:07:08 +00:00
Jim Van Verth
712fe73caf Add animated cowboy sample from WebKit tests, and fix.
Bug: chromium:712455
Change-Id: Ic9bb9b862abe01f112cc41d28589733460b15bc1
Reviewed-on: https://skia-review.googlesource.com/50181
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-09-25 21:14:09 +00:00
Robert Phillips
4c72b266da Add Chinese fling sample
Change-Id: Id27877c4d816ec83460f50a3a0d9cc0299ea6849
Reviewed-on: https://skia-review.googlesource.com/34780
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-08-16 13:45:57 +00:00
Robert Phillips
6dd8cf144e Remove SkLightingShader and associated classes
Change-Id: I8050414c30dfdb5df23ca79955adc5ba3a29d3f5
Reviewed-on: https://skia-review.googlesource.com/31140
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-08-07 13:33:49 +00:00
Chris Dalton
1a325d25b9 Coverage counting path renderer
Initial implementation of a GPU path renderer that draws antialiased
paths by counting coverage in an offscreen buffer.

Initially disabled until it has had time to soak.

Bug: skia:
Change-Id: I003d8cfdf8dc62641581b5ea2dc4f0aa00108df6
Reviewed-on: https://skia-review.googlesource.com/21541
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-07-14 21:45:35 +00:00
Mike Reed
a920d367bf remove unneeded code for index8 imagse
Bug: skia:6828
Change-Id: I039d6bc35a1ed93ce747247f32fe4e9d5b09da0c
Reviewed-on: https://skia-review.googlesource.com/21400
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2017-07-03 19:07:25 +00:00
Jim Van Verth
34d6e4b09f Add tonal color support for shadows.
Bug: skia:
Change-Id: Ib9bd9083da1d8a9fa90ae7c710386e6903541fd5
Reviewed-on: https://skia-review.googlesource.com/18148
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2017-06-09 17:18:58 +00:00
Brian Salomon
e23bffd65b Remove support in GPU backend for distance vector field.
Also, remvoes SkNormalBevelSource as this was the last use case for the distance vector field.

Change-Id: Ib0176c78e500e6b5130310934253a75860245812
Reviewed-on: https://skia-review.googlesource.com/18482
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-06-02 19:44:18 +00:00
Jim Van Verth
623fadf8be Add Material Design shadow reference sample
Change-Id: I889a3f508407178c457f675c321880d869caf9ea
Reviewed-on: https://skia-review.googlesource.com/17717
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-05-23 18:12:15 +00:00
Jim Van Verth
e7705780c9 Add ShadowUtils sample.
Also enables mouse support in Viewer.

Change-Id: Iaed08d42a64f591f0cd9b24684b3aee43404ed94
Reviewed-on: https://skia-review.googlesource.com/15313
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-05-04 18:37:55 +00:00
Jim Van Verth
4c9155bd66 Remove EXPERIMENTAL_SHADOWING, Part 1
Bug: skia:6557
Change-Id: I6482d74be7b360c93141a73dd80c67854530c7a1
Reviewed-on: https://skia-review.googlesource.com/15101
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-05-02 17:22:44 +00:00
csmartdalton
8c67909e04 Add a simple tool for isolating a path from an SKP
BUG=skia:

Change-Id: I5ca9bbd43919e3f65ea940847c68f85cc78dfeda
Reviewed-on: https://skia-review.googlesource.com/10130
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2017-03-27 19:19:19 +00:00
csmartdalton
ed4984bf53 Add animated text samples
BUG=skia:

Change-Id: I0b0a00a0d5c5790a1fc963458bc90c968830afd8
Reviewed-on: https://skia-review.googlesource.com/8361
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2017-02-13 22:33:08 +00:00
Mike Klein
6e74412a9c Create .gni files for samples, tests, gms, and benches.
Calling Python to find all these files is convenient, but error-prone.  It's easy to forget to call GN again when adding a file.  Each of these calls to Python also adds ~50ms to the run time of gn gen, which is small but adds up.

On my desktop, gn gen drops from 600ms to 150ms, noticeably faster.

This leaves one call to find.py for generating skia.h for fiddle.  We're not quite sure how to automate that process to happen entirely inside the :skia.h action while maintaining correct dependencies, so I'm leaving it for now.

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4036

Change-Id: Ib9d355b97900f29afebc65311ceef50537e46dda
Reviewed-on: https://skia-review.googlesource.com/4036
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2016-10-27 18:14:06 +00:00