Pathops determines which edges are kept and discarded
by sorting intersections counterclockwise. An edge
may be unsortable if it is too close to a neighbor to
clearly be on its left or right.
If a pair of lines is unsortable, they are probably
nearly coincident, but just far enough apart to escape
the coincident test.
The current code correctly marks the lines as unsortable,
but returned a guess at the sorting order anyway. Instead,
preserve the unsorted-ness (unsorted mess?) and let
the decision of what to keep defer til later.
This triggered a couple of asserts that needed rewriting
or disabling, but fixes the bug in question and does not
regress the extended tests in debug or release.
Also, fix a debugging routine that bit-rotted.
TBR=reed@google.com
Bug: skia:8228
Change-Id: Ifab90c65837ed9656bb572c385fcc5c916348778
Reviewed-on: https://skia-review.googlesource.com/149620
Commit-Queue: Cary Clark <caryclark@skia.org>
Auto-Submit: Cary Clark <caryclark@skia.org>
Reviewed-by: Cary Clark <caryclark@skia.org>
Skia no longer uses gclient sync and our bots never use calmbench.py anyway.
Bug: skia:
Change-Id: Ic1679e6078353f148e975777b3122cf4e1ab8bda
Reviewed-on: https://skia-review.googlesource.com/149259
Commit-Queue: Yuqian Li <liyuqian@google.com>
Commit-Queue: Eric Boren <borenet@google.com>
Auto-Submit: Yuqian Li <liyuqian@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
The data flow of create_test_font.cpp is difficult to follow due to use
of mutablility and globals. This removes all of the non-local mutability
and globals.
In addition this updates a few of the types for additional clarity and
fewer casts and make SkSpan all constexpr.
Change-Id: If09d48d210fdd36cd8c8d713a60672b6e12bd838
Reviewed-on: https://skia-review.googlesource.com/148560
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Also fix the documentation
No-Try: true
Change-Id: I526c2de9d29e64b4a9e1ec3fd9859d72e567ed55
Reviewed-on: https://skia-review.googlesource.com/148992
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
Allow embedders to pass a font manager.
In order to avoid excessive factory API clutter, introduce an
Animation::Builder helper to wrap factory options.
Also clean up various bits:
* hoist scene parsing out of the Animation ctor
* store the animation duration explicitly (instead of unused fps)
* plumb const SkFontMgr& internally (instead of a ref)
Change-Id: I3e180dfa85ba18c8462cfeb5a7385bef985ed6c4
Reviewed-on: https://skia-review.googlesource.com/148800
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
Change-Id: Ieac05047826b1fb80950d65573d38494a1a5c5e7
Reviewed-on: https://skia-review.googlesource.com/148383
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>
Adapting gray to 565 will add a noticeable purple/green tint.
I'd rather only the 565 images in Gold were tainted with that.
Change-Id: Ib09e92b2f78c6de086345124e9eefeb31bbb5fa8
Reviewed-on: https://skia-review.googlesource.com/147422
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Docs-Preview: https://skia.org/?cl=145148
Bug: skia:
Change-Id: If27722105a1e8999f6440b6fd4044cc1f327827e
Reviewed-on: https://skia-review.googlesource.com/145148
Commit-Queue: Ruiqi Mao <ruiqimao@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Bug: skia:
Change-Id: I99f938c76aa08a43bdc2e0fa2ad2bb04f103d2fb
Reviewed-on: https://skia-review.googlesource.com/146941
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Now set to bool generateAdvance(SkGlyph*)
Change-Id: I48bda7858d4c5d90edcf7b7af810d0da56ae0dd9
Reviewed-on: https://skia-review.googlesource.com/146537
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Bruce Wang <brucewang@google.com>
new batch of docs
Docs-Preview: https://skia.org/?cl=141244
Bug: skia:
Change-Id: I5a285778baaee2734495374adeb7359d524e47e3
Reviewed-on: https://skia-review.googlesource.com/141244
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
Auto-Submit: Cary Clark <caryclark@skia.org>
Change the Subpixel positioning in Viewer from 0 to 1 to -1 to 1, with
the origin at the center of the drag area. This allows for observing
what happens when rolling over integer boundaries. Since it is no longer
simple to reset to the origin, closing the collapsing header resets the
drag point to the origin.
Change-Id: I88d4fd489c3bfb914fb843fa261d4097fef3671a
Reviewed-on: https://skia-review.googlesource.com/146643
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Ben Wagner <bungeman@google.com>
This sanitizer checks for overaligned reads and writes,
or put another way, use of underaligned pointers.
This usually happens when you cast, e.g. char* to int*
without checking that the char* is 4-byte aligned. Each
of the changes under src/ fixes something just like that.
The unusual setup for tools/xsan.blacklist is there to
force a rebuild whenever tools/xsan.blacklist changes.
I spent a good few minutes debugging rebuilds not happening
this morning, perhaps from some strange ccache interaction.
Align SkTextBlobs as void* (today they're just 4-byte) so the
SkTextBlob::RunRecords we put after them in SkTextBlobBuilder
buffers are properly aligned (for the SkTypeface* inside).
There's no obvious error in void SkRRect::computeType(),
but one bot seems to have seen some sort of issue with
SK_AT_SCOPE_EXIT(SkASSERT(this->isValid()));
I can't reproduce it locally, so I'm just going to unroll it.
Change-Id: I904d94f65f695e1b626b684c32216a4930b72b0c
Reviewed-on: https://skia-review.googlesource.com/146104
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
This adds onResize to sk_app::Window::Layer and uses it to resize
samples in Viewer.
Change-Id: Ia5ec5cf6dc74fbdf712291b9ba8707b076cb625d
Reviewed-on: https://skia-review.googlesource.com/146642
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
What is left of the SkView system is used only by samples or viewer.
As a result, move it out of the Skia source tree and re-organize so it
is a bit easier to understand and use more shared code.
Move samplecode/ClockFaceView.cpp to samplecode/SampleTextEffects.cpp,
sice that's what's actually in it.
Move SkAnimTimer.h to tools/timer, since it's actually shared between gm
and samples.
Change-Id: I55dafd94c64e4f930ddbd19168e0f812af86c455
Reviewed-on: https://skia-review.googlesource.com/146161
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
- plumb a RenderContext RenderNode::render() argument to track pending
opacity
- defer opacity application until we can determine whether a layer is
required (group with multiple children) or the opacity can be pushed
onto the draw paint (for single/atomic draws)
Bug: skia:
Change-Id: I962ba08bad780395d5d738307bde986e9efa502b
Reviewed-on: https://skia-review.googlesource.com/146445
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
More pointless hoop-jumping
Change-Id: I0123e0a1e27140a82ffe08ad88e0d115c060436d
Reviewed-on: https://skia-review.googlesource.com/146449
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
This started with a search for gammaCloseToSRGB and turned into me
removing a bunch of really crazy bitmap code here. Like DM, just use
SkPngEncoder to encode PNGs. With that change, we don't need the custom
raster pipeline step, and we can remove that (along with several other
unused functions) from picture_utils. (The one remaining function should
just move to tool_utils, but I'll save that for another rainy day).
In getPixel, we can skip ALL of the processing work, and also only read
the one pixel we need. That makes break-on-change feel much faster from
my anecdotal testing.
Change-Id: I3d18f1e7a15dd12ac4661da1b724e9d8e1cdee96
Reviewed-on: https://skia-review.googlesource.com/146442
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
push -> push_back
add some aliases to match std::vector: count, reserve, ...
Bug: skia:
Change-Id: I1921c31d0d6e5ed3d622a0def6054c697be2d02f
Reviewed-on: https://skia-review.googlesource.com/145884
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
We need to handle all the possible ways a client is allowed to initialize
features on Vulkan.
Bug: skia:
Change-Id: I98b1dee2efa2c22c26ce093c590c7ccd0b626969
Reviewed-on: https://skia-review.googlesource.com/145530
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Adds pinch-zoom and swipe to change slides.
Bug: skia:
Change-Id: I0860c933208c8cf83027675a9de11b3f782de8e3
Reviewed-on: https://skia-review.googlesource.com/142898
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Unfortunately, this seems like the best way to have a local bot that uses the old-style allocation.
Change-Id: I3124d04bdbd2b262867a620fa467de86fec42d8f
Reviewed-on: https://skia-review.googlesource.com/145680
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Tight data generates intersections that are currently
unsortable. Edges that can be sorted are added; simple
connected edges need to be added as well.
Look for output edges with gaps and add simple edges that
continue at the ends to reduce the gap size.
Extended tests with region check (pathops_unittest -V -x)
pass in debug and release.
TBR=reed@google.com
Bug: skia:8223
Change-Id: Ib0f22061ae3676e1a3b94574516a61cbbea2948f
Reviewed-on: https://skia-review.googlesource.com/145644
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
Many of the other extensions in Vulkan rely on these some just want to
get these landed so we can start building on top of them.
Bug: skia:
Change-Id: Icef82c169cd50ff51b97fe065923531ef2940319
Reviewed-on: https://skia-review.googlesource.com/145362
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
After the last update to ImGui, windows delayed visibility for one
frame, to get properly sized. We would detect that no windows were
"active" (really, visible) and not re-paint, so we never got the second
frame when the window finally showed up.
Omar put a fix to the stats in ImGui for this, so that Active windows
are tracked separately from Visible. This pulls that change in, and
updates the test to correctly redraw when the GUI requires it.
Change-Id: Iaa61f11fcc226917e3e2b31039055a7fa1961e45
Reviewed-on: https://skia-review.googlesource.com/145361
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>
Bailing out early caused controls to flicker on/off if one was being
interacted with. No need to rebuild the window (paramsChanged), the GUI
is up, so we're already repainting.
Change-Id: I0751271962075dff22b19f60f4d1dc81c9232f58
Reviewed-on: https://skia-review.googlesource.com/145335
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Bug: skia:
Change-Id: Iff02911491cc61e39f94370c644b6666e5f9118f
Reviewed-on: https://skia-review.googlesource.com/137881
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Core Skia will always include our own SkiaVulkan.h which basically just
includes vulkan_core.h. All platform vulkan specific stuff must be
include by the client in their own vulkan.h file. Our public interface
is set up that we only use vulkan objects that will be present in all
versions of vulkan headers that the client could include.
Bug: skia:
Change-Id: I6673fd91498eabcc923d65d20f2b5e0a89b4ccf6
Reviewed-on: https://skia-review.googlesource.com/142985
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Bug: skia:
Change-Id: I8b73982e4c9372af1c35bfc5e665c2c146d7d9f5
Reviewed-on: https://skia-review.googlesource.com/141121
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Create new header and namespace, `SkUTF` where we are putting all of our
robust, well documented UTF-8, UTF-16, and UTF-32 functions:
`SkUTF::{Count,Next,To}UTF{8,16,32}()`.
SkUTF.h and SkUTF.cpp do not depend on the rest of Skia and are suitable
for re-use in other modules.
Some of the old UTF-{8,16} functions still live in SkUtils.h; their use
will be phased out in future CLs.
Also added more unit testing and cleaned up old tests.
Removed functions that were unused outside of tests or used only once.
Change-Id: Iaa59b8705abccf9c4ba082f855da368a0bad8380
Reviewed-on: https://skia-review.googlesource.com/143306
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
Change-Id: I9be9e8d72168c90b681015be0b5f599a6243abd2
Reviewed-on: https://skia-review.googlesource.com/144341
Auto-Submit: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Still need to connect this to ImGui, but this is already useful
Bug: skia:
Change-Id: I925c7a9d6236cb2d865d45d6a68a5709bf2e3df7
Reviewed-on: https://skia-review.googlesource.com/143158
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This uses skcms to convert an image into a PNG with a new color profile.
Change-Id: Iaefdbbfba6f4b85637386569a65355df255b980d
Reviewed-on: https://skia-review.googlesource.com/143709
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
With the upcoming ccpr stroking, this will no longer be the only path
renderer that can handle hairlines.
Bug: skia:
Change-Id: I45b30ccd578bee1388a3a07a234af76a19768de6
Reviewed-on: https://skia-review.googlesource.com/142272
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
It is unused, is becoming a maintainence burden and source of bugs,
and takes up a lot of time on the *SAN bots.
Change-Id: If383eb6e4838ca23140f9e16d518b1bfc655fa12
Reviewed-on: https://skia-review.googlesource.com/143307
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Bug: skia:
Change-Id: I30fed2c0587f36aeccd5e366b823a8b044a371ea
Reviewed-on: https://skia-review.googlesource.com/142164
Commit-Queue: Ruiqi Mao <ruiqimao@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Added P3 configs (tagged surface and SkColorSpaceXformCanvas)
Added logic to tag the output PNGs when using a xform canvas,
so the images look correct in Chrome (and work correctly with
skdiff).
We don't use the gamma_correct tag for much in gold, but only
set it for outputs with a linear transfer function.
Change-Id: Iee713682e5010b0bd3212538a6dcb201ae4e8592
Reviewed-on: https://skia-review.googlesource.com/142170
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Bug: skia:8136
Change-Id: I18c4ad549c52346ebfe23d172597d5da205e5c4d
Reviewed-on: https://skia-review.googlesource.com/142105
Commit-Queue: Eric Boren <borenet@google.com>
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
This reverts commit 880b9d302f.
Reason for revert: Appears to be breaking serialization.
See https://ci.chromium.org/raw/build/logs.chromium.org/skia/20180718T201711.486335899Z_000000000077bbff/+/annotations
Original change's description:
> Add kAAHairline to GpuPathRenderers
>
> With the upcoming ccpr stroking, this will no longer be the only path
> renderer that can handle hairlines.
>
> Bug: skia:
> Change-Id: Idf2543f053c8603c80fcd647ca18ffd9860a85f3
> Reviewed-on: https://skia-review.googlesource.com/142246
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
TBR=brianosman@google.com,csmartdalton@google.com
Change-Id: I1967c2cf6b1f1307270bf62bb04130cdf84317b7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/142280
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>