Effects now have a duration, and can be played looped
or one-shot. Added a second list of affectors that are
applied at spawn vs. update.
Effects grab and store the SkRandom at construction,
so it no longer needs to be passed to update().
Bug: skia:
Change-Id: Ib54d60466e162e4d4b70fa64c1215fc01680d47a
Reviewed-on: https://skia-review.googlesource.com/c/191722
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This supports arrays of any type, and removes all of the special case
code for arrays of SkReflected objects. (This is extracted from my
rewrite of SkCurve, which needed something like this to work).
Bug: skia:
Change-Id: I55ab942f7922335dca0685d28b3b122bc4d53daa
Reviewed-on: https://skia-review.googlesource.com/c/192620
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Moving this out of the constructor means less going on at slide creation
time, making debugging easier.
Change-Id: I37bdd249abef663931bc8ef152a92a3a3436dcf4
Reviewed-on: https://skia-review.googlesource.com/c/192600
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Rather than depend on the Cocoa event system we intercept the events
in our main loop and send them to the appropriate sk_app::Window. A
hashmap that maps from Cocoa windowNumbers to an sk_app::Window is
added to make this possible.
We continue to send the event on through the Cocoa system to catch
system level events -- e.g., window close and drag events. We also
continue to catch key events in an NSView to keep the app from beeping
annoyingly because it thinks it's capturing events outside its focus.
Finally we ensure that move events are always enabled for the window
so that imgui knows that the cursor is over it.
Bug: skia:8737
Change-Id: Id49df51f68942fbf51634d6484291df862074864
Reviewed-on: https://skia-review.googlesource.com/c/191574
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Since, by definition, the ops are created when recording, it makes sense that they should be able to make due with only the GrRecordingContext.
TBR=bsalomon@google.com
Change-Id: If64353aee30b35d0a16401f7de00954f44ed8c59
Reviewed-on: https://skia-review.googlesource.com/c/190670
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This adds a new "Particles" slide to viewer, that allows
editing, loading, and saving particle effects. All of the
particle system code is in modules/particles.
There are many rough edges and some not-yet-finished changes
to generalize the model[1]. A rough overview:
- SkReflected.h implements a lightweight reflection system
for classes derived from SkReflected. Adding a new class
involves deriving from SkReflected, adding a macro to the
class declaration, and implementing visitFields(), which
simply calls a virtual on an SkFieldVisitor for each field.
Currently, emitters and affectors use this mechanism.
- SkParticleSerialization.h demonstrates two useful field
visitors - for serializing to and from JSON. The driver
code that uses those is directly in ParticlesSlide.
- SkParticleData.h and SkCurve.h define a variety of helper
types for talking about particles, both for parameterizing
individual values, and communicating about the state of a
particle among the effect, affectors, and emitters.
- SkParticleEffect.h defines the static data definition of
an effect (SkParticleEffectParams), as well as a running
instance of an effect (SkParticleEffect). The effect has
simple update() and draw() methods.
- ParticlesSlide.cpp adds a third field visitor to generate
GUIs for interactively editing the running effect.
---
1: The critical change I'd like to make is to remove all
special case behavior over time and at spawn (setting sprite
frames, size over time, color over time, etc...). Integration
is the only fixed function behavior. Everything else is driven
by two lists of affectors. One is applied at spawn time, using
the effect's lifetime to evaluate curves. This allows spawning
particles with different colors as the effect ages out, for
example. The second list is applied every frame to update
existing particles, and is driven by the particle's lifetime.
This allows particles to change color after being spawned, for
example.
With a small set of affectors using a single expressive curve
primitive (keyframed list of cubic curve segments), we can
have affectors that update color, size, velocity, position,
sprite frame, etc., and implement many complex behaviors.
Bug: skia:
Change-Id: Id9402bef22825d55d021c5a2f9e5e41791aabaf4
Reviewed-on: https://skia-review.googlesource.com/c/181404
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
This seems to resolve the leak in libxcb, but introduces a new leak in
VkTestUtils.
Bug: skia:8710
Change-Id: I71482d8f1c5eebfffd211a4124bd2db01283741b
Reviewed-on: https://skia-review.googlesource.com/c/186862
Commit-Queue: Ben Wagner <benjaminwagner@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Auto-Submit: Ben Wagner <benjaminwagner@google.com>
Introduce RenderNode::nodeAt(const SkPoint&) as the entry point for the hit-testing API.
This is backed by a onNodeAt() virtual, which gets dispatched throughout the render DAG,
and normally stops at the first leaf Draw node in encounters.
To support the implementation, introduce a GeometryNode::contains(const SkPoint&) API.
This is backed by a onContains() virtual, overridden in each concrete geometry class.
Expose nodeAt() on sksg::Scene, and add some basic unit tests.
Change-Id: I0c8abd9d1e51ecf2d8b4dd699f325cd636e21084
Reviewed-on: https://skia-review.googlesource.com/c/191296
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
Change-Id: I6d18be3f6178003eb5153d32d4b618101ddcb3d9
Reviewed-on: https://skia-review.googlesource.com/c/191297
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This makes it easier to switch all the ops over to using a GrRecordingContext (and better matches what we do with all the other ops)
Change-Id: Ie690975c31b8c9f4c7acebdc0185a145a0a263a5
Reviewed-on: https://skia-review.googlesource.com/c/191280
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
When the GrImageContext & GrRecordingContext are actually GrDirectContexts it is useful for them to report the abandonment state of the GrDirectContext.
When the GrImageContext & GrRecordingContext are actually GrImageCreationContext or GrDDLContexts then they will just never be abandoned.
This CL also strips the GrProxyProvider and GrDrawingManager of their tracking on abandonment and centralizes it in the GrImageContext.
ImageContext
can't abandon
can only check abandonment privately
RecordingContext
can't abandon
can only check abandonment privately
DirectContext (aka GrContext)
can abandon publicly
can check abandonment publicly
Note that abandoning the DirectContext won't alter the abandonment status of any of
the other contexts in its group (e.g., DDL contexts that may be being used to record).
Change-Id: Ib790f74d90ab18da58a127fed2aad20e2477bd21
Reviewed-on: https://skia-review.googlesource.com/c/190669
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
- break dependency on code from src/compute
- port away from C APIs to friendlier C++ wrapper APIs
- add DEPS for OpenCL C++ wrapper headers so we can build on Mac
- factor out a //third_party/opencl GN target
Change-Id: I9e37c6677cfb779021e66f2bd10f97570c450746
Reviewed-on: https://skia-review.googlesource.com/c/191281
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
fflush() requires an open file handle, so it shouldn't be called
right after fclose(). And fclose() performs an fflush(), by
definition (see http://man7.org/linux/man-pages/man3/fclose.3.html ),
so we can remove this fflush() call altogether.
Change-Id: I8fbdd5a85b3cdb5edfdabbd5dca449ea1d4fce2d
Reviewed-on: https://skia-review.googlesource.com/c/191321
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Bug: skia:
Change-Id: Ic44ab00af1117a6bbc17df7f5005f4db707cb5c1
Reviewed-on: https://skia-review.googlesource.com/c/191002
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Bug: skia:8737
Change-Id: I5c4c839bcf39f2cd3a9a32d005bf4bdb7c42e6a5
Reviewed-on: https://skia-review.googlesource.com/c/187925
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
This function binds texture ID 0 to any texture unit/target combo that
Skia has modified.
Bug: chromium:926017
Change-Id: I3ac8f8050c863232886102886e60d3b91a5380c9
Reviewed-on: https://skia-review.googlesource.com/c/190663
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Trying to shuttle our paint events through the Mac event system seems
to be causing a number of problems, one being that we're refreshing
too often. This works around that by tracking the invalidation flag
per window.
Bug: skia:8737
Change-Id: Ib1b8041f1d9299ff366747831a466439bfd0db29
Reviewed-on: https://skia-review.googlesource.com/c/190673
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Change-Id: Ia8e3b42d1b88d111a3885a7b2ae90c29985a8c10
Reviewed-on: https://skia-review.googlesource.com/c/190672
Commit-Queue: Hal Canary <halcanary@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Any context that records ops (i.e., direct and/or DDL) will need these two objects.
Change-Id: Ifd3527c23a4015f7d469ad2222563508cccbd339
Reviewed-on: https://skia-review.googlesource.com/c/190307
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
skiaWidget adds fake "images" to the ImGui draw list. Those have
vertices allocated for them (even though we don't consume them). We
still need to skip over those if any ImGui widget rendering happens
after the callback, though.
Bug: skia:
Change-Id: Ia0243e600bd32d90ba97ac9fbe58b715f70aa83a
Reviewed-on: https://skia-review.googlesource.com/c/190664
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
This starts to beef up the capabilities of the GrImageContext in preparation for its future responsibilities (i.e., creating promise images w/o a recordingContext).
Note that the proxyProvider still has different behavior if it has a full context vs. a reduced context. I intend to just let this behavior remain as is.
Change-Id: Idb9d99a548ef928fc1b9dc1e5a34f74343bb0b4b
Reviewed-on: https://skia-review.googlesource.com/c/189490
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Presumably if we don't need these in Skia,
we don't need them in Android?
Change-Id: Iff18066c1c2a52c999beabbd9239d4bc96d0ba6d
Reviewed-on: https://skia-review.googlesource.com/c/190438
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
I already used this to choose where to branch SkQP for Q-release.
No-Try: true
Change-Id: Id809adefe038d4a96a47c19f7844812ea8854d1e
Reviewed-on: https://skia-review.googlesource.com/c/184920
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
Fixes key repeat rate when vsync is disabled
Bug: skia:
Change-Id: I315932d0e0bcfd491a3c81deba56b137db1c3a0f
Reviewed-on: https://skia-review.googlesource.com/c/190304
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
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>
It will upload to a directory that specifies the day the SKPs were created on:
gs://chrome-partner-telemetry/skps/2019-02-05
Bug: skia:8738
Change-Id: Ic6b719770e16408d580e552af41c1a41c682935a
Reviewed-on: https://skia-review.googlesource.com/c/188300
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
Commit-Queue: Ravi Mistry <rmistry@google.com>
Gives 1:1 pixel correspondence with GM resolutions, and fixes
viewport issues.
Bug: skia:8737
Change-Id: Ieb87ed32cbb3211bdb4cdfbcc486c7b57b1c1eda
Reviewed-on: https://skia-review.googlesource.com/c/188627
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Mike Reed <reed@google.com>
To work around skia:8709, I'm moving the DDL tests to IntelIris640. The
ASAN jobs still show memory leaks in the driver, but at least I can
identify which calls are leaking and suppress the LSAN warnings.
Adds an SK_ENABLE_SCOPED_LSAN_SUPPRESSIONS define that indicates that
the LSAN header files are available, which is set in recipes for the
Linux ASAN builds. Adds __lsan::ScopedDisabler in four locations for
two Vulkan API calls:
- CreateGraphicsPipelines in GrVkPipeline::Create and
GrVkCopyPipeline::Create
- CreateDescriptorSetLayout in
GrVkDescriptorSetManager::DescriptorPoolManager::DescriptorPoolManager
constructor (2 calls)
Also adds a regular suppression for libxcb.so.
See bugs listed below for more details on the leaks.
Bug: skia:8710, skia:8712, skia:8713
Change-Id: I55c6e5d483b4aeed5cd44c64219539ca7214187f
Reviewed-on: https://skia-review.googlesource.com/c/184071
Commit-Queue: Ben Wagner <benjaminwagner@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Auto-Submit: Ben Wagner <benjaminwagner@google.com>
Verified that running bookmaker produces an identical fiddle.json
before and after this change.
Bug: skia:
Change-Id: I1aa7477348a5f8c362201199b130508c2818116f
Reviewed-on: https://skia-review.googlesource.com/c/188303
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
In addition to fixing the typo, this cleans up a few unnecessary calls
into SkTypeface internals.
Change-Id: I101f67053c2db6850d1576de1001998ccf84d2cd
Reviewed-on: https://skia-review.googlesource.com/c/189496
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
This turns DAA off by default in Skia and in our tools,
while leaving it able to be turned back on if we want.
(There's at least one bot that does already.)
This setup keeps our default builds matching the behavior
of Chromium, Flutter, Android, Google3, and should prevent
anyone from accidentally falling into it.
Change-Id: Ia85f3dbe69c46cec0dac6b07fb5feb6e8b65d237
Reviewed-on: https://skia-review.googlesource.com/c/189580
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
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>
This copies the hardware buffer unit test from, which was cherry picked
straight into skqp last year, into Skia proper.
There are not functional changes, but a few of the APIs have been updated
to work with newer Skia.
Bug: skia:
Change-Id: I2d7b2ed8b0b9314ca3e03e703a6a5ac53805275e
Reviewed-on: https://skia-review.googlesource.com/c/188034
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
SkiaRenderer does not delete promise image textures when they are released
but not done. Refulfilling promise image textures takes a significant amount
of CPU time. This allows us to fulfill each promise image once.
Bug: skia:8736
Change-Id: I7ad7fa9678ed0ec4bb714b71fbf920ab4a845409
Reviewed-on: https://skia-review.googlesource.com/c/188039
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Bug: skia:
Change-Id: I1763aab0b4bdb650128c1fcc3aa3a05d194496ca
Reviewed-on: https://skia-review.googlesource.com/c/186360
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
All of SkDrawCommand / SkDebugCanvas now uses SkJSONWriter.
Also removed the bespoke json generator and pretty-printer
in GrAuditTrail. This was the largest volume of code still
using JsonCPP. (There are other stragglers).
Bug: skia:
Change-Id: I3aee554764689ce50c8e707caf26c76093b9bb8f
Reviewed-on: https://skia-review.googlesource.com/c/187040
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
This moves us to the correct way of handling the correct version of
Vulkan that the client wants us to use.
Bug: skia:
Change-Id: I6c7962b5d2d48ae142c6a701c30f5af3801ac99b
Reviewed-on: https://skia-review.googlesource.com/c/187382
Reviewed-by: Sergey Ulanov <sergeyu@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
kUnbudgetedCacheable now means that the resource is never purged
until its unique key is removed.
This fixes an issue where a cached texture for a promise image
might get purged by cache pressure. This in turn could cause
Skia to call the promise image's Fulfill proc multiple times with
no intervening Release calls. The balancing Release calls would
occur, but the policy is that each Fulfill should be balanced by
Release *before* another Fulfill.
Update/add unit tests.
Bug: chromium:922851
Change-Id: I6411e413b3104721ca4bb6e7f07b3b73d14cbcf9
Reviewed-on: https://skia-review.googlesource.com/c/186361
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Make all wrapped resources be kUnbudgetedUncacheable except those
created by AHardwareBuffer image generators and as backings for promise
images.
Make all non-wrapped unbudgeted resources be kUnbudgetedUncacheable.
Update unit tests to mostly use GrWrapCacheable::kNo except where they
are testing the distinction.
Update unit tests for new expectations.
Bug: chromium:922851
Change-Id: I4d3bdaa161ffc76390f26334bcb7e2b47dd9319d
Reviewed-on: https://skia-review.googlesource.com/c/185004
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Changed the URL and recaptured it's archive.
Also added a wait just in case.
NoTry: true
Bug: skia:8699
Change-Id: I7a829dc5e5156a68f683247b2eac66e90f8f3dad
Reviewed-on: https://skia-review.googlesource.com/c/185882
Reviewed-by: Ravi Mistry <rmistry@google.com>
Commit-Queue: Ravi Mistry <rmistry@google.com>
* Remove GetTypefaceOrDefault from SkPaint and SkFont
* Remove RefTypefaceOrDefault from SkPaint and SkFont
Change-Id: I04ae777142c2bdec849508b611b844418bbaedff
Reviewed-on: https://skia-review.googlesource.com/c/185781
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Also updates GM_draw_quad_set to use this API instead of the
bulk API on GrRenderTargetContext.
Bug: skia:8506
Change-Id: Ia342d83c509f9db69f06f01599c7041c98aabdb6
Reviewed-on: https://skia-review.googlesource.com/c/184488
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>