Skip to content

Making the Forms views more extendable#269

Merged
mattleibow merged 8 commits into
masterfrom
forms-changes
Apr 23, 2017
Merged

Making the Forms views more extendable#269
mattleibow merged 8 commits into
masterfrom
forms-changes

Conversation

@mattleibow

Copy link
Copy Markdown
Contributor

This is to provide support for custom native SkiaSharp views, but still use the existing renderer logic. #260

#else
Control.Invalidate();
#endif
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In our current beta, we had several crashes, because "OnSurfaceInvalidated" was called by a background thread.
Maybe it is better to post these on the main thread?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one is a bit tough... I think the two sides of the fence is to either let the user make sure that invalidate is done from the main/UI thread via Xamarin.Forms.Device.BeginInvokeOnMainThread(), or to let the framework do it automatically.

For most cases, the app will always be using the main thread, so this should not be an issue. Thus, the overhead for posting to the main thread on each call might be undesirable. However, if some event out of the user's control is causing this to be called, then we will have to wrap the invalidate.

In the case of your beta, are you able to determine if a call was being made from a background thread that you could control?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah of course. And I agree with you. We will apply the fix in our app logic ;-)

controller.OnPaintSurface(new SKPaintGLSurfaceEventArgs(surface, renderTarget));
}
}
#endif

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need this renderer construct? Is there a problem with the PaintSurface subscriptions? (just curious)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The types are different. The incoming event is a native type in the SkiaSharp.Views.PLATFORM assembly, and I am constructing a SkiaSharp.Views.Forms assembly type. It is the programmer within that couldn't think of different names :)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh ok 👍

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No wait. My bad.

The Android GL view does not use events. It is the surface-based system, which separates the view from the actual rendering via this render construct.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gentledepp

Copy link
Copy Markdown
Contributor

Man it's really great that you're working on this! I owe you a beer.
Unfortunately, I did not (yet) have time to work on it - plus my skiasharp build works in powershell, but not in VS... always fighting the tools. ;-)

From what I can see you've nailed it. I left you some comments nevertheless. Thanks!

P.S + off topic.: Do you know someone that I could talk to to about the Xamarin.SignaturePad repo? It has been stale for 3 years now and there are vital PRs waiting...

@mattleibow

Copy link
Copy Markdown
Contributor Author

@gentledepp Thanks for the comments!

About the tools, what I do for dev on the sources other than the actual binding is to just install the NuGets. The project is set up so that the build system can run through and throw errors if there is anything out of place. But, when doing more rapid/focused dev, such as the forms bits, I just delete the project references and install the SkiaSharp and SkiaSharp.Views NuGet into the projects. That way I can dev everything on Windows in VS.

The first issue is that if I change something in the binding project, I want the build to fail if I don't update the other projects. But as you found out, this is not very friendly for everyone else. I need to figure out a way to have a CI-style project setup as well as a human-style setup.

