On certain iOS devices half has a mantissa of only 10 bits, which is not
enough to perform the floating point trickery to get the lower bits
out of the "texture coordinates". Instead we use int if available, and
float if not available.
Also re-enables multitexturing for iOS and adds a sample which
stresses the issue.
Bug: skia:7285
Change-Id: I365532c7cbbcca7c7753af209bef46e05be49e11
Reviewed-on: https://skia-review.googlesource.com/71181
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Re-enable the code to test the emboss mask filter, updating it to use
the new emboss mask filter factory.
Add a test to ensure that embossed text is drawn correctly, as before
glyphs did not allocate the proper amount of memory for the k3D_Format
which the emboss mask filter produces.
Fixes SkEmbossMask::Emboss to write the whole of the mul and add planes
to avoid pixel differences and MemorySanitizer errors.
Update the GPU to understand the k3D_Format and use just the alpha
plane, ignoring the mul and add plane which it currently cannot support.
Change-Id: I90edf34a918c06b0c6b24bfc43ce7031419eca41
Reviewed-on: https://skia-review.googlesource.com/70260
Reviewed-on: https://skia-review.googlesource.com/70962
Reviewed-on: https://skia-review.googlesource.com/71282
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
This reverts commit 1662257bda.
Reason for revert: Android still using this API
Original change's description:
> Alloc glyph image correctly for SkMask::k3D_Format.
>
> Remove the no longer used outside Skia SK_SUPPORT_LEGACY_EMBOSSMASKFILTER
> define, and either delete the code it guards or update it to use the new
> emboss mask filter factory.
>
> Re-enable the code to test the emboss mask filter.
>
> Add a test to ensure that embossed text is drawn correctly, as before
> glyphs did not allocate the proper amount of memory for the k3D_Format
> which the emboss mask filter produces.
>
> Fixes SkEmbossMask::Emboss to write the whole of the mul and add planes
> to avoid pixel differences and MemorySanitizer errors.
>
> Update the GPU to understand the k3D_Format and use just the alpha
> plane, ignoring the mul and add plane which it currently cannot support.
>
> Change-Id: Icac1a3f37d6e8c6be3151df570f5e14111e18585
> Reviewed-on: https://skia-review.googlesource.com/70260
> Reviewed-by: Herb Derby <herb@google.com>
> Reviewed-on: https://skia-review.googlesource.com/70962
> Commit-Queue: Ben Wagner <bungeman@google.com>
TBR=djsollen@google.com,bungeman@google.com,herb@google.com
Change-Id: Id6625bae8d3bd70ce7aa3045348c04fdd146c637
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/71183
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Remove the no longer used outside Skia SK_SUPPORT_LEGACY_EMBOSSMASKFILTER
define, and either delete the code it guards or update it to use the new
emboss mask filter factory.
Re-enable the code to test the emboss mask filter.
Add a test to ensure that embossed text is drawn correctly, as before
glyphs did not allocate the proper amount of memory for the k3D_Format
which the emboss mask filter produces.
Fixes SkEmbossMask::Emboss to write the whole of the mul and add planes
to avoid pixel differences and MemorySanitizer errors.
Update the GPU to understand the k3D_Format and use just the alpha
plane, ignoring the mul and add plane which it currently cannot support.
Change-Id: Icac1a3f37d6e8c6be3151df570f5e14111e18585
Reviewed-on: https://skia-review.googlesource.com/70260
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-on: https://skia-review.googlesource.com/70962
Commit-Queue: Ben Wagner <bungeman@google.com>
This reverts commit 6b26deb8d6.
Reason for revert: GPU bots failing
Original change's description:
> Alloc glyph image correctly for SkMask::k3D_Format.
>
> This removes the no longer used outside Skia
> SK_SUPPORT_LEGACY_EMBOSSMASKFILTER define, and either deletes the code
> it guards or updates it to use the new emboss mask filter factory. This
> re-enables the code to test the emboss mask filter. Also added is a test
> to ensure that embossed text is drawn correctly, as before this glyphs
> did not allocate the proper amount of memory for the k3D_Format which
> this mask filter produces. This also fixes SkEmbossMask::Emboss to write
> the whole of the mul and add planes to avoid pixel differences and
> MemorySanitizer errors.
>
> Change-Id: Ib492c72a19d6a27d140e3cd48179a3ca9ce313f5
> Reviewed-on: https://skia-review.googlesource.com/70260
> Commit-Queue: Ben Wagner <bungeman@google.com>
> Reviewed-by: Herb Derby <herb@google.com>
TBR=djsollen@google.com,bungeman@google.com,herb@google.com,reed@google.com
Change-Id: I8a9db6c00e0cb84bdd4833474a9ffffa6ecc606c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/70920
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
This removes the no longer used outside Skia
SK_SUPPORT_LEGACY_EMBOSSMASKFILTER define, and either deletes the code
it guards or updates it to use the new emboss mask filter factory. This
re-enables the code to test the emboss mask filter. Also added is a test
to ensure that embossed text is drawn correctly, as before this glyphs
did not allocate the proper amount of memory for the k3D_Format which
this mask filter produces. This also fixes SkEmbossMask::Emboss to write
the whole of the mul and add planes to avoid pixel differences and
MemorySanitizer errors.
Change-Id: Ib492c72a19d6a27d140e3cd48179a3ca9ce313f5
Reviewed-on: https://skia-review.googlesource.com/70260
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Move specialized SkPoint methods to SkPointPriv.
Use constexpr and inline initialization where possible.
R=reed@google.com,bsalomon@google.com
Bug: skia: 6898
Change-Id: I01ec5186f010f2dc80c068c70d9cc352f3221338
Reviewed-on: https://skia-review.googlesource.com/68700
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ravi Mistry <rmistry@google.com>
--portableFonts exists but does nothing.
--resourceFonts doesn't even exist.
Change-Id: I7880208de4aaa9674ba720b9e70c34c145561ac0
Reviewed-on: https://skia-review.googlesource.com/67800
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Defers the transformation to normalized window coordinates until after
the geometry shader. Merges vertex and a geometry shader builders into
a single compilation unit with a common base class. Updates CCPR
geometry shaders accordingly.
Bug: skia:
Change-Id: If93c90e978b1fdc7120febd05cfb05810fd496b5
Reviewed-on: https://skia-review.googlesource.com/62980
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
The closeWindow function does not guarantee the calling of
~SampleWindow (in Windows and Mac). So we print the info earlier.
Bug: skia:
Change-Id: Ib8b11cac4fb2fc7b62a02c7fb7f3aaaa48df2da6
Reviewed-on: https://skia-review.googlesource.com/63140
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Yuqian Li <liyuqian@google.com>
- Use capital letters avoid conflict with built-in commands,
particularly zoom-window ('z') and toggle-backend ('d').
- Increase kHitToleranace for touch screens.
Bug: skia:
Change-Id: I6feaabd8aa06600bdeb4623ab081d973369c4841
Reviewed-on: https://skia-review.googlesource.com/52528
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Cary Clark <caryclark@google.com>
This is a quick-and-dirty solution to select color mode, backend, etc.
from the command line.
e.g. 'out/Debug/SampleApp --keys CCd' for opengl and srgb
Bug: skia:
Change-Id: I61f9e0fd4209a5fadb585c02c71984398f2f0860
Reviewed-on: https://skia-review.googlesource.com/61482
Reviewed-by: Yuqian Li <liyuqian@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Recent clang versions produce output like
../../samplecode/SampleAll.cpp:306:27:
error: redundant parentheses surrounding declarator
[-Werror,-Wredundant-parens]
Remove these to clean up the code a bit.
Change-Id: Ib099201f23f83cd712487c238b6a508290e667a7
Reviewed-on: https://skia-review.googlesource.com/60822
Commit-Queue: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Decouples geometry generation and analytic coverage. This paves the
way for a vertex shader implementation.
TBR=egdaniel@google.com
Bug: skia:
Change-Id: I2a183401bfe70b9f14b9b1cf035de6020a2135fa
Reviewed-on: https://skia-review.googlesource.com/60103
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
This reverts commit e501033bbd.
Reason for revert: Broke several bots
Original change's description:
> Refactor CCPR coverage shaders for a vertex impl
>
> Decouples geometry generation and analytic coverage. This paves the
> way for a vertex shader implementation.
>
> Bug: skia:
> Change-Id: I23b79d4397db22bd8fc063b8dfca58ab00037292
> Reviewed-on: https://skia-review.googlesource.com/59200
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>
TBR=egdaniel@google.com,csmartdalton@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: skia:
Change-Id: I314bf03fa6cbeceb1c527d4d9464147b2e8464c6
Reviewed-on: https://skia-review.googlesource.com/59821
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Eric Boren <borenet@google.com>
Decouples geometry generation and analytic coverage. This paves the
way for a vertex shader implementation.
Bug: skia:
Change-Id: I23b79d4397db22bd8fc063b8dfca58ab00037292
Reviewed-on: https://skia-review.googlesource.com/59200
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Adds the flag and a disables caching on the CCPR bots.
Bug: skia:
Change-Id: Icb85e77f89634dda1d419dacac5b8a93340723f0
Reviewed-on: https://skia-review.googlesource.com/59740
Reviewed-by: Eric Boren <borenet@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Also adds a presubmit to prevent adding trailing whitespace to source
code in the future.
Change-Id: I41a4df81487f6f00aa19b188f0cac6a3377efde6
Reviewed-on: https://skia-review.googlesource.com/57380
Reviewed-by: Ravi Mistry <rmistry@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Newer clang versions report
../../samplecode/SampleLua.cpp:44:13: error:
'~LuaView' overrides a destructor but is not marked 'override'
[-Werror,-Winconsistent-missing-destructor-override]
Change-Id: I6f3e69482a79e9580e51b957fff06e6d4d270735
Reviewed-on: https://skia-review.googlesource.com/57164
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
So we can benchmark with given width/height dimensions.
Bug: skia:
Change-Id: I881c9f054cdcecc3e0b2bfb600afd778e1c57d95
Reviewed-on: https://skia-review.googlesource.com/51246
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Yuqian Li <liyuqian@google.com>
Make Chinese fling sample closer to Android test.
Fix a bug in GrDrawOpAtlas::compact(), where the atlas
generation wasn't incremented so the client didn't know it changed.
Add some debug info for GrDrawOpAtlas.
Add a comment in GrDrawOpAtlas::setLastUseTokenBulk.
Change-Id: I79192a017870541a79731b1a22f665ec5deeff09
Reviewed-on: https://skia-review.googlesource.com/52761
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Bug: skia:
Change-Id: I9302491c983fae5e2e84edc4ee135a917b099a42
Reviewed-on: https://skia-review.googlesource.com/52360
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
This reverts commit 88757dacd4.
Reason for revert: Still seems to be failing Chromium "telemetry_perf_unittests (with patch) on Android" on android_n5x_swarming_rel.
Original change's description:
> guard old apis for querying byte-size of a bitmap/imageinfo/pixmap
>
> Now with legacy behavior for allocpixels
>
> This was reverted, so the current CL is a "fix" on top of ...
> https://skia-review.googlesource.com/c/skia/+/50980
>
> Related update to Chrome (in preparation for this change)
> https://chromium-review.googlesource.com/c/chromium/src/+/685719
>
> Bug: skia:
> Change-Id: I4b370ee7e95083ab27421f008132219c9c7b86e9
> Reviewed-on: https://skia-review.googlesource.com/51341
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Mike Reed <reed@google.com>
TBR=fmalita@chromium.org,reed@google.com
Change-Id: I827a0ca1d1e3909e648fde3342cdb8601d34da8d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/52381
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
This reverts commit 98a6216b18.
Reason for revert: breaking the chrome roll. Looks like they may be writing data to create an image across all the row bytes and thus writing to unalloced data on the last row. Link to example failing bot:
https://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/539960
Original change's description:
> guard old apis for querying byte-size of a bitmap/imageinfo/pixmap
>
> Previously we had size_t and uint64_t variations.
>
> The new (simpler) API always..
> - returns size_t, or 0 if the calculation overflowed
> - returns the trimmed size (does not include rowBytes padding for the last row)
>
> Bug: skia:
> Change-Id: I05173e877918327c7b207d2f7f1ab0db36892e2e
> Reviewed-on: https://skia-review.googlesource.com/50980
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Reviewed-by: Leon Scroggins <scroggo@google.com>
TBR=mtklein@google.com,herb@google.com,scroggo@google.com,fmalita@chromium.org,reed@google.com
Change-Id: I726f6ab1b36b14979ba6f37105e0a469b3f0dbc0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/51262
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Previously we had size_t and uint64_t variations.
The new (simpler) API always..
- returns size_t, or 0 if the calculation overflowed
- returns the trimmed size (does not include rowBytes padding for the last row)
Bug: skia:
Change-Id: I05173e877918327c7b207d2f7f1ab0db36892e2e
Reviewed-on: https://skia-review.googlesource.com/50980
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Removes the mode that generates edge and hull geometry simultaneously
from the geometry shader. Perf was hit and miss and it's not
compatible with vertex shaders. We can revisit if geometry shaders
still show promise on some platforms after a vertex shader impl is
finished.
Bug: skia:
Change-Id: I984231e9a5bb60fe31d3ba280c7390a74aa5bc27
Reviewed-on: https://skia-review.googlesource.com/51300
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Bug: chromium:712455
Change-Id: Ic9bb9b862abe01f112cc41d28589733460b15bc1
Reviewed-on: https://skia-review.googlesource.com/50181
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
This way, we may be able to use SampleApp as a performance benchmark
tool that's closer to real-world use cases than nanobench.
For example, we can now run
./out/Release/SampleApp --slide Chart --backendTiles 8 --measureMS 2000
to test the threaded backend.
Bug: skia:
Change-Id: I92b177624bc8d16c5b4d3ad122319882e8783101
Reviewed-on: https://skia-review.googlesource.com/50801
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Yuqian Li <liyuqian@google.com>
Bug: skia:6173
Change-Id: I21042d484d9a7b3eee04aa3301d9793d00ad6908
Reviewed-on: https://skia-review.googlesource.com/48183
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Bug: skia:
Change-Id: I1fd78b495e2f087096ad5b5db36c15a16514409c
Reviewed-on: https://skia-review.googlesource.com/43160
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Avoids the need for MSAA cubic borders by chopping up the cubic
geometry and crossing the inflections points and loop intersections
with lines and quadratic(s) instead. This allows us to render the
remaining cubic segments with simple hulls and analytic AA, giving
better image quality and performance.
Bug: skia:
Change-Id: If371229f575ee0286c325c230a116d602a9d38ce
Reviewed-on: https://skia-review.googlesource.com/41883
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Creates a GrCCPRGeometry class that chops contours up into simple
segments that ccpr can render, and rewrites the GPU buffer creation to
be able to handle arbitrary lengths of ccpr geometry.
Bug: skia:
Change-Id: Iaa173a02729e177b0ed7ef7fbb9195d349be689d
Reviewed-on: https://skia-review.googlesource.com/41963
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Otherwise, creating a new thread pool each frame could be a major bottleneck.
Somehow, creating new thread pool each frame is good for measuring FPS, so
that behavior is maintained when fMeasureFPS is true. I'm still doing
experiments with my own schedulers. Once they get more stable, I'll probably
apply their changes to the SkExecutor.
Bug: skia:
Change-Id: Iead96034e0d0abdebb5069dec41215990f71f693
Reviewed-on: https://skia-review.googlesource.com/41845
Commit-Queue: Yuqian Li <liyuqian@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reduce path validation interfaces,
deferring the harder work of rewriting
the callers until later.
R=reed@google.com,enne@chromium.org
Change-Id: Iea56f1cd1be93bb1d96b50836a9bd3cd4872ad23
Reviewed-on: https://skia-review.googlesource.com/37541
Commit-Queue: Cary Clark <caryclark@google.com>
Reviewed-by: Adrienne Walker <enne@chromium.org>
This was created by looking at warnings produced by clang's
-Wzero-as-null-pointer-constant. This updates most issues in
Skia code. However, there are places where GL and Vulkan want
pointer values which are explicitly 0, external headers which
use NULL directly, and possibly more uses in un-compiled
sources (for other platforms).
Change-Id: Id22fbac04d5c53497a53d734f0896b4f06fe8345
Reviewed-on: https://skia-review.googlesource.com/39521
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Enough ccpr-specific geometry code is in flight that it feels like it
should have its own file.
Bug: skia:
Change-Id: I99ef620a7dc35178cf774b3a4ec6159d46f401c7
Reviewed-on: https://skia-review.googlesource.com/39162
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
SkFAIL is a legacy macro which is just SK_ABORT. This CL mechanically
changes uses of SkFAIL to SK_ABORT in preparation for its removal. The
related sk_throw macro will be changed independently, due to needing to
actually clean up its users.
Change-Id: Id70b5c111a02d2458dc60c8933f444df27d9cebb
Reviewed-on: https://skia-review.googlesource.com/35284
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
The artifacts previously thought to require msaa can be handled by
(1) converting near-linear quadratics into lines, and (2) ensuring all
quadratic segments are monotonic with respect to the vector of their
closing edge [P2 -> P0].
No. 1 was already in effect.
No. 2 is implemented by this change.
Now we only fall back on soft msaa for the two corner pixels.
This change also does some generic housekeeping in the quadratic
processor.
Bug: skia:
Change-Id: Ib3309c2ed86d3d8bec5f451125a69326e82eeb1c
Reviewed-on: https://skia-review.googlesource.com/29721
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>