Inside SkOpEdgeBuilder::walk(), when current segment is cubic curve, its shape may be reduced, therefore, the curve points should be determined by the reduction result ‘split->fVerb’ instead of ‘verb’.
Actually, inside this switch case, ‘verb’ is always ‘SkPath::kCubic_Verb’, which makes the ‘fCanAdd’ always true. The outcome of this bug makes the subsequent logic which depends on ‘fCanAdd’ (L301-332) incorrect, and in some cases, fails the whole boolean operation at L329.
The Fiddle below demonstrates how this bug fails a union operation of two paths, by returning an empty path.
https://fiddle.skia.org/c/e528567b62bc338cd99f4a89f0c5342e
Screen shot of the fiddle:
https://www.dropbox.com/s/4bnzlponq6gen27/pathOpsBug.png?dl=0
2nd Fiddle drawing the results (larger)
https://fiddle.skia.org/c/1f2a513c2ee0395b9d05fb1eb987b01f
Change-Id: If07f54cef1b9409f9b6db27d6294a3e3461b0181
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284426
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Change-Id: I9ea41625fd80433f7f6480fe539321d8df7b7930
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/258877
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
While working on creating bindings for dlang, I noticed that there was a
missing call to `sk_imageinfo_delete`, corresponding to the call to
`sk_imageinfo_new` in the c-api example. At first I thought that
`sk_surface_new_raster` (or something else) would free the image info
object internally, but after checking the implementation I saw this was
not the case.
This can be trivially verified with valgrind:
Before this change:
$ valgrind ./skia-c-example 2>&1 | grep 'definitely lost'
==186215== definitely lost: 24 bytes in 1 blocks
After:
$ valgrind ./skia-c-example 2>&1 | grep 'definitely lost'
==185878== definitely lost: 0 bytes in 0 blocks
Test: built and ran skia-c-example.c under valgrind
Change-Id: Ie3fba2e7602341d2f5e7dac198b3ec5923777cbd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/260021
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
Reason-> Skia uses general-purpose pipeline in this case instead of more optimized faster pipeline.
Faster pipeline code was available in older versions of Skia and used to work fine but we removed faster pipeline code to consolidate the code. As discussed offline for us in the office we have significant scenarios running on software, so maintaining software performance is very important for us thus I am bringing this fast path back. To make this work I didn't have to do much, everything was already available, I just had to modify MatirxProcs to accept tilemodex and tilemodeY as parameters and define and configure SkBitmapProcState::MatrixProc GeneralProcs. I have also limited this change to ARM devices
Change-Id: Ie7ea59701d180c2832edb959e8d44047f4085cbf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/252677
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Bharat Ahuja <ahujabharat93@gmail.com>
Auto-Submit: Bharat Ahuja <ahujabharat93@gmail.com>
typename 'B0' is defined in sys/termios.h
Bug: none
Change-Id: I6a2e6eb1a91f123459087280b70493dab795bbd3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/249917
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Before this fix, skia (and thus Chrome) would fail to compile on macOS when the user (developer) had a case-sensitive file-system.
So I've replaced the incorrect includes of <metal/metal.h> by <Metal/Metal.h>
Change-Id: I6ebcc0f46608f6d840d80d18e5f5baf0744a7f16
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/225776
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This will ensure that the headers from the dependencies will have
precedent over system headers, thus preventing situations where system
headers will block dependency headers and prevent compilation.
Change-Id: I0d480a6d3898f2da99cf2706c5335aaac05b4e4d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/220276
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
The 'is' operator is not meant to be used for comparisons. It currently working is an implementation detail of CPython.
CPython 3.8 has added a SyntaxWarning for this.
Bug: chromium:958874
Change-Id: I7657bd3fddf37e849cc30aca34825fa3c0f71b58
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/211663
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Raul Tambre <raul@tambre.ee>
Bug: skia:8243
Change-Id: Ic312a1d87cc2eba8f0fe7f66c16e45c4bfe2ef49
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201540
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
If call attach() first, Viewer::onBackendCreated() calls Window::show().
When WM_PAINT occurs, Viewer::drawSlide() is called, where a crash occurs using an uninitialized fCurrentSlide.
Bug: skia:https://bugs.chromium.org/p/skia/issues/detail?id=8792
Change-Id: I22ba6479052cb66e08d8bc2a94539473e899b604
Reviewed-on: https://skia-review.googlesource.com/c/195240
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
The method `SkSVGCanvas::Make(const SkRect& bounds, SkWStream* writer)`
passes a pointer to a stack-allocated object to the returned SkCanvas.
TBR=
Change-Id: Ica7933adc59764a69eb2fb6312df91ffffd5627b
Reviewed-on: https://skia-review.googlesource.com/c/192040
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Bug: skia:
Change-Id: I7723a545d2f5ed78f6637aa9b8990e28785f86fb
Reviewed-on: https://skia-review.googlesource.com/c/182191
Auto-Submit: Dawson Coleman <dawsonmcoleman@gmail.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
These changes expose the arc function for SkPath. The ApplyAddArc function is a copy from the PathKit bindings.
Also exposed the PNG and JPEG formats from the SkEncodedImageFormat enum and the SkImage::encodeToData overload that accepts format and quality options. The direct binding of encodeToData was replaced with a pre-js wrapper that calls the appropriate private overload
We are working on a PostCSS conic gradient polyfill plugin and want to use the CanvasKit to generate it.
Problem is - it lacks the arc function that technically exists but isn't exposed. And it would be really great to have encodeToData with options since generated PNGs are quite large.
More details on the issue can be found here: https://github.com/jonathantneal/postcss-conic-gradient/issues/10R=kjlubick@google.com
Bug: skia:
Change-Id: I3f1dc88ad308369fe62004080bcc196c4fbbf742
Reviewed-on: https://skia-review.googlesource.com/c/171046
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
SkVertices::Builder uses custom new operator but not exposed to dll.
While delete operator in SkVertices.h could be inlined, it causes crash on Windows DLL builds. This patch fixes this issue.
Change-Id: I8b635ad3aa4a3f496a392ce7840417947999e4b0
Reviewed-on: https://skia-review.googlesource.com/122480
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Pass extra assembler flags to the asm tool in msvc toolchain
My first commit so added my name to the AUTHORS file.
Change-Id: I19529a901be6d9c00df3c0880003be3363475c6e
Reviewed-on: https://skia-review.googlesource.com/114740
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This CL implements |SkSVGDevice::drawAnnotation|, overridden from
|SKBaseDevice|. |drawAnnotation| supports annotating rectangular areas
of a Skia device. Previous to this change, annotations are being used
in |SkPDFDevice| to include hyperlinked rectangular areas in .pdf
documents. This CL implements the SVG equivalent of this PDF feature.
BUG=skia:7581
Docs-Preview: https://skia.org/?cl=104680
Change-Id: I92ae01ceb7ae10cd2010bebab2a58dcfe48ef253
Reviewed-on: https://skia-review.googlesource.com/104680
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Mostly just formatting fixes with a few grammatical changes.
Two real notable changes:
- Removed references to SkGLCanvas from Tips & FAQ and replaced with
references to `SkDevice` and `SkSurface`.
- Deleted deprecated "Quick Start Guides" folder
Docs-Preview: https://skia.org/?cl=92361
Bug: skia:
Change-Id: Ief790b1c2bae8fe0e39aa8d66c79f80560d18c9e
Reviewed-on: https://skia-review.googlesource.com/92361
Reviewed-by: Heather Miller <hcm@google.com>
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
Commit-Queue: Joe Gregorio <jcgregorio@google.com>
SkCodec class has the fStartedIncrementalDecode field, which is not
initialized on construction, but may be used in incrementalDecode
method being uninitialized.
Bug: skia:
Change-Id: I378412a375100ad2df4aa38f2dd5682867e0e34b
Reviewed-on: https://skia-review.googlesource.com/53160
Commit-Queue: Heather Miller <hcm@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
This change is just to add support for building for tvOS.
It is exactly the same as iOS, just using a different SDK.
I had to change the two lines for libjpeg-turbo so that
it will run for both tvOS and iOS.
BUG=skia:
Change-Id: I6ae5fc4257df74c0f321e5d2d71584f6a52ec3a6
Reviewed-on: https://skia-review.googlesource.com/9660
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
cropBitmap returns 'true' on success and 'false' on failure.
Propagate its return value so that cascading failures can be avoided.
Signed-off-by: Mykola Kondratenko <mykola.kondratenko@sonymobile.com>
BUG=skia:
Review URL: https://codereview.chromium.org/1088093003
The GIF decoder, in the onDecode() function, tries to obtain the
transparency info from the temporary SavedImage object, temp_save,
but the decoder had been changed to save extension block data to
the GifFileType object instead. As a result, find_transpIndex() can't
find the correct transaprency index and returns -1.
This had been reported in Android 4.4. AOSP pulled skia changes
related to giflib 5.x changes after Android 4.3, which is why
the problem is not reproducible in versions before KitKat.
AOSP Issue 62016:
https://code.google.com/p/android/issues/detail?id=62016
BUG=skia:
Review URL: https://codereview.chromium.org/429053004
Reason for revert:
Suspected in DM crashes, e.g.
2033 tasks left 344M peak 843ms tabl-cuteoverload_skp
Signal 11:
_sigtramp (+0x1a)
create_surface(CanvasConfig const&, GrContext*) (+0x1b2)
test_WritePixels(skiatest::Reporter*, GrContextFactory*) (+0x8d4)
skiatest::WritePixelsClass::onRun(skiatest::Reporter*) (+0x21)
skiatest::Test::run() (+0x7c)
DM::GpuTestTask::draw(GrContextFactory*) (+0x8c)
DM::GpuTask::run(GrContextFactory*) (+0xa6)
DM::TaskRunner::wait() (+0x7f)
dm_main() (+0x33f)
main (+0x27)
On all MacMini platforms (the following URL with -Mac{10.6,10.7,10.8}- and -{Debug,Release}):
http://build.chromium.org/p/client.skia/builders/Test-Mac10.6-MacMini4.1-GeForce320M-x86_64-Debug
Original issue's description:
> Add gpu support for Apple specific 'Vertex Arrays' functions
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/af000f469e1b0153ce445c96ca3d20e6d12224ccTBR=bsalomon@google.com,paraboul@gmail.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:
Review URL: https://codereview.chromium.org/750973003
Tested in Mozilla source tree. I tried to use skia build system, but it's up to the task for cross compilation.
SkHRESULT.cpp - Use proper file name (that matters on case sensitive OSes)
SkAtomics_win.h - Don't use pragma intrinsic on GCC (this causes massive warnings)
SkOSFile_win.cpp - This one is tricky. GCC doesn't allow (void*) casts in template argument constants and INVALID_HANDLE_VALUE looks like this:
((HANDLE)(LONG_PTR)-1)
where HANDLE is typedefed to void*. Changed the code to use LONG_PTR as template argument and cast it when needed.
BUG=skia:
R=bungeman@google.com, reed@google.com
Author: cjacek@gmail.com
Review URL: https://codereview.chromium.org/198643004
git-svn-id: http://skia.googlecode.com/svn/trunk@13862 2bbb7eff-a529-9590-31e7-b0007b416f81