The argument is unused (and in future CLs will be removed entirely)
Bug: skia:
Change-Id: Iec6b757992f7e27d8f929b000227ec5bd3a8f8d5
Reviewed-on: https://skia-review.googlesource.com/c/161841
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
One less SkCanvas subclass to deal with...
Change-Id: I21e81648026be5d732e8d9a28baed55015492a04
Reviewed-on: https://skia-review.googlesource.com/c/161584
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
We were potentially using different keys for lookup vs. add, because we
were adding with a key based on the pixelRef, which may not have the
same uniqueID as the originating image.
Bug: skia:
Change-Id: Ib4d3d5ead9f5a574cf6d1920080bc9c4ae66c1d0
Reviewed-on: https://skia-review.googlesource.com/c/161625
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Bug: skia:8461
According to skbug.com/7069, we should allow GIFs to use a transparent
index outside of the range of the color table. Add a test to verify
support for this.
The GIF is 2x2 with the following pixels:
-------------------------------------------------
| black | white |
-------------------------------------------------
| transparent | transparent |
-------------------------------------------------
The color table only has 2 entries (black and white), and the
transparent index is 2.
Change-Id: I16574a61e2982b6628c3eca96cb7b3e1f57d3b2a
Reviewed-on: https://skia-review.googlesource.com/c/161561
Reviewed-by: Nigel Tao <nigeltao@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
Auto-Submit: Leon Scroggins <scroggo@google.com>
Pathops uses a template to intersect a pair of curves.
This generates six copies: quad/quad, quad/conic, quad/cubic,
conic/conic, conic/cubic, cubic/cubic.
This CL rewrites the template to generate a single copy,
and leverages a new abstract class, SkTCurve, to dispatch
to one of SkTQuad, SkTConic, or SkTCubic. These classes
are thin wrappers on the existing double curves classes
SkDQuad, SkDConic, and SkDCubic, which do work.
Kevin's BuildStats bot says this saves around 180K on the
release build. Running pathops_unittest shows no significant
performance difference, and the smaller version may be
slightly faster.
Bug: skia:
Change-Id: I17f94fd57a317035bc105cd43a06be6da9541cb6
Reviewed-on: https://skia-review.googlesource.com/c/161146
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Cary Clark <caryclark@skia.org>
Also remove the unit tests that were enforcing those rules,
and the blacklist of that unit test.
Bug: skia:
Change-Id: I802c9e81a412fe0b19d02f9224b801f4fbd901f2
Reviewed-on: https://skia-review.googlesource.com/c/161562
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
This reverts commit 031ca213e0.
Reason for revert: breaking angle surfacetest unit test
Original change's description:
> Stop using color space xform canvas in picture image generator
>
> Direct rasterization should produce similar (or identical) results.
> See: https://chromium-review.googlesource.com/c/chromium/src/+/1273815
>
> Bug: skia:
> Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
> Change-Id: I252ec5d5ecb19704f33c0f6cb65d12c2ec927c1d
> Reviewed-on: https://skia-review.googlesource.com/c/161140
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Mike Klein <mtklein@google.com>
TBR=mtklein@google.com,brianosman@google.com
Change-Id: Ib5667f0d315c4f2877c1f0c38e9c62d37335d511
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
Reviewed-on: https://skia-review.googlesource.com/c/161560
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
The previous version would reject valid configs (like non-N32 8888).
This changes the results of some unit tests:
- Creating a zero-sized canvas via MakeRasterDirect now fails (like
it would if you tried to create a zero-sized surface).
- The picture image generator can now produce BGRA and RGBA results,
regardless of N32, and can produce unpremul.
Bug: skia:
Change-Id: Ifd9fe98adf56748f73eaea01118c928b0a13606b
Reviewed-on: https://skia-review.googlesource.com/c/161120
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This reverts commit 9ff04c00f3.
Bug: skia:
Change-Id: If35b2f6ea306f93d01350e7bd2de1756935fcc32
Reviewed-on: https://skia-review.googlesource.com/c/160840
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This reverts commit 274a89e0f5.
Reason for revert: Failing unit tests
Original change's description:
> Include color type and color space in bitmap cache key
>
> Lazy images will soon support decoding to multiple color types and
> color spaces. To avoid cache collisions, we need to fold the decoded
> color type and color space into the key.
>
> To avoid storing multiple (different) bitmaps with the same gen ID,
> stop propagating the image's ID to the one allocated in the cache.
>
> Bug: skia:
> Change-Id: I06714725d4309ec813b75e42cc76eda2cda3d2e0
> Reviewed-on: https://skia-review.googlesource.com/c/160380
> Reviewed-by: Mike Klein <mtklein@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>
TBR=mtklein@google.com,brianosman@google.com,reed@google.com
Change-Id: I6c5834b5b65b85dbb7661f526920d9a140ba5737
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/160801
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Lazy images will soon support decoding to multiple color types and
color spaces. To avoid cache collisions, we need to fold the decoded
color type and color space into the key.
To avoid storing multiple (different) bitmaps with the same gen ID,
stop propagating the image's ID to the one allocated in the cache.
Bug: skia:
Change-Id: I06714725d4309ec813b75e42cc76eda2cda3d2e0
Reviewed-on: https://skia-review.googlesource.com/c/160380
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Bug: skia:
Change-Id: I6896df2f46d530afbda752894a3fc414ade661df
Reviewed-on: https://skia-review.googlesource.com/c/159521
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This should trim the code size of a WASM CanvasKit by 10-20KB.
Bug: skia:
Change-Id: Ibf0f8596c04e891e8f7cbc2fa4f1d1852f7cb462
Reviewed-on: https://skia-review.googlesource.com/c/159261
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Coping paints take significant time. The ApplyFontToPaint
idiom requires a copy and a dtor. This CL keeps the paint and
font in parallel through the code until a paint is actually
needed, then a special ctor is used to create it.
Also, inline a bunch of text blob calls that were showing up
in perf.
Change-Id: I7da746a287e4d3942e45e9536ef9acdc64f084d4
Reviewed-on: https://skia-review.googlesource.com/c/159222
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
- We always read from (0, 0), even if the subset had a different origin
- We also cached the results ignoring the origin, so future reads of
same-sized but differently positioned subsets could return previous
and wrong bitmaps.
Added a unit test that checks for both behaviors. Originally, both
asserts triggered. Adjusting the origin in readPixels, the first assert
was fixed, but the second continued to trigger. Adding the full subset
rect to the bitmap cache key fixed the second assert.
Bug: skia:8448 skia:8449
Change-Id: Ic6e8c0976bd59e86827be89105bd02845ad0d7cd
Reviewed-on: https://skia-review.googlesource.com/c/159981
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
All special images use proxies, so this test was now identical to the
one right above it.
Bug: skia:
Change-Id: Id0358ed2417269d2f26fd255ed192e0ccbd9bcaf
Reviewed-on: https://skia-review.googlesource.com/c/159943
Auto-Submit: Brian Osman <brianosman@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Looks like this was accidentally renamed as part of
https://codereview.chromium.org/1885623002
Bug: skia:
Change-Id: Ie38d8e3e64d11f0bcbe388622f0b96b2672cd8b0
Reviewed-on: https://skia-review.googlesource.com/c/159663
Auto-Submit: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
We noticed a hash collision scenario we'd like to avoid, and it looks
pretty easy. The new test failed on my desktop at both asserts,
depending on whether I build 32- or 64-bit, and also on my
CRC-supporting phone. The Murmur3 path should be fine.
Change-Id: I005de38d68f9b0461536c29e48cf7e5be5caac3e
Reviewed-on: https://skia-review.googlesource.com/c/159621
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Convert GrConstColorProcessor to store SkPMColor4f
Bug: skia:
Change-Id: I6c505856653a02e576ae11fca59dc307545437f7
Reviewed-on: https://skia-review.googlesource.com/c/159152
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
It's been driving me nuts that I can't just write `SkMatrix44 m;`,
and I often don't care whether it's initialized or not. The default
identity constructor would be nice to use, but it's deprecated.
By tagging this constructor deprecated, we're only hurting ourselves;
our big clients disable warnings about deprecated routines and use it
freely.
A quick tally in Skia shows we mostly use the uninitialized constructor,
but sometimes the identity constructor, and there is a spread of all
three in Chromium. So I've left the two explicit calls available.
I switched a bunch of calls in Skia to use the less verbose constructor
where it was clear that it didn't matter if the matrix was initialized.
Literally zero of the kUninitialized constructor calls looked important
for performance, so the only place I've kept is its lone unit test.
A few places read clearer with an explicit "identity" to read.
Change-Id: I0573cb6201f5a36f3b43070fb111f7d9af92736f
Reviewed-on: https://skia-review.googlesource.com/c/159480
Reviewed-by: Brian Osman <brianosman@google.com>
There's one more to replace in Chromium,
then the method and cached SkMatrix44 can go.
Change-Id: I20cfac8b7bd26216f66f6d70fa9d117d0b17cee5
Reviewed-on: https://skia-review.googlesource.com/c/159302
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Bug: skia:
Change-Id: I5e40d9c334c959e1a777251e1ac25f3703f9b7f9
Reviewed-on: https://skia-review.googlesource.com/c/159327
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Bug: skia:
Change-Id: I3ff965644a0a59af1e2a2b1ea226a1417a234ced
Reviewed-on: https://skia-review.googlesource.com/c/158342
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
This object is now redundant with fEncodedInfo. It holds an
SkColorSpace, which is never used now that SkCodec uses skcms.
SkCodec::getInfo() no longer returns a reference, but creates an
SkImageInfo from the SkEncodedInfo the same way fSrcInfo was
previously created.
Add SkCodec::bounds() and ::dimensions() to replace calling these
methods on getInfo().
Remove srcInfo from SkMaskSwizzler::Create, which just wants to know
whether the src is opaque.
Remove the srcColorType from conversionSupported. Only the base class
version used it. Make it look at fEncodedInfo.color() instead.
Bug: skia:6839
Bug: chromium:887372
Change-Id: I2c0583cae76121211c1a6b49979972fa86daf077
Reviewed-on: https://skia-review.googlesource.com/c/157563
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
We'd really like to converge on SkRGBA4f everywhere. This CL continues
to store GrColor4f in the GPU backend, but changes the constantColor
optimization logic to use SkPMColor4f.
GrColor[4f] have "unknown" alpha type, but in this context, they are
nearly always premul, so let's take advantage of our SkRGBA4f type
safety. We lose some of the semantic benefits and helpers that are
present in GrColor4f (OpaqueWhite, TransparentBlack).
The biggest thing that would probably help is a direct path to/from
bytes (GrColor).
Bug: skia:
Change-Id: Ic0838ad3f95d207163b3af51e5f5cf6f499c2047
Reviewed-on: https://skia-review.googlesource.com/157840
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Moves SkBitmap to base64 uri code into test utils
Bug: skia:
Change-Id: I4f92761fd2e643c38ed00a200b1cb62778a85948
Reviewed-on: https://skia-review.googlesource.com/158340
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Also adds support for uint32_t CLI flags, parsed as octal, hex, or dec.
Bug: skia:
Change-Id: I87112beb6506a65d6f541c7ca4cfb38641d55aa5
Reviewed-on: https://skia-review.googlesource.com/158040
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
After sk_imageinfo was initially created, we have added a colorspace to it,
and that object is a smart-pointer. In response to that, this CL upgrades
imageinfo to an "object" (like paint), so we can manage the ref-counting of
its colorspace, and to allow for future changes/expansion (like paint).
Bug: skia:
Change-Id: I629ff99c0820fdbe83f062d9fb768c15cda68e18
Reviewed-on: https://skia-review.googlesource.com/157156
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Converts GrResourceProvider::Flags and GrResourceCache::ScratchFlags
to "enum class" and fixes a case where we were accidentally using the
wrong type of flag. Makes sure to allocate GrSWMaskHelper proxies with
kNoPendingIO.
Bug: skia:8351
Change-Id: Ibcaa26314a53d0cb31ae22915ab94ab0fc07e76d
Reviewed-on: https://skia-review.googlesource.com/157280
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Adds an interface for the document creator to pass in a tree
of tags indicating the structure of the document, each with a type
(from a predetermined enum of possible types) and a node ID.
It also adds a setNodeId function to SkCanvas so that page content
can be associated with a particular tag. If both the tag tree and
marked content are present, Skia can now output a properly tagged
PDF.
An example program is included. When used properly, the PDF generated
by this patch is valid and the tags are parsed properly by Adobe
Acrobat. It handles many corner cases like content that spans more
than one page, or tags that don't correspond to any marked content, or
marked content that doesn't correspond to any tags.
However, it doesn't implement all of the features of PDF accessibility
yet, there are some additional attributes that can be associated with
some tags that need to be supported, too, in order to properly tag
things like figures and tables.
Bug: skia:8148
Change-Id: I2e448eca8ded8e1b29ba685663b557ae7ad7e23e
Reviewed-on: https://skia-review.googlesource.com/141138
Reviewed-by: Hal Canary <halcanary@google.com>
Spoiler alert... it doesn't.
Bug: oss-fuzz:10488
Change-Id: Ifafd92f40aed55ff14a5198ea7d79a20751e40aa
Reviewed-on: https://skia-review.googlesource.com/156661
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This template is only used in practice for SkBitmaps. There is already a
public API that does the same thing, so there's no need for this one.
Change-Id: I20b10aa8bc87a56face947689e1f0eaf4c3cc4e8
Reviewed-on: https://skia-review.googlesource.com/156540
Reviewed-by: Hal Canary <halcanary@google.com>
Auto-Submit: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
This is a reland of f3ebd312f2
PS 2: use faster half->float routine
PS 3: relax tolerance to 2^-10 for half, keeping others 2^-12
Original change's description:
> add getAlphaf() to pixmap/bitmap
>
> Convenient for just extracting alpha (and more efficient than getColor()) and
> works for super-normal formats w/o loss of precision.
>
> Somewhat inspired by examining multiple chrome call-sites for getColor(), where
> chrome only really cared about the alpha. This new method runs about twice
> as fast as getColor() for the simple cases (i.e. no colorspace xforms), and
> even faster in the complex cases (since retrieving alpha doesn't care about
> colorspaces).
>
> Bug: skia:
> Change-Id: I7cd5a2c7f78de781aaa69dd1aa0dba3c532fcb73
> Reviewed-on: https://skia-review.googlesource.com/155606
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Mike Klein <mtklein@google.com>
Cq-Include-Trybots: skia.primary:Test-Android-Clang-Nexus7-CPU-Tegra3-arm-Debug-All-Android,Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-SK_CPU_LIMIT_SSE2,Test-Debian9-GCC-GCE-CPU-AVX2-x86_64-Release-All,Test-Win2016-MSVC-GCE-CPU-AVX2-x86_64-Release-All,Test-Win8-Clang-Golo-CPU-AVX-x86_64-Debug-All
Bug: skia:
Change-Id: Ie94e5c89e185fde12cbd6c56ed4026c4dc5a1623
Reviewed-on: https://skia-review.googlesource.com/156242
Commit-Queue: Ravi Mistry <rmistry@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Added SkColor4f premul/unpremul that just return SkColor4f.
Renamed existing premul to toPM4f. For many uses of SkPM4f,
conversion to pure SkColor4f code was simple. In all other
cases, continue to use SkPM4f for now.
Also convert usage of one-off SkRGBAf class in SkPatchUtils,
and delete that class, along with some truly tautological
unit tests that were the only thing keeping some PM4f API
around.
Bug: skia:
Change-Id: I344c3290ee7af6bbe86c3ff74a2df2f5e87afa38
Reviewed-on: https://skia-review.googlesource.com/156005
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
This reverts commit f3ebd312f2.
Reason for revert: unhappy bots
Original change's description:
> add getAlphaf() to pixmap/bitmap
>
> Convenient for just extracting alpha (and more efficient than getColor()) and
> works for super-normal formats w/o loss of precision.
>
> Somewhat inspired by examining multiple chrome call-sites for getColor(), where
> chrome only really cared about the alpha. This new method runs about twice
> as fast as getColor() for the simple cases (i.e. no colorspace xforms), and
> even faster in the complex cases (since retrieving alpha doesn't care about
> colorspaces).
>
> Bug: skia:
> Change-Id: I7cd5a2c7f78de781aaa69dd1aa0dba3c532fcb73
> Reviewed-on: https://skia-review.googlesource.com/155606
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Mike Klein <mtklein@google.com>
TBR=mtklein@google.com,reed@google.com
Change-Id: I82ce00c09d16bf3e9b04f1c1bccd8cc6aa706ab2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/156000
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Convenient for just extracting alpha (and more efficient than getColor()) and
works for super-normal formats w/o loss of precision.
Somewhat inspired by examining multiple chrome call-sites for getColor(), where
chrome only really cared about the alpha. This new method runs about twice
as fast as getColor() for the simple cases (i.e. no colorspace xforms), and
even faster in the complex cases (since retrieving alpha doesn't care about
colorspaces).
Bug: skia:
Change-Id: I7cd5a2c7f78de781aaa69dd1aa0dba3c532fcb73
Reviewed-on: https://skia-review.googlesource.com/155606
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Bug: skia:
Change-Id: I94defb54899bba4c2ef54bc970d5f35d12073788
Reviewed-on: https://skia-review.googlesource.com/155923
Auto-Submit: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Bug: skia:
Change-Id: I6a06b2ff951b9a1319c40b16b33840e220fecc37
Reviewed-on: https://skia-review.googlesource.com/155900
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>