Change-Id: I9b908bc1cdd28f3bd6819096420b1d119eecd62e
Bug: skia:10669
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/313836
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Joe Gregorio <jcgregorio@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
In a follow-up, I will explore more clearly tying together convexity
and direction internally -- perhaps a unified enum?
[ unknown, convex_cw, convex_ccw, concave ]
Change-Id: I9fc2a2205f40050f4c24c5bec7fc25c8b6d2461c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/313680
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Force ES2 level shading language on ANGLE.
Will be reverted. Only affects Skia tool builds.
Bug: skia:10644
Change-Id: Ic52d6afae7f784b173725a9353d5f43f2da3ca72
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/313703
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
This is an experiment to gauge the additional cost of an extra
indirection. I plan to put it into production to see the impact in
the different clients. The long term goal is to have an API that
works on dense glyph indexes instead of SkGlyph*. This moves from a
system with multiple hash lookups to a single cache lookup. The
lookup would happen on the Renderer side, and the index could be
used to find the glyph directly instead of using a hash map with the
packed glyph id on the GPU side. Eventually, the extra indirection
cost would be recouped by small glyph data (an int instead of a
pointer), and fewer hashmap lookups.
Change-Id: I6dcad6253de54df13c000ecc936a99028cbff5a7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/313681
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
This should fix the current bot failures from previous change.
Change-Id: I1ef4736e9318de6797445a5964c5d29f186811ed
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/313704
Commit-Queue: Greg Daniel <egdaniel@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Auto-Submit: Greg Daniel <egdaniel@google.com>
Reviewed-by: Herb Derby <herb@google.com>
It has been replaced by ProgramVisitors.
Change-Id: I3a79dd46b191d82b025d515c9810e9593f7cf909
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/313684
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
There doesn't seem to be any reason to use a raw pointer for the
IRGenerator.
Change-Id: I5a37ff8ee212534dc8357722aaf70637623840bb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/313720
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This also includes all the plumbing of this flag throughout our proxy
and surface system.
Bug: skia:10409
Change-Id: I48d40012049240cfa80e045ea090f68ce2d2ff0d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/313676
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
These ProgramVisitor classes do the exact same work as count_returns.
Hopefully they are easier for us to reason about, since we no longer
have one omni-method trying to implement three different counts at once.
count_returns still exists in this CL so we can SkASSERT that our
results are unchanged. It is removed entirely in the followup CL.
Change-Id: I17588bcec375a946da6cc6fdb5bab9a3d7d24904
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/313683
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Store the page information in bit 15 of the glyph texture UV.
This code is specifically designed to only use 16-bits of
significand.
Change-Id: I36f268b5b131eaad46b05c67ffd4b7a55cfa2bde
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/313519
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Note: The polarity of the staging flag is inverted from usual because
a G3 dependency with no SkUserConfig.h relies on the legacy API.
Once this lands, we will migrate them and others, then remove the
staging API. The inverted staging flag is kind of nice, actually - I may
use that pattern in the future. It means less total CLs and it's just as
easy to flip the bit on or off during debugging.
Bug: skia:104662
Change-Id: I48cba1eeae3e2e6f79918c6d243e0666e68ec71b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/310656
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
In order to expand into the correct amount of triangles, we instead
factor the matrix scale into the tolerances.
Bug: skia:10419
Change-Id: I178b9600a8837ec5fc997199a8bf6be87227ec94
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/313300
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
This gives us actual performance data on the cost of color management.
Change-Id: Ia74379f10791f0a8b3607c313e5108215c28b56b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/313685
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Previously, if you snapped off a shader and then changed uniforms
(without drawing & flushing), we'd trigger the SkData assert about
calling writeable_data when not-uniquely-owned. Now we lazily copy the
SkData when necessary.
Includes unit test that previously failed.
Bug: skia:10667
Change-Id: If8d9dd8106d41e66560d760cb36ed83371791fc7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/313678
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Previously, early-return detection worked by ensuring that a function
had a maximum of one return statement, positioned at the end of the
function. However, this technique did not support if-else statements:
if (a) { ...; return x; } else { ...; return y; }
This meant that many simple cases were unnecessarily wrapped in a do-
while loop to handle control flow issues that didn't actually occur.
Our early-return detection logic is now more flexible and looks for any
return statements that aren't at an exit point in the control flow,
instead of looking for exactly one return at the end of the code.
Change-Id: Iffe71adf2b9349ce8de42ba8301ccc52abe2882b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/313418
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
SkYUVAPixmapInfo is a SkYUVAInfo with per-plane color types and row
bytes. It describes a set of pixmaps that make up a planar image.
Consolidates validity checks of the SkYUVAInfo with the color types
and row bytes. It can provide SkImageInfos for each plane and also
assist with configuring planes to share a common allocation.
SkYUVAPixmaps is a collection of SkPixmaps that are valid for a
SkYUVAInfo. It can either wrap existing SkPixmaps or allocate and
own the memory. It consolidates validity checking of SkPixmaps with
the SkYUVAInfo. Replaces sk_gpu_test::YUVAPixmaps.
Minor tweaks to SkYUVAInfo naming, parameter order consistency, adds a
hasAlpha() method.
Bug: skia:10632
Change-Id: Ib0f48b8448fff22805fd0c04e07887d0b7338b76
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/312886
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Change-Id: Ife1f5646c0e97b666954518f8c32bb7bae926c6d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/313677
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
SkBitmapProcState is the only subclass of SkBitmapProcInfo, and
BitmapProcShaderContext the only subclass of BitmapProcInfoContext.
This folds it all together, and should be a no-op refactor.
Change-Id: I971c03dbbebfcd1651ddac2f1b624329f415cc35
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/313439
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Several small tweaks:
- Replace std::pair<> with a struct (IRIntrinsic) so we can use names
(fIntrinsic/fAlreadyIncluded) instead of .first and .second.
- Replace std::map<String, std::pair<...>> with a name (IRIntrinsicMap).
- Replace map with unordered_map, since we don't rely on order anywhere.
Change-Id: I508eb3cde5bd4fddcc0b3d02d6ce21d33f9a5421
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/313523
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Change-Id: Id5151a1a9ccf5dd3cb34d9165edff18a12459b93
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/313521
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Consistently use less than for comparisons and ordering and add braces.
Make documentation a bit more direct.
Change-Id: I3286ff3fac3e276b2e40afab5c9a27e202eab9cf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/313556
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
This will allow us to do performance comparisons against the
highest available GLES on a device.
This doesn't yet enable the new config on any bots.
Change-Id: I99d0f009573969b06d5294473de009a4d6940e8d
Bug: skia:10644
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/313426
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Move the page encoding to bit 13 of UV from bit 0. It would be nice
to use bit 15, but older versions of the iphone don't handle the bit 15
correctly.
This is a reland of cace33fc31
Original change's description:
> change atlas uv encoding
>
> Move the page encoding to bit 14 of UV from bit 0. It would be nice
> to use bit 15, but older versions of the iphone don't handle the bit 15
> correctly.
>
> Change-Id: Ia8f1a742dfbc85514f8057fdace0e7954aecc593
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/312640
> Reviewed-by: Jim Van Verth <jvanverth@google.com>
> Commit-Queue: Herb Derby <herb@google.com>
Change-Id: I880d4d615b79e26af8a7bd08c980e36e8ec9d6d8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/313078
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Besides some tests, we always set the renderable flag to kNo for this
function. No need to keep supporting a code path we don't actually use.
Tests that use to pass in kYes here have been converted to calling
createLazyRenderTargetProxy instead.
Change-Id: I91efe6cc51fd7ba04b711509ca26f18eba2af333
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/313425
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
This CL also updates the GrMagnifierEffect to use `return` instead of
`sk_OutColor` in order to test the results in a large, rarely-used FP
that would not naturally be a very good candidate for inlining.
FPs that use a return statement can generate code that is very similar
to before. The visible differences:
- Variable/uniform names are slightly longer (extra `_c0`)
- The input coordinates are NOT copied to a temp variable.
- The result of the inline function is copied from a temp variable to
output_Stage1.
A diff for the curious: http://screen/9rRDmvXYCPnkjRZ
Change-Id: Icdbf22f047d944de7c018ca33970dd629dd4b7b0
Bug: skia:10549
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/313152
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Existing .fp files that assign their output to sk_OutColor will continue
to work as before. An error will be generated if an .fp file tries to
mix-and-match return statements and sk_OutColor assignment; only one or
the other is allowed within a single .fp file.
Change-Id: I53bc0e8b79b2fdd64a020a7e5b35a905f9b05c94
Bug: skia:10549
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/313197
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Two cases are added to the tests:
- We wrap early returns in a do-while block.
- We wrap `if (x) { return y; } else { return z; }` in a do-while block.
In a followup CL, the second case will be detected as "not an early
return" because all returns occur at an exit point. This means that the
first unit test will remain the same, and the second test will no longer
wrap its body in a do-while block or add breaks.
Change-Id: Id1ed880c6fb4b3fd2c373e32b7447f74d0901ab8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/313417
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
With the removal of the unused set call, I really don't see a reason to
have the Priv class just for glRTFBOIDIs0 getter. Especially since all
other similar getters related to surface flags are exposed on the main
class. So I've removed the priv class since I don't think it really
adds much to hide such a function from ourselves.
Change-Id: I834fae036b63cc66732d32d7c74b0ed08438f870
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/313419
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Chromium has been updated: http://crrev.com/c/2375932
Bug: skia:10613
Change-Id: I375ed986c7f2d031950776698534a922d83b9e61
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/313379
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
This reverts commit 3cce1125f0.
Reason for revert: Race condition with _Block_object_dispose
Original change's description:
> Simplify the Metal Compiler wrapper code
>
> The semaphore itself provides us with enough synchronization
> so that the mutex and the sk_sp scheme aren't necessary. This will
> be a little bit faster and I'm putting off finishing my perf.
>
> Change-Id: I8e1c97452f2305efcdcf7b36a367ee91dae15d6f
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/313177
> Auto-Submit: Adlai Holler <adlai@google.com>
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
> Reviewed-by: Jim Van Verth <jvanverth@google.com>
TBR=jvanverth@google.com,adlai@google.com
Change-Id: I8149998a27677bf8ad6d9e3261db242516275803
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/313416
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>