@mattleibow mattleibow added this to the 1.57.0 milestone Mar 23, 2017
@mattleibow mattleibow modified the milestones: 1.57.0, 1.57.1 Mar 24, 2017
@mattleibow
mattleibow merged commit 055ef8c into master Apr 23, 2017
@mattleibow
mattleibow deleted the forms-changes branch April 23, 2017 18:04
mattleibow added a commit that referenced this pull request Jun 29, 2026
…ne skill, honest run signal (#4258)

Harden Skia upstream-sync: conflict policy, durable gn args, standalone skill, honest run signal (#4258)

Follow-up to the mode=main tip work (#4254) and release-line targeting
(#4239). The first real tip runs exposed three rough edges in the
auto-skia-sync automation, plus that key Skia-update knowledge lived only
in the workflow prompt where the update-skia skill couldn't reach it.

~~ Verify-upstream-or-reapply conflict resolution ~~

A tip merge runs ~291 commits ahead of our submodule base and conflicts on
every file carrying an [M1xx] fork cherry-pick. The old "keep ours / resolve
what you reasonably can" guidance risked silently dropping a not-yet-
upstreamed patch (--theirs) or freezing a stale form of one upstream had
since refined (--ours; e.g. our SDF-LCD patch used getMaxScale() while
upstream relanded it as sk_ieee_float_divide(1.f, getMinScale())).

Replace it with an explicit, auditable policy: classify each fork patch on a
conflicted file as upstreamed (take upstream's form, record the SHA) or not
upstreamed (re-apply ours on top) -- never a blanket --theirs/--ours, never
a silent drop. A mandatory before-merge fork-patch snapshot is cross-checked
so every patch lands in the resolution table as upstreamed or re-applied; a
patch that is neither is a lost patch -> stop and fix. Applied across gotcha
#15, SKILL.md Phase 5, and the workflow tip note.

~~ Allow a required new gn arg through build.cake ~~

The tip build needed skia_use_partition_alloc=false because upstream now
defaults it to is_clang while our DEPS deliberately omits partition_alloc;
Skia ships an official zero-overhead noop raw_ptr for exactly this case, so
=false is the supported embedder path, not a hack. The rule banned all
build.cake edits, forcing a one-off --gnArgs CLI flag and leaving durable
config non-durable.

Split the rule into two tiers: still forbid changing compiler/linker flags
(or scripts/infra/native/**) to silence a host build error, but allow adding
a genuinely required new upstream gn arg to the affected platforms'
native/**/build.cake gn-args lists, flagged in both PR summaries for cross-
platform review. Sequencing is honored: the toggle doesn't exist in m150, so
the relaxed rule lets the next milestone merge add it in-context rather than
breaking the current build. Recommendation for the eventual bump (gotcha #23):
keep partition_alloc disabled via the supported noop, not by vendoring the
Chromium allocator.

~~ Make the skill standalone; reduce the workflow to CI overrides ~~

main/tip mode and the required-new-gn-arg rule were documented only in the
workflow prompt, so the update-skia skill couldn't drive them locally. Move
both into the skill: tip mode becomes a first-class third option in Phase 1
(new {UPSTREAM_REF} variable, merge-base..upstream/main milestone diffs,
generalized Phase 5 merge command), and the gn-arg rule lands in Phase 7
backed by gotcha #23. Trim the workflow's duplicated build.cake/mode prose to
short pointers, keeping only genuinely CI-specific guardrails (can't apt-
install in the sandbox; a missing host dep is a workflow bug, not a flag hack;
Linux-only-build cross-platform review). These are prompt-body edits, so the
lock stays byte-identical.

~~ Stop mislabeling a real sync as a no-op ~~

A sync that merged upstream, built, tested, and opened both PRs was reported
by the gh-aw conclusion job as a no-op, which then failed trying to file a
no-op issue (the workflow has no issues: write). Cause: safe-outputs staged
mode blocks the agent from creating anything directly -- the real PRs are
opened by the host post-step skia-sync-push-prs.sh with the autobump token --
so noop was the agent's only completion signal and every run, real or not,
signalled noop.

Give the agent an honest signal: declare create-pull-request in safe-outputs,
kept staged (preview-only; the safe_outputs job is ubuntu-slim with
permissions:{} and never touches the workspace) so a real sync registers as a
pull-request output, while real PRs still come only from the post-step. Set
noop: report-as-issue: false so noop is reserved for genuine no-work runs and
no longer files an uncreatable issue; drop the unused create_issue offer; and
add a "Completion signal" section to the prompt. This is the one frontmatter
edit in the PR, so auto-skia-sync.lock.yml is regenerated.

Validated end-to-end by run 28269474099 (mode=main, real 2-commit merge): the
agent emitted a staged create_pull_request, the conclusion logged no noop with
no failed issue step, and the post-step still pushed skia-sync/main to both
repos and updated the real PRs (#4263 + #269). Rebased on main to pick up the
#4260 workflow rename (lock recompiled to a 0-diff) and confirm consistency
with the #4267 support-status model.

Co-authored-by: Matthew Leibowitz <mattleibow@live.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants