Commit Graph

1330 Commits

Author SHA1 Message Date
Jim Van Verth
999ec57291 Use int when possible to calculate atlas indices in shaders.
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>
2017-11-20 18:07:08 +00:00
Ben Wagner
339b84e78c Alloc glyph image correctly for SkMask::k3D_Format.
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>
2017-11-14 17:38:34 +00:00
Brian Osman
3e31e99bab Revert "Alloc glyph image correctly for SkMask::k3D_Format."
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>
2017-11-14 16:16:45 +00:00
Ben Wagner
1662257bda 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>
2017-11-14 14:10:22 +00:00
Ben Wagner
3ae1a307f6 Revert "Alloc glyph image correctly for SkMask::k3D_Format."
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>
2017-11-13 20:43:06 +00:00
Ben Wagner
6b26deb8d6 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>
2017-11-13 20:26:21 +00:00
Cary Clark
df429f3bea move parts of SkPoint to SkPointPriv
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>
2017-11-08 18:25:17 +00:00
Chris Dalton
7c02cc7934 Add clipping options to path text bench and samples
Bug: skia:
Change-Id: I632a2fa5627ef1438d9ab451318a42d12c61b802
Reviewed-on: https://skia-review.googlesource.com/67683
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2017-11-07 01:51:31 +00:00
Mike Klein
97f0bc6a1a clean up cruft about --portableFonts and --resourceFonts
--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>
2017-11-06 15:09:09 +00:00
Mike Reed
ce54bcecc2 -= to control width of fatbits line width
Bug: skia:
Change-Id: Id100ac5c22f5cc878d782d53557c6b37370a2989
Reviewed-on: https://skia-review.googlesource.com/66621
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-11-02 11:05:31 +00:00
Chris Dalton
c17bf32a1b Convert geometry shaders to operate in Skia device space
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>
2017-10-25 15:59:18 +00:00
Yuqian Li
3c31281c32 Print measure info before closeWindow
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>
2017-10-23 21:36:51 +00:00
Chris Dalton
08d1a25073 SampleAAGeometry tweaks
- 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>
2017-10-20 18:17:35 +00:00
Chris Dalton
1d014105ac Add a SampleApp flag to automate keystrokes on startup
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>
2017-10-18 17:25:56 +00:00
Ben Wagner
1a1d2411e8 Remove redundant parentheses.
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>
2017-10-17 22:02:41 +00:00
Chris Dalton
6a3dbeed00 Refactor CCPR coverage shaders for a vertex impl
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>
2017-10-16 20:08:41 +00:00
Eric Boren
d6365e5fb8 Revert "Refactor CCPR coverage shaders for a vertex impl"
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>
2017-10-16 12:53:14 +00:00
Chris Dalton
e501033bbd 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>
2017-10-15 04:13:06 +00:00
Chris Dalton
7a0ebfc033 Add a tooling flag for path mask caching
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>
2017-10-13 22:31:12 +00:00
Ben Wagner
63fd760a37 Remove trailing whitespace.
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>
2017-10-09 21:20:34 +00:00
Ben Wagner
5a96580336 Mark ~LuaView as override.
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>
2017-10-09 14:53:15 +00:00
Mike Reed
f0ffb8943b Revert[4] "guard old apis for querying byte-size of a bitmap/imageinfo/pixmap"
This reverts commit 5a2e50edc5.

Bug: skia:
Change-Id: I8d28b5c07d90130e5a1653923740eaf189ecb954
Reviewed-on: https://skia-review.googlesource.com/53900
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-10-03 20:03:35 +00:00
Mike Reed
5a2e50edc5 Revert "Revert "Revert "guard old apis for querying byte-size of a bitmap/imageinfo/pixmap"""
This reverts commit cd284c5323.

Reason for revert:

assert fired in SkMallocPixelRef.cpp:61: fatal error: "assert(info.computeByteSize(rowBytes) == info.getSafeSize(rowBytes))"

google3 thinks it was from surface_rowbytes

Original change's description:
> Revert "Revert "guard old apis for querying byte-size of a bitmap/imageinfo/pixmap""
> 
> This reverts commit 809cbedd4b.
> 
> Bug: skia:
> Change-Id: I680d8daeeeeb15526b44c1305d8fb0c6bfa38e1d
> Reviewed-on: https://skia-review.googlesource.com/52665
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Florin Malita <fmalita@chromium.org>

TBR=fmalita@chromium.org,reed@google.com

Change-Id: I41e3f7a3f791cc8183291847e783ed8a53bc91d2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/53802
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-10-02 13:44:18 +00:00
Mike Reed
cd284c5323 Revert "Revert "guard old apis for querying byte-size of a bitmap/imageinfo/pixmap""
This reverts commit 809cbedd4b.

Bug: skia:
Change-Id: I680d8daeeeeb15526b44c1305d8fb0c6bfa38e1d
Reviewed-on: https://skia-review.googlesource.com/52665
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2017-10-02 12:55:37 +00:00
Yuqian Li
6e3d9950e3 Add width and height option to SampleApp
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>
2017-09-29 14:21:04 +00:00
Jim Van Verth
c3269aea5b Miscellaneous dynamic atlas fixes.
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>
2017-09-28 19:38:42 +00:00
Chris Dalton
d4124bc232 Add svg support to pathfinder tool
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>
2017-09-28 18:22:40 +00:00
Jim Van Verth
809cbedd4b Revert "guard old apis for querying byte-size of a bitmap/imageinfo/pixmap"
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>
2017-09-27 23:15:07 +00:00
Mike Reed
88757dacd4 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>
2017-09-27 14:36:07 +00:00
Greg Daniel
f46633f8af Revert "guard old apis for querying byte-size of a bitmap/imageinfo/pixmap"
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>
2017-09-26 20:08:07 +00:00
Yuqian Li
58e23039bd Remove unused functions get_preferred_size
Bug: skia:
Change-Id: I6a5b5d96ad48b84b07d2e56fbabb870a90c62a97
Reviewed-on: https://skia-review.googlesource.com/51460
Reviewed-by: Yuqian Li <liyuqian@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Yuqian Li <liyuqian@google.com>
2017-09-26 20:02:16 +00:00
Mike Reed
98a6216b18 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>
2017-09-26 17:07:16 +00:00
Chris Dalton
8d17769700 CCPR: Remove kCombinedTriangleHullsAndEdges
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>
2017-09-26 17:00:06 +00:00
Jim Van Verth
712fe73caf Add animated cowboy sample from WebKit tests, and fix.
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>
2017-09-25 21:14:09 +00:00
Yuqian Li
94fddf8381 Add measurement command line args to SampleApp
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>
2017-09-25 19:12:50 +00:00
Brian Osman
9a725dd948 Use shader based blending to clamp kPlus mode w/F16
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>
2017-09-20 14:28:03 +00:00
Chris Dalton
a640c49b7e Minor cleanups for CCPR
Bug: skia:
Change-Id: Ic4838f0e242ded0c3d0cb5c86715ed67d8152f5c
Reviewed-on: https://skia-review.googlesource.com/44520
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2017-09-12 18:08:21 +00:00
Mike Reed
6bfc274b22 add L565 to our cycle of color configs in sampleapp
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>
2017-09-06 19:33:08 +00:00
Chris Dalton
7f578bf07b CCPR: Remove cubic insets and MSAA borders
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>
2017-09-05 23:06:42 +00:00
Chris Dalton
c1e59638b4 CCPR: Rewrite path parsing
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>
2017-09-05 22:41:12 +00:00
Yuqian Li
ba0ce4b4c6 Let SampleApp provide the thread pool
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>
2017-09-01 18:47:59 +00:00
Cary Clark
0461e9fa44 simplify path validate
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>
2017-08-29 18:37:11 +00:00
Ben Wagner
a93a14a998 Convert NULL and 0 to nullptr.
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>
2017-08-28 17:48:57 +00:00
Chris Dalton
419a94da02 Add a GrCCPRGeometry file
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>
2017-08-28 16:53:27 +00:00
Greg Daniel
500d58b2a6 Make Copy Ops to go through GpuCommandBuffer instead of straigt to GPU.
Bug: skia:
Change-Id: I4eae4507e07278997e26419e94586eef0780c423
Reviewed-on: https://skia-review.googlesource.com/38361
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-08-24 20:18:27 +00:00
Ben Wagner
b4aab9ae6d Replace SkFAIL with SK_ABORT.
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>
2017-08-16 15:37:54 +00:00
Robert Phillips
4c72b266da Add Chinese fling sample
Change-Id: Id27877c4d816ec83460f50a3a0d9cc0299ea6849
Reviewed-on: https://skia-review.googlesource.com/34780
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-08-16 13:45:57 +00:00
Ben Wagner
c6c10b4518 Remove SkTypeface::Style from fuzzers and lua.
Change-Id: I53be039e21a4c11ec3a4bc54c1424cd3e15afc6a
Reviewed-on: https://skia-review.googlesource.com/31643
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2017-08-08 15:27:19 +00:00
Mike Reed
8780edabf2 add 'R' to toggle rasterpipeline in sampleapp
Bug: skia:
Change-Id: I5b198c883140a281d9304fe3c44978cd8fcabce9
Reviewed-on: https://skia-review.googlesource.com/31461
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-08-07 16:54:50 +00:00
Chris Dalton
b072bb6a5c CCPR: Process quadratic flat edges without soft msaa
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>
2017-08-07 15:21:30 +00:00