Commit Graph

6154 Commits

Author SHA1 Message Date
Brian Salomon
9457546761 Alternative fix for stale MIP maps on texture export/import.
This change assumes imported textures in SkImages have dirty mip levels
and disables regenerating the MIP levels on export (added in
https://skia.googlesource.com/skia/+/930f939c48af1be6005af12bb6f709ca5da9d118).

This is being done temporarily because it is a simpler change to cherry
pick to earlier branches than
https://skia.googlesource.com/skia/+/930f939c48af1be6005af12bb6f709ca5da9d118

Bug: chromium:850617
Change-Id: I7c90da782a0ed9014acd6a54ffdee1a0b34fa00c
Reviewed-on: https://skia-review.googlesource.com/136788
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2018-06-21 22:17:04 +00:00
Herb Derby
149b541d88 Revert "Add SkGlyphRunList"
This reverts commit f2e4a039df.

Reason for revert: Breaks asan tests

Original change's description:
> Add SkGlyphRunList
> 
> Extend the glyph run system with a glyph run list. This
> allows the processing of text blobs.
> 
> Add original text an cluster to runs for PDF.
> 
> Change-Id: If4867d000e45f8975a30e982fc8fdbe104ef4332
> Reviewed-on: https://skia-review.googlesource.com/135627
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Commit-Queue: Herb Derby <herb@google.com>

TBR=bungeman@google.com,herb@google.com

Change-Id: I903592714da901383efc7e5f47ce3dfd529e2aca
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/136761
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2018-06-21 20:03:07 +00:00
Herb Derby
5c0c7983bb Use local strike caches to avoid flaky test behavior
The remote glyph cache tests assume that the strike cache will not
change during a test. This is not true because other test also
mutate the strike cache. This is causing flaky tests.

 BUG=skia:8091

Change-Id: I397d411f9412006715f6860941dfb05ad54ae1b6
Reviewed-on: https://skia-review.googlesource.com/136741
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2018-06-21 19:49:27 +00:00
Herb Derby
c113e9e23d Make SkStrikeCache::Validate call non global version
Change Validate to ValidateGlyphCacheDataSize. Make it call a
non-global version.

BUG=skia:8091

Change-Id: Iec31a06569a0ab1ec318e693e699a808eb9ad247
Reviewed-on: https://skia-review.googlesource.com/136638
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-06-21 19:22:27 +00:00
Herb Derby
f2e4a039df Add SkGlyphRunList
Extend the glyph run system with a glyph run list. This
allows the processing of text blobs.

Add original text an cluster to runs for PDF.

Change-Id: If4867d000e45f8975a30e982fc8fdbe104ef4332
Reviewed-on: https://skia-review.googlesource.com/135627
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2018-06-21 19:11:47 +00:00
Mike Reed
9ffe3dc245 add test for wacky conic edges (disabled for now)
Bug: 850350
Change-Id: Ib73c27da14a74ec6e3b5c04c2f5c9dd7e2462f1c
Reviewed-on: https://skia-review.googlesource.com/136601
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-06-21 16:37:33 +00:00
Bruce Wang
37b6109cde Implement onMakeClone(const SkFontArguments& args) in class SkTypeface_AndroidSystem.
Add FontMgrAndroidSystemVariableTypeface test to test the above
function.

Change-Id: I36a2f65550784a86feecc6ef69a870a33e973804
Reviewed-on: https://skia-review.googlesource.com/136248
Commit-Queue: Bruce Wang <brucewang@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2018-06-21 16:32:28 +00:00
Herb Derby
960d421fb9 Revert "Make SkRemoteGlyphCache tests use private glyph cache"
This reverts commit 3e36ce6e66.

Reason for revert: Too much verification

Original change's description:
> Make SkRemoteGlyphCache tests use private glyph cache
> 
> Change-Id: If6aa189f3badc7558ab8ecf71ee3d704b275b20f
> Reviewed-on: https://skia-review.googlesource.com/136225
> Commit-Queue: Herb Derby <herb@google.com>
> Reviewed-by: Mike Klein <mtklein@google.com>

TBR=mtklein@google.com,herb@google.com

Change-Id: Ia0c096abd0ab651bc7c907f0595af4f07c88fb5e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/136478
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2018-06-21 12:44:28 +00:00
Brian Salomon
930f939c48 Ensure that textures exported via SkImage::MakeBackendTextureFromSkImage
have consistent content in their mip map levels.

Bug= chromium:850617

Change-Id: I3ad918aa453bd8e4e625eb145de6ba2a5dab7b0c
Reviewed-on: https://skia-review.googlesource.com/136230
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2018-06-20 21:13:27 +00:00
Herb Derby
3e36ce6e66 Make SkRemoteGlyphCache tests use private glyph cache
Change-Id: If6aa189f3badc7558ab8ecf71ee3d704b275b20f
Reviewed-on: https://skia-review.googlesource.com/136225
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-06-20 20:24:47 +00:00
Brian Salomon
92be2f74db Revert "Revert "Change how vertex/instance attributes are handled in geometry processors.""
This reverts commit 5045e501d2.

TBR=csmartdalton@google.com

Change-Id: Ifbf5f1d8f8ef340fdc69653e931b6d68d4bf0854
Reviewed-on: https://skia-review.googlesource.com/135862
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-06-19 20:01:29 +00:00
Robert Phillips
c994a93b32 Move op memory storage to GrContext (take 2)
TBR=bsalomon@google.com

Change-Id: I4a448694d4114d83cd3a720cfc8bd37de51733d1
Reviewed-on: https://skia-review.googlesource.com/135707
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-06-19 19:51:20 +00:00
Florin Malita
80452bee11 Fold SkJSON into Skia/utils
It's a tiny, core-ish component -- might as well treat as such to
simplify dependencies.

Change-Id: I6f31ce2d151f9a629d88bfc7f15d64891d5150c0
Reviewed-on: https://skia-review.googlesource.com/135780
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-06-19 18:23:30 +00:00
Kevin Lubick
f203078309 Revert "added GrSkSLFP and converted DitherEffect to use it"
This reverts commit dfbfc738a9.

Reason for revert: Seems to be breaking DDL/ASAN bots

Original change's description:
> added GrSkSLFP and converted DitherEffect to use it
>
> Bug: skia:
> Change-Id: I84b71165eab1712355f3c7669cee2d33d259f3df
> Reviewed-on: https://skia-review.googlesource.com/124504
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

TBR=bsalomon@google.com,ethannicholas@google.com

Change-Id: Ic4c3978aaba0391f2f8bb1316a456e3821a3a2f2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/135700
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2018-06-19 12:23:21 +00:00
Ben Wagner
f08d1d0ce1 Stop using SkTSwap.
Use std::swap instead. It does not appear that any external user
specializes SkTSwap, but some may still use it. This removes all use in
Skia so that SkTSwap can later be removed in a smaller CL. After that
the <utility> include can be removed from SkTypes.h.

Change-Id: If03d4ee07dbecda961aa9f0dc34d171ef5168753
Reviewed-on: https://skia-review.googlesource.com/135578
Reviewed-by: Hal Canary <halcanary@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2018-06-19 02:06:31 +00:00
Mike Klein
5045e501d2 Revert "Change how vertex/instance attributes are handled in geometry processors."
This reverts commit 19c1233c44.

Reason for revert: want to make sure Google3 can roll

Original change's description:
> Change how vertex/instance attributes are handled in geometry processors.
> 
> * No longer register vertex/instance attributes on base class, just counts
> 
> * Separate instance and vertex attributes and remove InputRate and offset
> 
> * Make attributes constexpr where possible
> 
> Change-Id: I1f1d5e772fa177a96d2aeb805aab7b69f35bfae6
> Reviewed-on: https://skia-review.googlesource.com/132405
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Chris Dalton <csmartdalton@google.com>

TBR=egdaniel@google.com,bsalomon@google.com,csmartdalton@google.com

Change-Id: I4800632515e14fbf54af52826928ac915657b59f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/135661
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-06-19 01:41:10 +00:00
Ethan Nicholas
dfbfc738a9 added GrSkSLFP and converted DitherEffect to use it
Bug: skia:
Change-Id: I84b71165eab1712355f3c7669cee2d33d259f3df
Reviewed-on: https://skia-review.googlesource.com/124504
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-06-18 18:40:58 +00:00
Mike Klein
e72e773ad0 remove SkTCast
SkTCast is functionally equivalent to reinterpret_cast.

The comment about SkTCast helping to avoid strict alising issues is not
true.  Dereferencing a pointer cast to a pointer of an unrelated type is
always undefined, even if smuggled through a union like in SkTCast.

To really avoid aliasing issues, you need to make a union[1] of the two
value types, or better, memcpy between values.  I've had to fix
MatrixText.cpp where switching to reinterpret_cast actually let Clang
notice and warn that we're exploiting undefined behavior, and
GrSwizzle.h and SkCamera.cpp caught by GCC.

I've switched SkTLList over to use SkAlignedSTStorage, which seems
to help convince some GCC versions that fObj is used in a sound way.

[1] The union punning trick is non-standard in C++, but GCC and MSVC
both explicitly support it.  I believe Clang does not officially
explicitly support it, but probably does quietly for GCC compatibility.

Change-Id: I71822e82c962f9aaac8be24d3c0f39f4f8b05026
Reviewed-on: https://skia-review.googlesource.com/134947
Commit-Queue: Mike Klein <mtklein@chromium.org>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Mike Klein <mtklein@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-06-18 17:22:18 +00:00
Brian Salomon
19c1233c44 Change how vertex/instance attributes are handled in geometry processors.
* No longer register vertex/instance attributes on base class, just counts

* Separate instance and vertex attributes and remove InputRate and offset

* Make attributes constexpr where possible

Change-Id: I1f1d5e772fa177a96d2aeb805aab7b69f35bfae6
Reviewed-on: https://skia-review.googlesource.com/132405
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
2018-06-18 17:13:58 +00:00
Chris Dalton
4da70190aa ccpr: Implement path mask caching
Implement caching as follows:

1) Instead of deleting the mainline ccpr atlas when finished, stash it
   away from flush to flush.

2) On subsequent flushes, check the stashed atlas to see if we can
   reuse any of its cachable paths. Copy reusable paths into 8-bit
   literal coverage atlases and store them in the resource cache.

3) Recycle the stashed atlas texture for the remaining paths in the
   flush.

Bug: skia:
Change-Id: I9b20fbea708646df1df3a5f9c044e2299706b989
Reviewed-on: https://skia-review.googlesource.com/134703
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-06-18 16:14:28 +00:00
Mike Klein
e475d016d9 remove stray SkTLList includes
Change-Id: I63ba2424bd70f53c14d15bb332a585881d2c4613
Reviewed-on: https://skia-review.googlesource.com/135451
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2018-06-18 15:52:58 +00:00
Chris Dalton
4c458b12f6 ccpr: Use lazy proxies with GrCCAtlas
Bug: skia:
Change-Id: I576d9303d451352778de0425e3ecbc561331cd09
Reviewed-on: https://skia-review.googlesource.com/135362
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2018-06-18 15:32:48 +00:00
Cary Clark
1bb47df4fc fast path for pathops
Add faster path for simple but common path ops:
- intersect two rects
- all ops where one operand is empty

R=halcanary@google.com

Bug: skia:8049
Change-Id: I2a516d095feae8478ee9433262c9c77e5e18ce81
Reviewed-on: https://skia-review.googlesource.com/132929
Auto-Submit: Cary Clark <caryclark@skia.org>
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
2018-06-18 13:30:38 +00:00
Ben Wagner
b0897650f1 Reland "Remove SK_MaxSizeT, SK_M{in|ax}U{16|32}, #defines."
This reverts commit ab17347df3.

Reason for revert: Chromium should now be ok.

Original change's description:
> Revert "Remove SK_MaxSizeT, SK_M{in|ax}U{16|32}, #defines."
>
> This reverts commit e1bc7de7c0.
>
> Reason for revert: chrome used it
>
> Original change's description:
> > Remove SK_MaxSizeT, SK_M{in|ax}U{16|32}, #defines.
> >
> > sed 's/SK_MaxSizeT/SIZE_MAX/g'
> > sed 's/SK_MaxU32/UINT32_MAX/g'
> > sed 's/SK_MaxU16/UINT16_MAX/g'
> >
> > SK_MinU32 and SK_MinU16 were unused
> >
> > Change-Id: I6b6c824df47b05bde7e73b13a58e851a5f63fe0e
> > Reviewed-on: https://skia-review.googlesource.com/134607
> > Commit-Queue: Hal Canary <halcanary@google.com>
> > Reviewed-by: Ben Wagner <bungeman@google.com>
>
> TBR=halcanary@google.com,bungeman@google.com,reed@google.com
>
> Change-Id: I1e2c440dcf9f59bf87c1fea113248cd5136f7519
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/134921
> Reviewed-by: Hal Canary <halcanary@google.com>
> Commit-Queue: Hal Canary <halcanary@google.com>

CQ_INCLUDE_TRYBOTS=luci.chromium.try:linux-ozone-rel
TBR=halcanary@google.com,bungeman@google.com,reed@google.com

Change-Id: I7709f9715bea0463b85b5b0a89712ac1020fcddb
Reviewed-on: https://skia-review.googlesource.com/135180
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2018-06-15 16:26:05 +00:00
Robert Phillips
4f6ba2e522 Revert "Move op memory storage to GrContext"
This reverts commit c8cee446bf.

Reason for revert: TSAN issues

Original change's description:
> Move op memory storage to GrContext
> 
> TBR=bsalomon@google.com
> Change-Id: Ifa95bf0073b9d948f2c937d10088b7734b971f90
> Reviewed-on: https://skia-review.googlesource.com/131500
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com

Change-Id: Ia0d2b7408314d9b67d57388315376bbea23d3780
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/135181
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-06-15 15:59:45 +00:00
Robert Phillips
c8cee446bf Move op memory storage to GrContext
TBR=bsalomon@google.com
Change-Id: Ifa95bf0073b9d948f2c937d10088b7734b971f90
Reviewed-on: https://skia-review.googlesource.com/131500
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-06-15 11:33:14 +00:00
Hal Canary
ab17347df3 Revert "Remove SK_MaxSizeT, SK_M{in|ax}U{16|32}, #defines."
This reverts commit e1bc7de7c0.

Reason for revert: chrome used it

Original change's description:
> Remove SK_MaxSizeT, SK_M{in|ax}U{16|32}, #defines.
> 
> sed 's/SK_MaxSizeT/SIZE_MAX/g'
> sed 's/SK_MaxU32/UINT32_MAX/g'
> sed 's/SK_MaxU16/UINT16_MAX/g'
> 
> SK_MinU32 and SK_MinU16 were unused
> 
> Change-Id: I6b6c824df47b05bde7e73b13a58e851a5f63fe0e
> Reviewed-on: https://skia-review.googlesource.com/134607
> Commit-Queue: Hal Canary <halcanary@google.com>
> Reviewed-by: Ben Wagner <bungeman@google.com>

TBR=halcanary@google.com,bungeman@google.com,reed@google.com

Change-Id: I1e2c440dcf9f59bf87c1fea113248cd5136f7519
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/134921
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-06-14 16:17:38 +00:00
Hal Canary
c640d0dc96 Revert "Revert "SkTypes: extract SkTo""
This reverts commit fdcfb8b7c2.

> Original change's description:
> > SkTypes: extract SkTo
> >
> > Change-Id: I8de790d5013db2105ad885fa2683303d7c250b09
> > Reviewed-on: https://skia-review.googlesource.com/133620
> > Reviewed-by: Mike Klein <mtklein@google.com>

Change-Id: Ida74fbc5c21248a724a5edbf9fae18a33bcb23aa
Reviewed-on: https://skia-review.googlesource.com/134506
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-06-14 14:55:17 +00:00
Hal Canary
e1bc7de7c0 Remove SK_MaxSizeT, SK_M{in|ax}U{16|32}, #defines.
sed 's/SK_MaxSizeT/SIZE_MAX/g'
sed 's/SK_MaxU32/UINT32_MAX/g'
sed 's/SK_MaxU16/UINT16_MAX/g'

SK_MinU32 and SK_MinU16 were unused

Change-Id: I6b6c824df47b05bde7e73b13a58e851a5f63fe0e
Reviewed-on: https://skia-review.googlesource.com/134607
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2018-06-14 14:10:47 +00:00
Mike Klein
b6b5b7a808 Reland "simplify SkTFitsIn, try 2"
This is a reland of 009f51e43f

Original change's description:
> simplify SkTFitsIn, try 2
> 
> Originally we wrote this in C++14 constexpr,
> but because this is used from public headers, we can't use
> C++14 yet.  Now a somewhat sillier looking C++11 version.
> 
> All the old tests still pass, and one new added.
> Updated the comments a bit for correctness and readability.
> 
> Change-Id: I99c01e1346c1a5a36278cc08f30538112e5259aa
> Reviewed-on: https://skia-review.googlesource.com/134425
> Commit-Queue: Mike Klein <mtklein@chromium.org>
> Commit-Queue: Ben Wagner <bungeman@google.com>
> Auto-Submit: Mike Klein <mtklein@chromium.org>
> Reviewed-by: Ben Wagner <bungeman@google.com>

Change-Id: I99676faac6153830538c1396a325ca1456dfb126
Reviewed-on: https://skia-review.googlesource.com/134800
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-06-14 14:05:27 +00:00
Brian Osman
f018b7d607 SkColorSpaceXformSteps improvements and tests
Added some helper functions and put the booleans in a nested struct
(this is motivated by upcoming changes). Added a unit test of steps
against skcms, with round-tripping in both combinations.

Change-Id: Iea3d60cd52edb5259b5576b1422ed6f856cde815
Reviewed-on: https://skia-review.googlesource.com/134660
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-06-14 11:30:47 +00:00
Mike Klein
e4b900bfd9 Revert "simplify SkTFitsIn, try 2"
This reverts commit 009f51e43f.

Reason for revert: unintentional header consequences in Chromium... will reland after fixing Chromium

Original change's description:
> simplify SkTFitsIn, try 2
> 
> Originally we wrote this in C++14 constexpr,
> but because this is used from public headers, we can't use
> C++14 yet.  Now a somewhat sillier looking C++11 version.
> 
> All the old tests still pass, and one new added.
> Updated the comments a bit for correctness and readability.
> 
> Change-Id: I99c01e1346c1a5a36278cc08f30538112e5259aa
> Reviewed-on: https://skia-review.googlesource.com/134425
> Commit-Queue: Mike Klein <mtklein@chromium.org>
> Commit-Queue: Ben Wagner <bungeman@google.com>
> Auto-Submit: Mike Klein <mtklein@chromium.org>
> Reviewed-by: Ben Wagner <bungeman@google.com>

TBR=mtklein@chromium.org,bungeman@google.com

Change-Id: Ic73f8800bd022ffea125b3b1bf138fe49c0db926
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/134621
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-06-13 18:57:06 +00:00
Greg Daniel
da86e2822a Remove unused code that was used for late mip allocations.
This also includes removing code to support changing GrGpuResource's size
since we now have to way to ever change the size.

Bug: skia:
Change-Id: Id27a8bc3cc94f5b954beda528b209727ede10ef6
Reviewed-on: https://skia-review.googlesource.com/134503
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-06-13 18:06:56 +00:00
Greg Daniel
e141548696 Fix ImageTest to check if gpu mip maps are supported.
Bug: skia:
Change-Id: Iccef46cb61926f8cfdf29c8a095566d4b4ecda61
Reviewed-on: https://skia-review.googlesource.com/134516
Auto-Submit: Greg Daniel <egdaniel@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-06-13 17:32:26 +00:00
Khushal
4010c792c6 fonts: Ignore re-initialization of fallback glyphs from the server.
If the client finds that the server re-initializes a cached path/image,
we consider this an error and invalid data. But since we might
initialize a glyph using a fallback on the client, and receive the
correct version from the server later, this is not longer true.

Bug: 829622
Change-Id: I34ab17b54139d89a15179265d4aed4a1fe36fd47
Reviewed-on: https://skia-review.googlesource.com/133566
Commit-Queue: Khusal Sagar <khushalsagar@chromium.org>
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-06-13 17:10:56 +00:00
Greg Daniel
5f4b09d523 Allow caller to specify if the want mip maps in makeTextureImage call.
Since Ganesh no longer will allocate mips late, this gives the clients a
way to tell skia that they want the texture they will be using to have mips.
It also supports allowing a client to take a non mipped texture backed
image and turn it into a new image which is mipped and texture backed.

Bug: chromium:834837
Change-Id: I1781ce618c22023b6309f248e7ee49e69bd3c6df
Reviewed-on: https://skia-review.googlesource.com/134323
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Eric Karl <ericrk@chromium.org>
Reviewed-by: Cary Clark <caryclark@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-06-13 13:55:56 +00:00
Mike Klein
009f51e43f simplify SkTFitsIn, try 2
Originally we wrote this in C++14 constexpr,
but because this is used from public headers, we can't use
C++14 yet.  Now a somewhat sillier looking C++11 version.

All the old tests still pass, and one new added.
Updated the comments a bit for correctness and readability.

Change-Id: I99c01e1346c1a5a36278cc08f30538112e5259aa
Reviewed-on: https://skia-review.googlesource.com/134425
Commit-Queue: Mike Klein <mtklein@chromium.org>
Commit-Queue: Ben Wagner <bungeman@google.com>
Auto-Submit: Mike Klein <mtklein@chromium.org>
Reviewed-by: Ben Wagner <bungeman@google.com>
2018-06-13 13:50:51 +00:00
Hal Canary
fdcfb8b7c2 Revert "SkTypes: extract SkTo"
This reverts commit 2a2f675926.

Reason for revert: this appears to be what is holding up the Chrome roll.

Original change's description:
> SkTypes: extract SkTo
>
> Change-Id: I8de790d5013db2105ad885fa2683303d7c250b09
> Reviewed-on: https://skia-review.googlesource.com/133620
> Reviewed-by: Mike Klein <mtklein@google.com>

TBR=mtklein@google.com,halcanary@google.com

No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: Iafd738aedfb679a23c061a51afe4b98a8d4cdfae
Reviewed-on: https://skia-review.googlesource.com/134504
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-06-13 13:45:47 +00:00
Bruce Wang
75e6490a29 Implement DWriteFontTypeface::onGetVariationDesignPosition on win10.
Copy into 'coordinates' (allocated by the caller) the design variation
coordinates. Return the number of axes, or -1 if there is an error.

Change-Id: Ie2fe88aaae358ec471aafd655b4ed0be80d43ae6
Reviewed-on: https://skia-review.googlesource.com/134329
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Bruce Wang <brucewang@google.com>
2018-06-12 21:25:54 +00:00
Mike Klein
2652223767 Revert "simplify SkTFitsIn"
This reverts commit b82c3d6ff2.

Reason for revert: SkTFitsIn makes its way into public headers via SkTo<T>, so it cannot use C++14isms.

Original change's description:
> simplify SkTFitsIn
> 
> Now that we're C++14, a constexpr SkTFitsIn() is a lot easier.
> All the old tests still pass, and one new added.
> 
> Updated the comments a bit for correctness and readability.
> 
> Change-Id: I0f60e32e545fe4f2fb14e66a2bf25d562dbd680f
> Reviewed-on: https://skia-review.googlesource.com/133831
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Commit-Queue: Mike Klein <mtklein@chromium.org>

TBR=mtklein@chromium.org,halcanary@google.com,bungeman@google.com

Change-Id: Icfb19c77b450cf3525d11225d4237f9bfa68c7fc
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/134440
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-06-12 21:07:54 +00:00
Khushal
8523b6bd0d fonts: Fix memory allocation for fallback glyphs.
When allocating the mask for a fallback glyph, we allocate it on the
arena on the SkScalerContext while the image belongs to a glyph on a
different cache. This can lead to use-after-free bugs if accessing the
image after the context owning that memory is destroyed. Fix this by
allocating on the arena from the owning cache.

R=herb@google.com, mtklein@google.com

Bug: 829622
Change-Id: Ife53e24f5bc868f36c43f2adcd7a2629ab5577fe
Reviewed-on: https://skia-review.googlesource.com/134182
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-06-12 20:42:34 +00:00
Hal Canary
50dbc0949f SkTypes: more into SkMacros
Change-Id: I4c9a2d81a1bc4ccebc78eea56c0de116b98d415e
Reviewed-on: https://skia-review.googlesource.com/134330
Commit-Queue: Hal Canary <halcanary@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2018-06-12 20:24:43 +00:00
Mike Klein
b82c3d6ff2 simplify SkTFitsIn
Now that we're C++14, a constexpr SkTFitsIn() is a lot easier.
All the old tests still pass, and one new added.

Updated the comments a bit for correctness and readability.

Change-Id: I0f60e32e545fe4f2fb14e66a2bf25d562dbd680f
Reviewed-on: https://skia-review.googlesource.com/133831
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2018-06-12 15:44:23 +00:00
Hal Canary
2a2f675926 SkTypes: extract SkTo
Change-Id: I8de790d5013db2105ad885fa2683303d7c250b09
Reviewed-on: https://skia-review.googlesource.com/133620
Reviewed-by: Mike Klein <mtklein@google.com>
2018-06-12 15:03:21 +00:00
Robert Phillips
7c525e62d4 Plumb GrContext everywhere
There is no good way to split the monster CL up. This breaks out
the GrContext plumbing but doesn't use it.

Change-Id: I90856d428d372bcec3f8821e6364667b367927d4
Reviewed-on: https://skia-review.googlesource.com/133382
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2018-06-12 14:43:03 +00:00
Cary Clark
efd99cc928 clean up SkPicture include
Get SkPicture.h ready for documenting.

- remove private methods
- move private forward declarations
- name parameters

R=reed@google.com, bsalomon@google.com

Bug: skia:6898
Change-Id: I28829111203d8ae2a4661cf02c99023403aa0df0
Reviewed-on: https://skia-review.googlesource.com/134120
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@google.com>
2018-06-12 13:56:33 +00:00
Mike Klein
79aea6a147 trim #include <new> from SkPostConfig.h
Change-Id: I693ddcd4ade101ba4eb4102e03adce183aa1d672
Reviewed-on: https://skia-review.googlesource.com/133829
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2018-06-11 15:55:31 +00:00
Mike Klein
692e29ebcd remove unused parts of SkTypes.h
Lots of completely unused bits and bobs removed.

I've decided SK_SUPPORT_UNITTEST and its single use are not
very compelling.

tests/CPlusPlusEleven was the only user of Sk32ToBool(),
and no longer generally needed.

Change-Id: I3ee75560f1e1e1cf5ad89ee7df8d7694b5dffdb3
Reviewed-on: https://skia-review.googlesource.com/133622
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-06-08 23:53:57 +00:00
Greg Daniel
09c9400695 Reland "Reland "Require mips to be allocated at texture creation time and disable late allocations.""
This reverts commit 01422bc8ef.

Reason for revert: follow on change may be ready

Original change's description:
> Revert "Reland "Require mips to be allocated at texture creation time and disable late allocations.""
> 
> This reverts commit 9eb36b9eb8.
> 
> Reason for revert: Alpha8 isn't renderable on es2 so we end up dropping draws on certain A8 mip requests
> 
> Original change's description:
> > Reland "Require mips to be allocated at texture creation time and disable late allocations."
> > 
> > This reverts commit 0c78238e29.
> > 
> > Reason for revert: <INSERT REASONING HERE>
> > 
> > Original change's description:
> > > Revert "Require mips to be allocated at texture creation time and disable late allocations."
> > > 
> > > This reverts commit cd2c3f9055.
> > > 
> > > Reason for revert: Looks to be causing angle failures on initial clear test
> > > 
> > > Original change's description:
> > > > Require mips to be allocated at texture creation time and disable late allocations.
> > > > 
> > > > If we get a non-mipped texture for a draw that wants to be use mip map filter, we
> > > > will copy the texture into a new mipped texture.
> > > > 
> > > > Clean up of unused code in the GPU backends for reallocating for mips will be done
> > > > in a follow up CL.
> > > > 
> > > > Bug: skia:
> > > > Change-Id: Idab588c1abf4bbbf7eeceb3727d500e5df274188
> > > > Reviewed-on: https://skia-review.googlesource.com/132830
> > > > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > > > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > > 
> > >
> > > 
> > > Change-Id: I49f0ace52f2586d61b451630b2e6aae84b420b81
> > > No-Presubmit: true
> > > No-Tree-Checks: true
> > > No-Try: true
> > > Bug: skia:
> > > Reviewed-on: https://skia-review.googlesource.com/133041
> > > Reviewed-by: Greg Daniel <egdaniel@google.com>
> > > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > 
> > Bug: skia:
> > Change-Id: I004447a5f1ec72c3be2318ddea803f57efb12ea4
> > Reviewed-on: https://skia-review.googlesource.com/133340
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> 
> TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
> 
> Change-Id: I9e9718d380c4d9927ec39e46008750ab7396391f
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:
> Reviewed-on: https://skia-review.googlesource.com/133680
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com

Change-Id: Ic3df69f65a89962b21cdb50ee436a29fd121ab1f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/133740
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-06-08 23:01:44 +00:00
Brian Salomon
802cb318f6 Stop passing GrPrimitiveProcessor to GrMesh::sendToGpu.
It is currently used in GrGLGpu::setupGeometry. Instead:

1) Make GrMesh track whether primitive restart should be enabled.

2) Make GrGLProgram track program attributes.

Change-Id: Ice411a495961fcbc3cedc81e8ae0583537f42153
Reviewed-on: https://skia-review.googlesource.com/132267
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
2018-06-08 22:32:02 +00:00
Herb Derby
65b7bfcf61 Glyph search of desperation
Change-Id: I0ae768c5517c3ee3f6822fea0926b3f27214a0e4
Reviewed-on: https://skia-review.googlesource.com/132260
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-06-08 22:26:32 +00:00
Greg Daniel
01422bc8ef Revert "Reland "Require mips to be allocated at texture creation time and disable late allocations.""
This reverts commit 9eb36b9eb8.

Reason for revert: Alpha8 isn't renderable on es2 so we end up dropping draws on certain A8 mip requests

Original change's description:
> Reland "Require mips to be allocated at texture creation time and disable late allocations."
> 
> This reverts commit 0c78238e29.
> 
> Reason for revert: <INSERT REASONING HERE>
> 
> Original change's description:
> > Revert "Require mips to be allocated at texture creation time and disable late allocations."
> > 
> > This reverts commit cd2c3f9055.
> > 
> > Reason for revert: Looks to be causing angle failures on initial clear test
> > 
> > Original change's description:
> > > Require mips to be allocated at texture creation time and disable late allocations.
> > > 
> > > If we get a non-mipped texture for a draw that wants to be use mip map filter, we
> > > will copy the texture into a new mipped texture.
> > > 
> > > Clean up of unused code in the GPU backends for reallocating for mips will be done
> > > in a follow up CL.
> > > 
> > > Bug: skia:
> > > Change-Id: Idab588c1abf4bbbf7eeceb3727d500e5df274188
> > > Reviewed-on: https://skia-review.googlesource.com/132830
> > > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > 
> >
> > 
> > Change-Id: I49f0ace52f2586d61b451630b2e6aae84b420b81
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Bug: skia:
> > Reviewed-on: https://skia-review.googlesource.com/133041
> > Reviewed-by: Greg Daniel <egdaniel@google.com>
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> 
> Bug: skia:
> Change-Id: I004447a5f1ec72c3be2318ddea803f57efb12ea4
> Reviewed-on: https://skia-review.googlesource.com/133340
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com

Change-Id: I9e9718d380c4d9927ec39e46008750ab7396391f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/133680
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-06-08 22:01:23 +00:00
Cary Clark
27dddae313 rebase
This reverts commit 32a4910e57.

Reason for revert: SkMatrix::toString use has been removed from flutter
and has been picked up in fuchsia

Additionally some bookmaker changes take into account recent
additions of typedef comments and the generated header comment.

Original change's description:
> Revert "remove toString"
>
> This reverts commit 5191880cbf.
>
> Reason for revert: broke flutter
>
> Original change's description:
> > remove toString
> >
> > toString may have been used by obsolete debugger only
> > find out if that is so
> >
> > R=​brianosman@google.com,bsalomon@google.com
> >
> > Docs-Preview: https://skia.org/?cl=119894
> > Bug:830651
> > Change-Id: I737f19b7d3fbc869bea2f443fa3b5ed7c1393ffd
> > Reviewed-on: https://skia-review.googlesource.com/119894
> > Commit-Queue: Cary Clark <caryclark@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
>
> TBR=bsalomon@google.com,brianosman@google.com,caryclark@google.com,caryclark@skia.org
>
> Change-Id: I9f81de6c3615ee0608bcea9081b77239b4b8816c

TBR=bsalomon@google.com,brianosman@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Reviewed-on: https://skia-review.googlesource.com/129623
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@google.com>
Docs-Preview: https://skia.org/?cl=133583
Bug: 830651
Change-Id: If8499e796be63580ad419e150e94d43e8b89de1b
Reviewed-on: https://skia-review.googlesource.com/133583
Commit-Queue: Cary Clark <caryclark@skia.org>
Auto-Submit: Cary Clark <caryclark@skia.org>
2018-06-08 20:36:53 +00:00
Chris Dalton
afa11586d7 Make the SkPathRef GenIDChangeListener ref counted
Bug: skia:
Change-Id: I2780e3fc76153373b4efca6059ded82f4f749325
Reviewed-on: https://skia-review.googlesource.com/133502
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2018-06-08 20:15:03 +00:00
Herb Derby
59d997a6e1 New more efficient run builder
A system for building glyph runs. In the future the builder will
only live in canvas, but it's internal structures facilitate
interacting with the cache a single glyph at a time. When all
the bulk code is in place, only runs will be passed around.

Passing the builder down the text draw stack is temporary.

Change-Id: I6e3ed184b3f3a58b919377f2d31936e971bd8efa
Reviewed-on: https://skia-review.googlesource.com/132928
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2018-06-08 19:25:43 +00:00
Chris Dalton
89c5e8878e Implement Sk2f::floor
Bug: skia:
Change-Id: Id40e7165a338d321df71a1852b48eb2570ecd75b
Reviewed-on: https://skia-review.googlesource.com/133460
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-06-08 18:41:13 +00:00
Stephen White
89042d5f13 GrTessellator: catch missing intersections.
Sometimes the intersection check will miss an intersection (because
floating point). This can leave the active edge list in an invalid
state, where an edge pair is incorrectly ordered. The fix is to test
for edge crossings after testing for intersections, and split the
edges manually. This extra check may result in a performance hit, so
we'll have to watch the perf bots carefully.

Bug: 843135
Change-Id: If50320413026be503cdb2d33e6c97f620e4d51a9
Reviewed-on: https://skia-review.googlesource.com/133400
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2018-06-08 18:26:05 +00:00
Greg Daniel
9eb36b9eb8 Reland "Require mips to be allocated at texture creation time and disable late allocations."
This reverts commit 0c78238e29.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Revert "Require mips to be allocated at texture creation time and disable late allocations."
> 
> This reverts commit cd2c3f9055.
> 
> Reason for revert: Looks to be causing angle failures on initial clear test
> 
> Original change's description:
> > Require mips to be allocated at texture creation time and disable late allocations.
> > 
> > If we get a non-mipped texture for a draw that wants to be use mip map filter, we
> > will copy the texture into a new mipped texture.
> > 
> > Clean up of unused code in the GPU backends for reallocating for mips will be done
> > in a follow up CL.
> > 
> > Bug: skia:
> > Change-Id: Idab588c1abf4bbbf7eeceb3727d500e5df274188
> > Reviewed-on: https://skia-review.googlesource.com/132830
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> 
>
> 
> Change-Id: I49f0ace52f2586d61b451630b2e6aae84b420b81
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:
> Reviewed-on: https://skia-review.googlesource.com/133041
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

Bug: skia:
Change-Id: I004447a5f1ec72c3be2318ddea803f57efb12ea4
Reviewed-on: https://skia-review.googlesource.com/133340
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-06-08 17:39:33 +00:00
Robert Phillips
88a32efa75 Add a factory to any GrOp-derived class that lacked one
All GrOp-derived classes are going to have allocate their memory in a GrMemoryPool.

Change-Id: Ifa410b05eecd9b68c39dcc15dd4298d617204c13
Reviewed-on: https://skia-review.googlesource.com/132828
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-06-08 11:55:11 +00:00
Greg Daniel
0c78238e29 Revert "Require mips to be allocated at texture creation time and disable late allocations."
This reverts commit cd2c3f9055.

Reason for revert: Looks to be causing angle failures on initial clear test

Original change's description:
> Require mips to be allocated at texture creation time and disable late allocations.
> 
> If we get a non-mipped texture for a draw that wants to be use mip map filter, we
> will copy the texture into a new mipped texture.
> 
> Clean up of unused code in the GPU backends for reallocating for mips will be done
> in a follow up CL.
> 
> Bug: skia:
> Change-Id: Idab588c1abf4bbbf7eeceb3727d500e5df274188
> Reviewed-on: https://skia-review.googlesource.com/132830
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com

Change-Id: I49f0ace52f2586d61b451630b2e6aae84b420b81
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/133041
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-06-07 20:11:33 +00:00
Greg Daniel
cd2c3f9055 Require mips to be allocated at texture creation time and disable late allocations.
If we get a non-mipped texture for a draw that wants to be use mip map filter, we
will copy the texture into a new mipped texture.

Clean up of unused code in the GPU backends for reallocating for mips will be done
in a follow up CL.

Bug: skia:
Change-Id: Idab588c1abf4bbbf7eeceb3727d500e5df274188
Reviewed-on: https://skia-review.googlesource.com/132830
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-06-07 19:35:01 +00:00
Khushal
fa8ff09457 fonts: Hook up FallbackTextHelper to font remoting.
Use GrContext::FallbackTextHelper in SkTextBlobCacheDiffCanvas to
replicate glyph generation logic for fallback text during analysis. This
ensures that we correctly handle these fallback cases when using
distance field or paths for text rendering.

R=herb@google.com, jvanverth@google.com

Bug: skia:7913
Change-Id: I3067c4f1bd09231a564ac7c4cd89efcb876d2abd
Reviewed-on: https://skia-review.googlesource.com/132285
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Khusal Sagar <khushalsagar@chromium.org>
2018-06-07 18:03:11 +00:00
Robert Phillips
9519d4f05a Remove unused GrObjectMemoryPool
Change-Id: I8d37dfa3a5f0af4741eb6f1c10e13065d20b0ccb
Reviewed-on: https://skia-review.googlesource.com/132829
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-06-07 16:08:41 +00:00
Mike Klein
d07dc361bc clean up some unused parts of SkArenaAlloc
I'm looking at making SkArenaAlloc independent of Skia.
Here's a bit of low-hanging fruit.

Nothing is using makeSkSp().  Good... it seems real dangerous.

Change-Id: Ib7154e7948a3c6d828376ef37935636b3b4695ff
Reviewed-on: https://skia-review.googlesource.com/132824
Commit-Queue: Mike Klein <mtklein@chromium.org>
Commit-Queue: Herb Derby <herb@google.com>
Auto-Submit: Mike Klein <mtklein@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
2018-06-07 14:21:28 +00:00
Mike Klein
6f02af9b54 remove linear-blended sRGB dst support in software
This is the mechanism we'd want to add back if we add an sRGBA
SkColorType.  This will break the DM "srgb" config hard.

Landing this first should help flush out GMs that are incidentally using
sRGB offscreens.

Updated tests/AnimatedImageTest.cpp to avoid linear sRGB 8888 surfaces.

CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel

Change-Id: Idb5035cf4d60fcd1dc24c303d43a406fc4a603fa
Reviewed-on: https://skia-review.googlesource.com/132261
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-06-06 20:35:24 +00:00
Cary Clark
3a4a3215f5 fix ops for very close rects
Pathops sorts line intersections to determine which edges to keep.
If the intersections are very short, they may get discarded and the
adjacent edge is used instead.

If a pair of edges are 180 degrees apart, and an adjacent edge is
part of the sort, it is ambiguous whether it is inside or outside
the span. Add logic to look for this and evaluate the original data
rather than the adjacent edge.

In a separate CL, I'll add a specialization for rect/rect ops.

R=halcanary@google.com
Bug: skia:8049
Change-Id: I8d88d5520051d41303ea683e7d6b844f2afa9937
Reviewed-on: https://skia-review.googlesource.com/132661
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
Auto-Submit: Cary Clark <caryclark@skia.org>
2018-06-06 20:27:34 +00:00
Herb Derby
4ffa027cf6 Smarter use of glyph cache
Change-Id: Ic9bea7310b375575503042881d9d54ff13996729
Reviewed-on: https://skia-review.googlesource.com/131924
Reviewed-by: Mike Klein <mtklein@chromium.org>
2018-06-06 19:07:52 +00:00
Herb Derby
41f4f31cd7 Reland "Have draw(Text|PosText|PosTextH) use a single entry on the device"
This reverts commit 74b390d6b1.

Reason for revert: reverting to add patch for valgrind

Original change's description:
> Revert "Have draw(Text|PosText|PosTextH) use a single entry on the device"
> 
> This reverts commit 4225b3220e.
> 
> Reason for revert: made valgrind unhappy.
> 
> Original change's description:
> > Have draw(Text|PosText|PosTextH) use a single entry on the device
> > 
> > Handle the positioning of drawText at the canvas layer. Simplify
> > the code by removing similar implementations.
> > 
> > Change-Id: I8b711783435072f560e29fca1dd934fa2e345ed2
> > Reviewed-on: https://skia-review.googlesource.com/127131
> > Reviewed-by: Ben Wagner <bungeman@google.com>
> > Commit-Queue: Herb Derby <herb@google.com>
> 
> TBR=jvanverth@google.com,bungeman@google.com,herb@google.com
> 
> Change-Id: I65c9d30ae6ecb1f87e8660e56d8f8ce5daab7551
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/132403
> Reviewed-by: Hal Canary <halcanary@google.com>
> Commit-Queue: Hal Canary <halcanary@google.com>

TBR=jvanverth@google.com,halcanary@google.com,bungeman@google.com,herb@google.com

Change-Id: I9bbb73aac447b51eb8215ac42331759fa4c9fa45
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/132580
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2018-06-06 17:46:05 +00:00
Mike Klein
f454bd3930 rm TestConfigParsing
No test tests, ok?  Gotta draw the line somewhere.

Change-Id: I52284272f74a72a858910a143ecd4ad68fe3f1de
Reviewed-on: https://skia-review.googlesource.com/132410
Commit-Queue: Mike Klein <mtklein@chromium.org>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@chromium.org>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-06-06 15:37:54 +00:00
Stephen White
e62999f6ef GrTessellator: yet another out-of-range splitting fix.
It's actually possible for an intersection to be out-of-range on both
the intersected edges (e.g., below both bottom points), because
floating point. So we need to clamp against both edges.

Bug: 846014
Change-Id: I9fe25a1fcd3b5242af7b1ee36b17f1e968aeb836
Reviewed-on: https://skia-review.googlesource.com/132323
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2018-06-06 15:01:41 +00:00
Hal Canary
74b390d6b1 Revert "Have draw(Text|PosText|PosTextH) use a single entry on the device"
This reverts commit 4225b3220e.

Reason for revert: made valgrind unhappy.

Original change's description:
> Have draw(Text|PosText|PosTextH) use a single entry on the device
> 
> Handle the positioning of drawText at the canvas layer. Simplify
> the code by removing similar implementations.
> 
> Change-Id: I8b711783435072f560e29fca1dd934fa2e345ed2
> Reviewed-on: https://skia-review.googlesource.com/127131
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Commit-Queue: Herb Derby <herb@google.com>

TBR=jvanverth@google.com,bungeman@google.com,herb@google.com

Change-Id: I65c9d30ae6ecb1f87e8660e56d8f8ce5daab7551
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/132403
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-06-06 13:29:57 +00:00
Herb Derby
4225b3220e Have draw(Text|PosText|PosTextH) use a single entry on the device
Handle the positioning of drawText at the canvas layer. Simplify
the code by removing similar implementations.

Change-Id: I8b711783435072f560e29fca1dd934fa2e345ed2
Reviewed-on: https://skia-review.googlesource.com/127131
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2018-06-05 20:11:39 +00:00
Mike Reed
5059541dcc need conservative bounds for triangles due to SkFixed drift in SkEdge
Bug: oss-fuzz:8018
Change-Id: I09456f906b7eb89f74ffd2c484bc6e30e029bfbb
Reviewed-on: https://skia-review.googlesource.com/131021
Reviewed-by: Cary Clark <caryclark@google.com>
Auto-Submit: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-06-04 15:47:19 +00:00
Herb Derby
feb9fa9e9b Turn off logging for tests
Change-Id: I00bb3059bb92b5c11178022aff8a87918bb3781e
Reviewed-on: https://skia-review.googlesource.com/131640
Reviewed-by: Khushal Sagar <khushalsagar@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2018-06-04 15:23:29 +00:00
Brian Osman
e1adc3a955 Remove color space restrictions from image infos
What makes an info valid (or invalid)? Nothing to do with
color space.

Bug: skia:
Change-Id: I6795efa9aa74ab0d65935c5ddccc1058f8e0b112
Reviewed-on: https://skia-review.googlesource.com/131780
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-06-04 14:07:48 +00:00
Brian Salomon
a694870ef5 Remove origin from GrGpu::readPixels
Change-Id: I40d046c66240ab40794aa008861a1974f7f9182c
Reviewed-on: https://skia-review.googlesource.com/131620
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-06-02 01:42:46 +00:00
Brian Osman
2b23c4bf31 Dest color space no longer impacts mipmaps or texture sampling
PS5: Removes SkDestinationSurfaceColorMode, tracking of mipmap
mode on GrTexture, sRGB decode state per-texture. Because we
were often choosing sRGB configs for RGB color types, legacy
rendering would then be incorrect (too dark). So...

PS7: Stops ever using sRGB pixel configs when translating
image info or color type. Also removes a bunch of GrCaps bits
and a GrContextOption that are no longer relevant.

PS9: Adjusts surface creation unit test expectations, and
changes the raster rules accordingly.

At this point, sRGB configs are (obviously) going to be broken.

Locally, I ran 8888, gl, and the gbr- versions of both. Across
all GMs x configs, there are 13 diffs. 12 are GMs that create
surfaces with a color-space attached (and thus, the offscreen
is no longer getting sRGB pixel config). The only remainder
constructs an SkPictureImageGenerator, (with an attached color
space) and renders it to the gbr-gl canvas, which triggers a
a tagged surface inside the generator.

Bug: skia:
Change-Id: Ie5edfa157dd799f3121e8173fc4f97f6c8ed6789
Reviewed-on: https://skia-review.googlesource.com/131282
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-06-01 17:00:26 +00:00
Brian Osman
c7ad40f76f Remove SK_SUPPORT_GPU checks in tool-only code
Most of this is (obviously) not necessary to do, but once
I started, I figured I'd just get it all. Tools (nanobench,
DM, skiaserve), all GMs, benches, and unit tests, plus support
code (command line parsing and config stuff).

This is almost entirely mechanical.

Bug: skia:
Change-Id: I209500f8df8c5bd43f8298ff26440d1c4d7425fb
Reviewed-on: https://skia-review.googlesource.com/131153
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-05-31 18:59:44 +00:00
Greg Daniel
81df0414c8 Reland "Use GrVkMemoryAllocator for vulkan memory allocations in ganesh."
This is a reland of 331c266ed7

Original change's description:
> Use GrVkMemoryAllocator for vulkan memory allocations in ganesh.
> 
> Besides using the new allocator, the big logical change is that map
> and unmap calls form GrVkMemory are specc'd to map the entire GrVkAlloc
> instead of a specific offset and size as they did before. As a
> consequence of this, we move the handling of non-coherent alignment
> for flush/invalidate calls to GrVkMemory instead of the callers.
> 
> Bug: skia:
> Change-Id: I794d713106602f27aa7e808c306bbb69fd2b67be
> Reviewed-on: https://skia-review.googlesource.com/130021
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Jim Van Verth <jvanverth@google.com>

Bug: skia:
Change-Id: Ia9a4192d344449fb444d2adaa1d62ff1ede4b21d
Reviewed-on: https://skia-review.googlesource.com/131083
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-05-31 18:21:25 +00:00
Mike Klein
a23436cf1a binary literals!
feels so good.

Change-Id: I24d223957945ee81f34e5815a8e9afe32ef5004e
Reviewed-on: https://skia-review.googlesource.com/131110
Commit-Queue: Mike Klein <mtklein@chromium.org>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Mike Klein <mtklein@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-05-31 15:19:23 +00:00
Cary Clark
89ad31e97c Revert "Reland "remove toString""
This reverts commit 92e37b6d79.

Reason for revert: toString still used by flutter

Original change's description:
> Reland "remove toString"
> 
> This reverts commit 32a4910e57.
> 
> Reason for revert: SkMatrix::toString use has been removed from flutter and has been picked up in fuchsia
> 
> Original change's description:
> > Revert "remove toString"
> > 
> > This reverts commit 5191880cbf.
> > 
> > Reason for revert: broke flutter
> > 
> > Original change's description:
> > > remove toString
> > > 
> > > toString may have been used by obsolete debugger only
> > > find out if that is so
> > > 
> > > R=​brianosman@google.com,bsalomon@google.com
> > > 
> > > Docs-Preview: https://skia.org/?cl=119894
> > > Bug:830651
> > > Change-Id: I737f19b7d3fbc869bea2f443fa3b5ed7c1393ffd
> > > Reviewed-on: https://skia-review.googlesource.com/119894
> > > Commit-Queue: Cary Clark <caryclark@google.com>
> > > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > 
> > TBR=bsalomon@google.com,brianosman@google.com,caryclark@google.com,caryclark@skia.org
> > 
> > Change-Id: I9f81de6c3615ee0608bcea9081b77239b4b8816c
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Bug: 830651
> > Reviewed-on: https://skia-review.googlesource.com/129340
> > Reviewed-by: Cary Clark <caryclark@google.com>
> > Commit-Queue: Cary Clark <caryclark@google.com>
> 
> TBR=bsalomon@google.com,brianosman@google.com,caryclark@google.com,caryclark@skia.org
> 
> # Not skipping CQ checks because original CL landed > 1 day ago.
> 
> Bug: 830651
> Change-Id: Ida8725b6051132d8c46faf99358a8fcc1bcabf34
> Reviewed-on: https://skia-review.googlesource.com/129623
> Reviewed-by: Cary Clark <caryclark@skia.org>
> Reviewed-by: Cary Clark <caryclark@google.com>
> Commit-Queue: Cary Clark <caryclark@google.com>

TBR=bsalomon@google.com,brianosman@google.com,caryclark@google.com,caryclark@skia.org

Change-Id: Iafc59ffc1b3db67c520ba31bf12d68e1b46c0ea2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 830651
Reviewed-on: https://skia-review.googlesource.com/131082
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
2018-05-31 12:27:44 +00:00
Cary Clark
92e37b6d79 Reland "remove toString"
This reverts commit 32a4910e57.

Reason for revert: SkMatrix::toString use has been removed from flutter and has been picked up in fuchsia

Original change's description:
> Revert "remove toString"
> 
> This reverts commit 5191880cbf.
> 
> Reason for revert: broke flutter
> 
> Original change's description:
> > remove toString
> > 
> > toString may have been used by obsolete debugger only
> > find out if that is so
> > 
> > R=​brianosman@google.com,bsalomon@google.com
> > 
> > Docs-Preview: https://skia.org/?cl=119894
> > Bug:830651
> > Change-Id: I737f19b7d3fbc869bea2f443fa3b5ed7c1393ffd
> > Reviewed-on: https://skia-review.googlesource.com/119894
> > Commit-Queue: Cary Clark <caryclark@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> 
> TBR=bsalomon@google.com,brianosman@google.com,caryclark@google.com,caryclark@skia.org
> 
> Change-Id: I9f81de6c3615ee0608bcea9081b77239b4b8816c
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: 830651
> Reviewed-on: https://skia-review.googlesource.com/129340
> Reviewed-by: Cary Clark <caryclark@google.com>
> Commit-Queue: Cary Clark <caryclark@google.com>

TBR=bsalomon@google.com,brianosman@google.com,caryclark@google.com,caryclark@skia.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 830651
Change-Id: Ida8725b6051132d8c46faf99358a8fcc1bcabf34
Reviewed-on: https://skia-review.googlesource.com/129623
Reviewed-by: Cary Clark <caryclark@skia.org>
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
2018-05-31 11:43:13 +00:00
Stephen White
53a0298de3 GrTessellator: fix for ping-pong split fuzzer hang.
When support for out-of-range intersections was added in
3b5a3fa8b1, it was intended to support
splitting edges that are almost flat, where merging with the top or
bottom vertex would cause visual artifacts. However, it triggers too
often for other, non-nearly-flat cases, causing simplify() to loop
infinitely.

The fix is to support out-of-range intersections only if they differ by
1/2 machine epsilon. This also generalizes the
out_of_range_and_collinear() check, so it was removed.

Bug: 838978
Change-Id: I238f2b90e4b7ad647ecf072427ee38726e549581
Reviewed-on: https://skia-review.googlesource.com/130458
Reviewed-by: Stephen White <senorblanco@chromium.org>
2018-05-31 10:48:06 +00:00
Greg Daniel
a9d3dae67a Revert "Use GrVkMemoryAllocator for vulkan memory allocations in ganesh."
This reverts commit 331c266ed7.

Reason for revert: breaking an intel vulkan bot

Original change's description:
> Use GrVkMemoryAllocator for vulkan memory allocations in ganesh.
> 
> Besides using the new allocator, the big logical change is that map
> and unmap calls form GrVkMemory are specc'd to map the entire GrVkAlloc
> instead of a specific offset and size as they did before. As a
> consequence of this, we move the handling of non-coherent alignment
> for flush/invalidate calls to GrVkMemory instead of the callers.
> 
> Bug: skia:
> Change-Id: I794d713106602f27aa7e808c306bbb69fd2b67be
> Reviewed-on: https://skia-review.googlesource.com/130021
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Jim Van Verth <jvanverth@google.com>

TBR=egdaniel@google.com,jvanverth@google.com,bsalomon@google.com

Change-Id: I5237c00625dc95d3d9b36c1e5591762988d85562
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/131081
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-05-30 22:59:08 +00:00
Brian Osman
a15cedbc26 Clean up GPU configs in DM
Remove wide and narrow, adjust remaining configs to match the new CPU
configs, and fix several formatting problems in the help output.

Bug: skia:
Change-Id: I0946ac407d88a922e7f62220e7f4b39ae8c2e469
Reviewed-on: https://skia-review.googlesource.com/131000
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-05-30 20:10:38 +00:00
Greg Daniel
331c266ed7 Use GrVkMemoryAllocator for vulkan memory allocations in ganesh.
Besides using the new allocator, the big logical change is that map
and unmap calls form GrVkMemory are specc'd to map the entire GrVkAlloc
instead of a specific offset and size as they did before. As a
consequence of this, we move the handling of non-coherent alignment
for flush/invalidate calls to GrVkMemory instead of the callers.

Bug: skia:
Change-Id: I794d713106602f27aa7e808c306bbb69fd2b67be
Reviewed-on: https://skia-review.googlesource.com/130021
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2018-05-30 19:52:38 +00:00
Brian Salomon
70132d0c73 Make GrPrimitiveProcessor::Attribute a class, hide data members.
Change-Id: I008881d79c82fdde6bb68fe2218e62ccc9c538dd
Reviewed-on: https://skia-review.googlesource.com/130600
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-05-30 18:11:48 +00:00
Brian Osman
8dc68c67f8 Make skcms mandatory
Change-Id: I6b08cd586d313e3bc41c0da90698fc26ae1a8bb8
Reviewed-on: https://skia-review.googlesource.com/130822
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-05-30 17:37:49 +00:00
Bruce Wang
61f36d3225 Check file name valid or not.
Change-Id: Ia122050cabf68671c27e8aef3c69ec038c790899
Reviewed-on: https://skia-review.googlesource.com/130461
Commit-Queue: Ben Wagner <bungeman@google.com>
Commit-Queue: Bruce Wang <brucewang@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2018-05-29 22:00:07 +00:00
Ravi Mistry
cd21d676b7 Revert "fonts: Use correct SurfaceProps in analysis canvas for remoting."
This reverts commit 4f078f7cfa.

Reason for revert: Seems to have caused these breakages:
* https://chromium-swarm.appspot.com/task?id=3dc6788dc7b77010&refresh=10
* https://chromium-swarm.appspot.com/task?id=3dc67452db797c10&refresh=10

Original change's description:
> fonts: Use correct SurfaceProps in analysis canvas for remoting.
> 
> SaveLayer may not preserve the behaviour for lcd text, in which case
> the surfaceProps used for desc generation are inconsistent.
> 
> R=​herb@google.com
> 
> Bug: 829622
> Change-Id: I3adfc6780f26e4eb333a8aff76eaa4b5a9f0a0a7
> Reviewed-on: https://skia-review.googlesource.com/129557
> Reviewed-by: Herb Derby <herb@google.com>
> Commit-Queue: Khusal Sagar <khushalsagar@chromium.org>

TBR=herb@google.com,khushalsagar@chromium.org

Change-Id: I0372a3d834f8c4c929feb71c2b6b13739443eaaa
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 829622
Reviewed-on: https://skia-review.googlesource.com/130680
Reviewed-by: Ravi Mistry <rmistry@google.com>
Commit-Queue: Ravi Mistry <rmistry@google.com>
2018-05-29 21:45:58 +00:00
Khushal
4f078f7cfa fonts: Use correct SurfaceProps in analysis canvas for remoting.
SaveLayer may not preserve the behaviour for lcd text, in which case
the surfaceProps used for desc generation are inconsistent.

R=herb@google.com

Bug: 829622
Change-Id: I3adfc6780f26e4eb333a8aff76eaa4b5a9f0a0a7
Reviewed-on: https://skia-review.googlesource.com/129557
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Khusal Sagar <khushalsagar@chromium.org>
2018-05-29 20:36:37 +00:00
Mike Klein
cdbec8f197 remove bit, srgbnl config in DM
We're not going to need the bit.

I've rewritten "esrgb" and "srgbnl" to express themselves the way I'd
like them to work.  Their images are supressed in Gold already.

Change-Id: I6da58cc75dcb998cbfcf9a8f65de31c030adb494
Reviewed-on: https://skia-review.googlesource.com/130506
Reviewed-by: Brian Osman <brianosman@google.com>
2018-05-29 19:14:03 +00:00
Ravi Mistry
bfe959872e Revert "GrTessellator: fix for ping-pong split fuzzer hang."
This reverts commit bfb2a05af1.

Reason for revert: Seems to cause failures in chromeos and chromecast test bots. eg:
https://chromium-swarm.appspot.com/task?id=3dc5be8269e3b410&refresh=10
https://chromium-swarm.appspot.com/task?id=3dc5d62dfdc99010&refresh=10

Original change's description:
> GrTessellator: fix for ping-pong split fuzzer hang.
> 
> Change 3b5a3fa8b1 introduced support for
> splitting on out-of-range intersections. However, this is only necessary
> for correctness when the edge is nearly-flat (the top and bottom
> points only differ by 1/2 machine epsilon in the primary sort criterion).
> In other cases, it can cause repeated splitting and re-merging of edges,
> as the intersection code (being approximate and not exact) may produce a
> ping-pong set of intersections.
> 
> The fix is to support out-of-range intersections only if they differ by
> 1/2 machine epsilon. This also generalizes the
> out_of_range_and_collinear() check, so it was removed.
> 
> Bug: 838978
> Change-Id: I134f7eff3f15707e0d68de11c55f7fadce4ff8e7
> Reviewed-on: https://skia-review.googlesource.com/130448
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Stephen White <senorblanco@chromium.org>

TBR=robertphillips@google.com,senorblanco@chromium.org

Change-Id: I3fa62423d3875665397adcecb94b467b9b6611cc
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 838978
Reviewed-on: https://skia-review.googlesource.com/130522
Reviewed-by: Ravi Mistry <rmistry@google.com>
Commit-Queue: Ravi Mistry <rmistry@google.com>
2018-05-29 18:19:17 +00:00
Stephen White
bfb2a05af1 GrTessellator: fix for ping-pong split fuzzer hang.
Change 3b5a3fa8b1 introduced support for
splitting on out-of-range intersections. However, this is only necessary
for correctness when the edge is nearly-flat (the top and bottom
points only differ by 1/2 machine epsilon in the primary sort criterion).
In other cases, it can cause repeated splitting and re-merging of edges,
as the intersection code (being approximate and not exact) may produce a
ping-pong set of intersections.

The fix is to support out-of-range intersections only if they differ by
1/2 machine epsilon. This also generalizes the
out_of_range_and_collinear() check, so it was removed.

Bug: 838978
Change-Id: I134f7eff3f15707e0d68de11c55f7fadce4ff8e7
Reviewed-on: https://skia-review.googlesource.com/130448
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2018-05-29 17:10:16 +00:00
Mike Klein
97918ff4ae wouldn't it be nice?
Here's our drawing pipeline if we always blend as encoded.
I think it's very intuitive.

Change-Id: I0e531c5da1f6279d0da1f19b84d6317d99942da3
Reviewed-on: https://skia-review.googlesource.com/130131
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2018-05-29 16:03:46 +00:00
Florin Malita
3b526b05d6 "Modularize" SkSG
* relocate all SkSG-related files under modules/sksg/
* fix various tidbits to make non-sksg builds possible
* drop obsolete SampleSGInval.cpp

Change-Id: I54e6c5bb1a09f45030fa8d607b3eb3f7cba78957
Reviewed-on: https://skia-review.googlesource.com/130025
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-05-25 17:11:52 +00:00
Herb Derby
26cbe5130a Rename GrAtlasTextContext -> GrTextContext
Change-Id: I309b39425afc9b45095241eeb299096bc426afed
Reviewed-on: https://skia-review.googlesource.com/130029
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2018-05-24 20:41:08 +00:00
Mike Klein
4a0ad501e4 skip unpremul...premul with only linear ops between
Change-Id: I26ed83bb613a83a0fd73f2f8b868b775be1ce968
Reviewed-on: https://skia-review.googlesource.com/130121
Commit-Queue: Mike Klein <mtklein@chromium.org>
Auto-Submit: Mike Klein <mtklein@chromium.org>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-05-24 20:37:18 +00:00
Mike Klein
77418559ca skip transfer functions when not needed
Change-Id: I72e1084e6a14b3c1fa3f0a5c2100f13c6bcb24c7
Reviewed-on: https://skia-review.googlesource.com/130062
Commit-Queue: Mike Klein <mtklein@chromium.org>
Auto-Submit: Mike Klein <mtklein@chromium.org>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-05-24 20:31:08 +00:00
Mike Klein
be6e575ee7 spin off unpremul and opaque tests
- opaque and unpremul are never the same...
    there's no reason to ever premul opaque sources.

  - under optimization, they won't always be a deterministic
    tweak the the premul steps (though right now they still are).

Change-Id: I5669b3dba83774326c07d5a8f16b1d2ce2b22aae
Reviewed-on: https://skia-review.googlesource.com/130061
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@chromium.org>
2018-05-24 19:51:51 +00:00
Brian Salomon
8a8dd33e18 Make SkImage own its GrContext.
Change-Id: I86577fab5406ae9ad89d87fa971b0db6e0283cb4
Reviewed-on: https://skia-review.googlesource.com/130020
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-05-24 19:34:19 +00:00
Mike Klein
7d8276cbab skip gamut transform when identity
Change-Id: I3bb3ec19ee856ce4070a58a57b3bb8e8a170a5b9
Reviewed-on: https://skia-review.googlesource.com/130024
Commit-Queue: Mike Klein <mtklein@chromium.org>
Auto-Submit: Mike Klein <mtklein@chromium.org>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-05-24 18:36:41 +00:00
Mike Klein
6968f9ce54 SkColorSpaceXformSteps
Lots TODO.

Change-Id: I95edb764b85a5140d432adb506c3b537869e6df4
Reviewed-on: https://skia-review.googlesource.com/129933
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@chromium.org>
2018-05-24 18:24:48 +00:00
Leon Scroggins III
7916c0ec35 Properly zero in webp if no prior frame
When erasing the prior frame rect, we need to update the frame rect to
take scaling into account. We already do if the prior frame was
provided; also do so if it was not provided.

Note that this only affects an image with a restore previous frame that
is being scaled. webp does not support restore previous, so this will
not affect AnimatedImageDrawable in Android.

Change-Id: I2d9a4ad45262a0e7afd1134958aff5c6e2ca6687
Reviewed-on: https://skia-review.googlesource.com/115646
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2018-05-24 18:18:08 +00:00
Mike Reed
d2e74b8080 compute center slightly slower to avoid overflow
Bug: oss-fuzz:8509
Change-Id: I13b1a77e1549070827a7cc534b062ec85aad255e
Reviewed-on: https://skia-review.googlesource.com/129930
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-05-24 15:16:43 +00:00
Khushal
d416083eef Reland fonts: Cleanup cache miss logging for font remoting.
This reverts commit fc6cf92e4b.

TBR=herb@google.com
Bug: skia:7913
Change-Id: I93301e49839fdb895a5f1f5845bb9975981c69fc
Reviewed-on: https://skia-review.googlesource.com/129880
Reviewed-by: Khusal Sagar <khushalsagar@chromium.org>
Commit-Queue: Khusal Sagar <khushalsagar@chromium.org>
2018-05-24 01:42:51 +00:00
Khushal
3e7548ca60 Reland fonts: Add support for distance field text to font remoting.
This reverts commit 7257e22e43.

TBR=herb@google.com, bsalomon@google.com
Bug: skia:7913
Change-Id: I51ca5bccdda64cd98e2ad59874e7136ee58cec10
Reviewed-on: https://skia-review.googlesource.com/129809
Reviewed-by: Khusal Sagar <khushalsagar@chromium.org>
Commit-Queue: Khusal Sagar <khushalsagar@chromium.org>
2018-05-24 01:11:21 +00:00
Leon Scroggins III
4aafb3a8d1 Alternate between two SkBitmaps in SkAnimatedImage
Bug: 78866720

The client in Android calls newPictureSnapshot, which results in copying
the mutable SkBitmap into a newly allocated one in each frame. Avoid
this by calling SkMakeImageFromRasterBitmap with
kNever_SkCopyPixelsMode. Make SkAnimatedImage copy on write, by copying
before decoding if the bitmap's pixel ref is not unique.

Android's AnimatedImageDrawable's current architecture only decodes one
frame in advance, so it will never need to perform the copy on write.
This will save one bitmap allocation per GIF frame.

Add a test to verify that copy on write works as expected.

Change-Id: I87eb6e84089096cd2d618b91fb627fc58677e66a
Reviewed-on: https://skia-review.googlesource.com/129841
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
Auto-Submit: Leon Scroggins <scroggo@google.com>
2018-05-23 20:49:42 +00:00
Brian Osman
499afea43c Replace ICC profile in CodecTest with AdobeRGB
Change-Id: I00ca97ce7f584bdcc042f7e76fb0f8116978b799
Reviewed-on: https://skia-review.googlesource.com/129761
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-05-23 17:47:51 +00:00
Mike Klein
8fcfcc5686 update ColorSpaceTest.cpp to remove MakeICC
The upperLeft and upperRight profiles are A2B/B2A-only, and so cannot be
represented as SkColorSpace using SkColorSpace::Make(skcms_ICCProfile).
They do parse fine, of course.

Change-Id: Iaf51911c2b06b985037d3d5e74b043fb344e320e
Reviewed-on: https://skia-review.googlesource.com/129653
Commit-Queue: Mike Klein <mtklein@chromium.org>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@chromium.org>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-05-23 17:11:11 +00:00
Mike Reed
ee43091c1b fix 0.499999f rounding case for triangles
Bug: skia:7994
Change-Id: I83bb309a2c8fb0bddaf78ba32c0a07537e483900
Reviewed-on: https://skia-review.googlesource.com/129648
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-05-23 16:54:32 +00:00
Mike Reed
5bedc80b26 reduce clip-limit for scan converter to avoid quad-edge overflow
For raster drawing, we already have a more conservative guard in SkBitmapDevice,
which "tiles" the drawing on 8K boundaries (the smaller limit needed for antialiasing
scan converters). This change is just needed for non-drawing uses of the scan converter.

Bug: skia:7998
Bug: oss-fuzz:8483
Change-Id: Icfee9ca1ffcf93a2a8a3078d9ee10494fa04a6c7
Reviewed-on: https://skia-review.googlesource.com/129628
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-05-23 14:33:51 +00:00
Chris Dalton
f104fec6d7 Delete GrDrawOp::wasRecorded
Bug: skia:7988
Change-Id: I8d12beec835767f22302a1e167fcef46ee5e5ffc
Reviewed-on: https://skia-review.googlesource.com/129555
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2018-05-23 13:27:41 +00:00
Mike Reed
3087c1f382 tweak tolerance again for cubics
Bug: 845489
Bug: skia:7995
Change-Id: I05554377bd5630b7134864b6db282358613f1030
Reviewed-on: https://skia-review.googlesource.com/129721
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-05-23 13:26:41 +00:00
Mike Klein
6747f52778 Reland "start cleaning up non-skcms SkColorSpaceXforms"
This is a reland of 339133f82c

Original change's description:
> start cleaning up non-skcms SkColorSpaceXforms
> 
> I think this gets rid of
>   - SkColorSpaceXform_Base
>   - SkColorSpaceXform_XYZ
>   - SkColorSpaceXform_A2B
> and lots of support code.  Might be more left to clean up?
> 
> Change-Id: I560d974d1e879dfd6a63ee2244a3dd88bd495c8a
> Reviewed-on: https://skia-review.googlesource.com/129512
> Commit-Queue: Brian Osman <brianosman@google.com>
> Auto-Submit: Mike Klein <mtklein@chromium.org>
> Reviewed-by: Brian Osman <brianosman@google.com>

Change-Id: I33ee0d8bcfd72c401823a2e7d5168c9ecc9a5181
Reviewed-on: https://skia-review.googlesource.com/129624
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-05-23 12:30:36 +00:00
Mike Klein
7257e22e43 Revert "fonts: Add support for distance field text to font remoting."
This reverts commit 35e0a1a690.

Reason for revert: looks like we're leaking paths?
https://chromium-swarm.appspot.com/task?id=3da25e2f0cadb210&refresh=10

Original change's description:
> fonts: Add support for distance field text to font remoting.
> 
> R=​jvanverth@google.com, herb@google.com
> 
> Bug: skia:7913
> Change-Id: Id3f5b3e75005be9a7234df774268359b406c99a8
> Reviewed-on: https://skia-review.googlesource.com/128970
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Jim Van Verth <jvanverth@google.com>
> Commit-Queue: Khusal Sagar <khushalsagar@chromium.org>

TBR=jvanverth@google.com,bsalomon@google.com,bungeman@google.com,herb@google.com,khushalsagar@chromium.org

Change-Id: I37c54c8748db9b20e1f48016d8298808a1999fdb
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7913
Reviewed-on: https://skia-review.googlesource.com/129681
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-05-23 00:17:16 +00:00
Mike Klein
fc6cf92e4b Revert "fonts: Cleanup cache miss logging for font remoting."
This reverts commit 2b8a0d1844.

Reason for revert: reverting a CL this builds on

Original change's description:
> fonts: Cleanup cache miss logging for font remoting.
> 
> Add hooks to notify the embedder if there is a cache miss during draw.
> Also remove the reference to SkStrikeClient from SkTypefaceProxy and
> SkScalerContextProxy, since the proxies can outlive the client.
> 
> R=​herb@google.com
> 
> Bug: 829622
> Change-Id: Ib2fd1b91ebd057856c1d4e717cf50b49f08c903b
> Reviewed-on: https://skia-review.googlesource.com/129402
> Commit-Queue: Khusal Sagar <khushalsagar@chromium.org>
> Reviewed-by: Herb Derby <herb@google.com>

TBR=herb@google.com,khushalsagar@chromium.org

Change-Id: I8a331545988885c620685008f4b60240d80f3712
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 829622
Reviewed-on: https://skia-review.googlesource.com/129682
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-05-23 00:16:56 +00:00
Mike Klein
e60ae82dec Revert "start cleaning up non-skcms SkColorSpaceXforms"
This reverts commit 339133f82c.

Reason for revert: broke NinePatchDrawableTest.testGetPadding?  stranger things have happened.

Original change's description:
> start cleaning up non-skcms SkColorSpaceXforms
> 
> I think this gets rid of
>   - SkColorSpaceXform_Base
>   - SkColorSpaceXform_XYZ
>   - SkColorSpaceXform_A2B
> and lots of support code.  Might be more left to clean up?
> 
> Change-Id: I560d974d1e879dfd6a63ee2244a3dd88bd495c8a
> Reviewed-on: https://skia-review.googlesource.com/129512
> Commit-Queue: Brian Osman <brianosman@google.com>
> Auto-Submit: Mike Klein <mtklein@chromium.org>
> Reviewed-by: Brian Osman <brianosman@google.com>

TBR=mtklein@chromium.org,brianosman@google.com

Change-Id: I9e76195481b8658b34936aeece278d81c286c0fa
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/129680
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-05-23 00:06:46 +00:00
Khushal
2b8a0d1844 fonts: Cleanup cache miss logging for font remoting.
Add hooks to notify the embedder if there is a cache miss during draw.
Also remove the reference to SkStrikeClient from SkTypefaceProxy and
SkScalerContextProxy, since the proxies can outlive the client.

R=herb@google.com

Bug: 829622
Change-Id: Ib2fd1b91ebd057856c1d4e717cf50b49f08c903b
Reviewed-on: https://skia-review.googlesource.com/129402
Commit-Queue: Khusal Sagar <khushalsagar@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
2018-05-22 22:01:35 +00:00
Khushal
35e0a1a690 fonts: Add support for distance field text to font remoting.
R=jvanverth@google.com, herb@google.com

Bug: skia:7913
Change-Id: Id3f5b3e75005be9a7234df774268359b406c99a8
Reviewed-on: https://skia-review.googlesource.com/128970
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Khusal Sagar <khushalsagar@chromium.org>
2018-05-22 19:49:45 +00:00
Mike Klein
339133f82c start cleaning up non-skcms SkColorSpaceXforms
I think this gets rid of
  - SkColorSpaceXform_Base
  - SkColorSpaceXform_XYZ
  - SkColorSpaceXform_A2B
and lots of support code.  Might be more left to clean up?

Change-Id: I560d974d1e879dfd6a63ee2244a3dd88bd495c8a
Reviewed-on: https://skia-review.googlesource.com/129512
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@chromium.org>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-05-22 18:19:35 +00:00
Ben Wagner
d90cd3b279 Revert "Revert "IWYU for tests starting with 'D'.""
This reverts commit edf8449d2c.

Change-Id: Ibeedd9965855b3ccfe44486d15307bf3da15fd9c
Reviewed-on: https://skia-review.googlesource.com/129516
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2018-05-22 17:12:35 +00:00
Stephen White
7b376940e4 GrTessellator: fix crash on merging a dead edge.
When merging coincident vertices, sometimes merging an edge will cause
the next edge in the list to die. But since merge_vertices() retrieves
the next edge before merging the current one, we then try to merge its
lifeless corpse, bringing it back as a zombie. The fix is to leave
dead edges, dead.

This was revealed by ec79c39a77, but was
likely a real bug that was being mishandled before that.

Bug: 844873
Bug: skia:7982
Change-Id: I752c45f7551df4278fa4cb4587e7ead48cd16a21
Reviewed-on: https://skia-review.googlesource.com/129524
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-05-22 16:52:45 +00:00
Mike Klein
5b58b7c14c Reland "strip down SkICC.cpp"
This reverts commit 27fe397bc0.

Reason for revert: time to fly.

Original change's description:
> Revert "strip down SkICC.cpp"
> 
> This reverts commit eab50eb9c6
> and this tiny bit of e61b969a07:
> 
>     https://skia-review.googlesource.com/c/skia/+/127122/3/tests/ICCTest.cpp
> 
> Change-Id: I4306e5118a4e5eb88c05078186a28bd443fd76f7
> Reviewed-on: https://skia-review.googlesource.com/127305
> Reviewed-by: Mike Klein <mtklein@chromium.org>
> Commit-Queue: Mike Klein <mtklein@chromium.org>

TBR=mtklein@chromium.org,brianosman@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I93a6cfb66f0da0e098fdcb77ac1cd619e41614b1
Reviewed-on: https://skia-review.googlesource.com/129446
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-05-22 14:17:15 +00:00
Mike Klein
edf8449d2c Revert "IWYU for tests starting with 'D'."
This reverts commit b5f2897ab5.

Reason for revert: looks like this broke the build for DM in Google3.  Need more include dirs there?

Original change's description:
> IWYU for tests starting with 'D'.
> 
> Change-Id: I9189e4b56ce1635b627119733447c2ed4220753d
> Reviewed-on: https://skia-review.googlesource.com/129319
> Reviewed-by: Herb Derby <herb@google.com>
> Commit-Queue: Ben Wagner <bungeman@google.com>

TBR=bsalomon@google.com,bungeman@google.com,herb@google.com

Change-Id: I01aac7dae6114685a0652cbde3defccc8a42caea
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/129443
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-05-22 12:23:15 +00:00
Mike Klein
8afa554414 Revert "remove fragile hack in addOval to avoid computing bounds"
This reverts commit bc721ba4be.

Reason for revert: I think we'll want to reland with guards for layout tests.  https://test-results.appspot.com/data/layout_results/linux_trusty_blink_rel/29630/layout-test-results/results.html


Original change's description:
> remove fragile hack in addOval to avoid computing bounds
> 
> Bug: skia:
> Change-Id: Ide917f54633370f1fce46a115fa923794b981e2e
> Reviewed-on: https://skia-review.googlesource.com/129461
> Reviewed-by: Mike Klein <mtklein@google.com>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=mtklein@google.com,reed@google.com

Change-Id: Ibadac8bbeca2b162d696e7cca51d580121afe71f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/129442
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-05-22 12:19:25 +00:00
Herb Derby
1e7c65806f drawPosText no longer obeys paint alignment
Change-Id: Iac498b54dea4aa1b203d2b9c58e15bb5f2147f82
Reviewed-on: https://skia-review.googlesource.com/129462
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2018-05-21 21:53:54 +00:00
Chris Dalton
4bfb50b904 ccpr: Abstract the draws list in a separate class
Bug: skia:
Change-Id: I583c1bdc470e5830d041955d14b164fc00d5d014
Reviewed-on: https://skia-review.googlesource.com/129227
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2018-05-21 21:52:54 +00:00
Mike Reed
bc721ba4be remove fragile hack in addOval to avoid computing bounds
Bug: skia:
Change-Id: Ide917f54633370f1fce46a115fa923794b981e2e
Reviewed-on: https://skia-review.googlesource.com/129461
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-05-21 21:11:44 +00:00
Ben Wagner
b5f2897ab5 IWYU for tests starting with 'D'.
Change-Id: I9189e4b56ce1635b627119733447c2ed4220753d
Reviewed-on: https://skia-review.googlesource.com/129319
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2018-05-21 19:34:48 +00:00
Greg Daniel
6d138bf681 Reland "Remove GrBackendObject and all related functions from Skia."
This is a reland of ccd4cfc23e

Original change's description:
> Remove GrBackendObject and all related functions from Skia.
> 
> Bug: skia:
> Change-Id: I59434b7477c0bc26fd982bd81eb97ab94bbba073
> Reviewed-on: https://skia-review.googlesource.com/125822
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

Bug: skia:
Change-Id: Ibd1b9bd04b36840d9d872e2f0970dd6bac378bc9
Reviewed-on: https://skia-review.googlesource.com/129380
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-05-21 18:25:38 +00:00
Cary Clark
4dc5a45405 remove defines and add commas
Preparation for generating bookmaker files for all remaining
interfaces

Standardize enum and enum classes by including a comma after
the last entry.

Replace flatten-related #define in public interfaces
with their equivalent.

The motivation is to give documentation something to refer to.

An alternative would be to move part or all of this out of the
public interface; something I can work on in a follow-up CL.

R=reed@google.com,bsalomon@google.com

Bug: skia:6898
Change-Id: I4b865f6ec3d8f5d31e50448fef7d2714510302f0
Reviewed-on: https://skia-review.googlesource.com/129312
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Cary Clark <caryclark@skia.org>
2018-05-21 17:33:39 +00:00
Cary Clark
32a4910e57 Revert "remove toString"
This reverts commit 5191880cbf.

Reason for revert: broke flutter

Original change's description:
> remove toString
> 
> toString may have been used by obsolete debugger only
> find out if that is so
> 
> R=​brianosman@google.com,bsalomon@google.com
> 
> Docs-Preview: https://skia.org/?cl=119894
> Bug:830651
> Change-Id: I737f19b7d3fbc869bea2f443fa3b5ed7c1393ffd
> Reviewed-on: https://skia-review.googlesource.com/119894
> Commit-Queue: Cary Clark <caryclark@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

TBR=bsalomon@google.com,brianosman@google.com,caryclark@google.com,caryclark@skia.org

Change-Id: I9f81de6c3615ee0608bcea9081b77239b4b8816c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 830651
Reviewed-on: https://skia-review.googlesource.com/129340
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
2018-05-20 23:15:48 +00:00
Cary Clark
5191880cbf remove toString
toString may have been used by obsolete debugger only
find out if that is so

R=brianosman@google.com,bsalomon@google.com

Docs-Preview: https://skia.org/?cl=119894
Bug:830651
Change-Id: I737f19b7d3fbc869bea2f443fa3b5ed7c1393ffd
Reviewed-on: https://skia-review.googlesource.com/119894
Commit-Queue: Cary Clark <caryclark@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-05-20 21:16:37 +00:00
Mike Reed
861b52ea98 tweak conservative bounds value to save aberrant cubic
Bug: 844457
Change-Id: Ia3c7c0592df59022cf04f6747b1fe30975431ea4
Reviewed-on: https://skia-review.googlesource.com/129200
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-05-18 20:14:54 +00:00
Brian Salomon
ec42e15c4d Add convenience overload of SkPointPriv::SetRectTriStrip that takes SkRect
Change-Id: Idf5bfafaf19c20f074f12d706b8b8984c5935e6d
Reviewed-on: https://skia-review.googlesource.com/129185
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-05-18 18:11:14 +00:00
Stephen White
ec79c39a77 GrTessellator: fix for zombie edge fuzzer crash.
While splitting one edge, merge_collinear_edges() may in rare cases
merge the other edge of the intersection out of existence.
split_edge() then brings these dead edges partially back to life,
leaving the mesh in an inconsistent state.

The fix is to null out the top and bottom pointers of dead edges to
mark them as dead, and only split living edges.

Bug: skia:7911
Change-Id: I1c0b59581acfcd0b8191f2d129b33f7d0d1a2516
Reviewed-on: https://skia-review.googlesource.com/129181
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2018-05-18 17:42:24 +00:00
Ben Wagner
255ab8d9a5 Make SkStream readers report failure.
This also fixes an issue noticed while making this change where
SkFontDescriptor improperly round trips negative axis values.

Change-Id: Iacc5929a185659dcacc18c802c4908e4f34c6899
Reviewed-on: https://skia-review.googlesource.com/128341
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
2018-05-18 15:06:24 +00:00
Khushal
51371a4339 fonts: Handle fallback to using paths for text rendering for remoting.
SkRemoteGlyphCache only sends images for glyphs, even for cases where
the gpu falls back to drawing text as paths. This includes cases in
SkDraw::ShouldDrawTextAsPaths and when the glyph exceeds the max bounds
that can fit on the atlas. Fix this by identifying these cases in the
renderer and sending paths instead.

Note: We still don't handle distance field text correctly.

R=herb@google.com, bsalomon@google.com

Bug: skia:7913
Change-Id: I17d4eccbeaa2e995ae67b61c76cebd27f8280329
Reviewed-on: https://skia-review.googlesource.com/128203
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Khusal Sagar <khushalsagar@chromium.org>
2018-05-17 20:50:43 +00:00
Robert Phillips
120784394c Fix srcBounds computation in SkMatrixConvolutionImageFilter
Note that this does change the behavior of the cropRect for the repeated case. The cropRect now only acts as a hard clip on the output.

BUG= skia:7766

Change-Id: I1d66678bc797cd4835701cd20c36e68b22ac880a
Reviewed-on: https://skia-review.googlesource.com/127338
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-05-17 17:06:24 +00:00
Brian Salomon
a33b67c36b Rewrite GrQuad to use separate arrays of x and y values to be Sk4f friendly.
Change-Id: Ie2ad197c5f17849fe6e034b60bc7ec18a00edb24
Reviewed-on: https://skia-review.googlesource.com/128842
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-05-17 15:29:13 +00:00
Cary Clark
c06754b046 mapRect should not fiddle with nonfinite values.
Docs-Preview: https://skia.org/?cl=128682
Bug: skia:7967
Change-Id: Ic43387b7705ee8385b8df2430886484ff856077c
Reviewed-on: https://skia-review.googlesource.com/128682
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-05-17 14:02:43 +00:00
Khushal
b2e71274fe fonts: Fix memory accounting for deserialized glyphs.
When deserializing glyphs in the SkRemoteGlyphCache, we allocate from
the arena for the SkGlyphCache but don't account for it in the total
memory used by the cache. Fix that and avoid exposing the SkArenaAlloc
from SkGlyphCache, since that can result in such brittle use.

R=herb@google.com

Bug: 829622
Change-Id: Iecff9ce6e0ed2c641957535363edec3e3fad178d
Reviewed-on: https://skia-review.googlesource.com/128112
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Khusal Sagar <khushalsagar@chromium.org>
2018-05-15 22:58:23 +00:00
Mike Reed
026d20f888 handle huge normalize requests (including non-finite x or y)
Bug: oss-fuzz:8023
Change-Id: I622b6e335d9efbe599fa9047b3a6fcee1664aa4a
Reviewed-on: https://skia-review.googlesource.com/124581
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-05-14 21:14:09 +00:00
Robert Phillips
5140f9a8e4 Minor refactoring to image filters
This pulls the boring parts out of: https://skia-review.googlesource.com/c/skia/+/127338 (Fix srcBounds computation in SkMatrixConvolutionImageFilter)

TBR=bsalomon@google.com
Change-Id: Iade788fcc96c4c16989d13e7592030a6a1d3f170
Reviewed-on: https://skia-review.googlesource.com/127573
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2018-05-14 12:01:59 +00:00
Brian Salomon
c7fe0f708c Make GrCaps and GrShaderCaps private.
Moves getCaps() from GrContext to GrContextPriv and removes unused refCaps().

Change-Id: Ic6a8951b656c0d1b2773eae73bff8e88af819866
Reviewed-on: https://skia-review.googlesource.com/127389
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2018-05-11 14:47:27 +00:00
Brian Osman
a0ca909142 Revert "Remove GrBackendObject and all related functions from Skia."
This reverts commit ccd4cfc23e.

Reason for revert: Fuchsia not building again. (Flutter roll may have been reverted?)

Original change's description:
> Remove GrBackendObject and all related functions from Skia.
> 
> Bug: skia:
> Change-Id: I59434b7477c0bc26fd982bd81eb97ab94bbba073
> Reviewed-on: https://skia-review.googlesource.com/125822
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com

Change-Id: Ie2c518b84b0c9513c0c622082de2831088b1ad8d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/127480
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-05-10 22:04:20 +00:00
Mike Klein
27fe397bc0 Revert "strip down SkICC.cpp"
This reverts commit eab50eb9c6
and this tiny bit of e61b969a07:

    https://skia-review.googlesource.com/c/skia/+/127122/3/tests/ICCTest.cpp

Change-Id: I4306e5118a4e5eb88c05078186a28bd443fd76f7
Reviewed-on: https://skia-review.googlesource.com/127305
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2018-05-10 21:44:56 +00:00
Mike Klein
ce4cf72e34 non-linear blending first steps
Code:
  - Add a non-linear blending bit and makeNonlinearBlending()
    to SkColorSpace
  - remove enough F16=linear checks to make it possible to
    create surfaces and encode pngs with nonlinear F16

Testing:
  - add "esrgb" software config to DM, run it
  - add "srgbnl" software config, run it
  - deemphasize importance of "srgb" config on bots
  - update unit tests to reflect relaxed F16 constraints
  - add a new unit test file with _really_ basic tests,
    and a new unit test that's not working yet

Bug: skia:7942

Change-Id: I8ac042bdf9f3d791765393b68fd9256375184d83
Reviewed-on: https://skia-review.googlesource.com/127325
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2018-05-10 18:26:22 +00:00
Mike Klein
c66eaaf2fb rm SkColorSpace_New
We think we can evolve SkColorSpace_XYZ into the One True SkColorSpace.

Change-Id: If93493145d78b388f3a0739cc7ccd6e232380733
Reviewed-on: https://skia-review.googlesource.com/127326
Auto-Submit: Mike Klein <mtklein@chromium.org>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-05-10 16:42:25 +00:00
Greg Daniel
ccd4cfc23e Remove GrBackendObject and all related functions from Skia.
Bug: skia:
Change-Id: I59434b7477c0bc26fd982bd81eb97ab94bbba073
Reviewed-on: https://skia-review.googlesource.com/125822
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-05-10 14:44:55 +00:00
Mike Klein
e61b969a07 SkColorSpace::Make(const skcms_ICCProfile&)
Change-Id: Ib12208d6c148f143fdd0b54538d852b97616a72d
Reviewed-on: https://skia-review.googlesource.com/127122
Commit-Queue: Mike Klein <mtklein@chromium.org>
Auto-Submit: Mike Klein <mtklein@chromium.org>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-05-09 19:36:01 +00:00
Mike Klein
eab50eb9c6 strip down SkICC.cpp
Most of SkICC{.h,.cpp} is unused and gone.

I've renamed the part that's left to SkWriteICCProfile() and tweaked its
API just a little, leaving SkICC:WriteToICC() a wrapper around it.

Most of the tests in ICCTest.cpp are moot and deleted, but a few looked
somewhat valuable so I've kept them with a little modification.

Change-Id: Ia1bb4c772af679885e17dac53d213c315ad0828c
Reviewed-on: https://skia-review.googlesource.com/127022
Auto-Submit: Mike Klein <mtklein@chromium.org>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2018-05-09 19:19:31 +00:00
Hal Canary
46cc3dabaf Revert "Revert "SkAdvancedTypefaceMetrics: factor out GlyphToUnicode""
This reverts commit 97c1108607.

Change-Id: Ic3c6addc64ced39766bbee3e10b4d88faf61ba2f
Reviewed-on: https://skia-review.googlesource.com/127021
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-05-09 18:00:35 +00:00
Greg Daniel
97c1108607 Revert "SkAdvancedTypefaceMetrics: factor out GlyphToUnicode"
This reverts commit 1c2bcd8b14.

Reason for revert: breaking chrome roll

Original change's description:
> SkAdvancedTypefaceMetrics: factor out GlyphToUnicode
> 
> Change-Id: Iedce8c1ea2c405d5ab64ccac353970d5cd2b9d63
> Reviewed-on: https://skia-review.googlesource.com/126507
> Commit-Queue: Hal Canary <halcanary@google.com>
> Reviewed-by: Ben Wagner <bungeman@google.com>

TBR=halcanary@google.com,bungeman@google.com,reed@google.com

Change-Id: Ib1ff8484ffd09cdb88d461ac00745aa32c191124
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/127000
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-05-09 15:36:06 +00:00
Hal Canary
1c2bcd8b14 SkAdvancedTypefaceMetrics: factor out GlyphToUnicode
Change-Id: Iedce8c1ea2c405d5ab64ccac353970d5cd2b9d63
Reviewed-on: https://skia-review.googlesource.com/126507
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2018-05-09 14:24:45 +00:00
Leon Scroggins III
8a8a144952 Treat SkFILEStream's fOriginalOffset as the start
Bug: b/78866720

::rewind() rewinds to fOriginalOffset
::seek(position) seeks to position + fOriginalOffset
::move(offset) will not move < fOriginalOffset
::getPosition() returns position relative to fOriginalOffset
::getLength() returns full size minus fOriginalOffset
::duplicate() and ::fork() pass on fOriginalOffset

Android may create an SkFILEStream using a file descriptor whose offset
is at the beginning of the data that Android cares about. Treat all
positions in SkFILEStream as relative to that original offset.

This allows AnimatedImageDrawable to read directly from the
SkFILEStream, rather than using an SkFrontBufferedStream and forcing
SkGifCodec to cache data for later use.

This fixes a TODO that was introduced in
https://skia-review.googlesource.com/c/skia/+/9498 and takes it a step
further. In that CL, bungeman@ and I discussed the change and decided to
"leave this alone for now to avoid changing behavior". Doing a code
search today, the only two callers want the new behavior.

Change-Id: I9211394d5b730adf528fac0df0af7a664b1295be
Reviewed-on: https://skia-review.googlesource.com/126511
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2018-05-08 20:41:04 +00:00
Mike Klein
ad67c66a58 track bounds of top-level control ops
We don't need an explicit save-restore block to determine the bounds of
top-level control operations... the implicit save-restore that all
picutres have should logically work the same way.

The commented test failed before this and passes now.

Bug: skia:7735
Change-Id: Ibd31a3a9b0b48042ab3869a6bb57bc8d8bb78c09
Reviewed-on: https://skia-review.googlesource.com/126460
Commit-Queue: Mike Klein <mtklein@chromium.org>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@chromium.org>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-05-07 16:14:09 +00:00
Mike Klein
738b80d8a5 Don't use getDeviceClipBounds() to bound pic ops.
The values returned by SkCanvas::getDeviceClipBounds() are in the right
space, but have extra constraints on them that are not desirable for
bounding the logical bounds of draw operations:

  - they are integral
  - they are non-negative

We've been intersecting the bounds of each operation with these bounds,
which means we're mixing these bogus constraints into the bounds of each
recorded operation.  This percolates up to the SkPicutre cull rect too.

The most egregious way to see the problem is to record a draw op
entirely in negative space... it'll come back with empty logical bounds
rather than its correct (negative-space) bounds.  I've added a test
for this, and another test I also think should be passing but left
making it so as a follow up.

I've had to disable a couple tests asserting clips affect the bounds. :/

A possible follow-up might go back to using the clips to tighten the
bounds of the ops, just so long as we take the original user bounds and
map them with the CTM through to device space ourselves, rather than
relying on the recording canvas' clip stack.  I think this means we'd
need to maintain our own stack of device-space float SkRect clip bounds
while calculating these op bounds.

Bug: skia:7735
Change-Id: I6bf15f6b2a9ba4329a4eeae7f9d57aa8729ec1bb
Reviewed-on: https://skia-review.googlesource.com/126002
Commit-Queue: Mike Klein <mtklein@chromium.org>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@chromium.org>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-05-04 18:56:13 +00:00
Ben Wagner
da926dbd69 Remove fCacheKeys from SkImageFilter.
No public API changes.

Bug: skia:7666, skia:7887
Change-Id: I8ac4ec37dd3d0fcc050bc977db41439a8e18895f
Reviewed-on: https://skia-review.googlesource.com/125500
Commit-Queue: Ben Wagner <benjaminwagner@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Auto-Submit: Ben Wagner <benjaminwagner@google.com>
2018-05-04 14:33:32 +00:00
Yuqian Li
737b9a9d48 Remove legacy guard flags
Bug: skia:
Change-Id: I3b526f2caec6766faea72cdc89550f50e17c71d2
Reviewed-on: https://skia-review.googlesource.com/125746
Reviewed-by: Cary Clark <caryclark@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Yuqian Li <liyuqian@google.com>
2018-05-03 18:48:32 +00:00
Khushal
b2e3934569 fonts: Cleanup header guard and stray printfs.
R=herb@google.com

Change-Id: I9d2865438f61f8e246f3a5e3548c0befbf402bc1
Reviewed-on: https://skia-review.googlesource.com/125643
Auto-Submit: Khusal Sagar <khushalsagar@chromium.org>
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2018-05-03 14:19:11 +00:00
Greg Daniel
b73a9f8b96 Add internal grsurface flag to track if using gl rectangle or external texture.
Bug: skia:
Change-Id: I84963833bbc3ae957c919a19f6e78fce2c9de7ef
Reviewed-on: https://skia-review.googlesource.com/125294
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-05-02 21:34:58 +00:00
Khushal
38a0843688 fonts: Reland push font remoting.
This relands the following changes:
1) https://skia-review.googlesource.com/c/skia/+/120283
2) https://skia-review.googlesource.com/c/skia/+/125029
3) https://skia-review.googlesource.com/c/skia/+/125140

The original changes had to be reverted due to a memory leak in
SkBaseDevice from SkTextBlobCacheDiffCanvas. This has been addressed by
https://skia-review.googlesource.com/c/skia/+/125160

TBR=herb@google.com

Bug: skia:7515, 831354
Change-Id: I73f4fcb1c397f31bf01553ff48c71ed2d6dd0770
Reviewed-on: https://skia-review.googlesource.com/125326
Commit-Queue: Khusal Sagar <khushalsagar@chromium.org>
Reviewed-by: Khusal Sagar <khushalsagar@chromium.org>
2018-05-02 18:39:31 +00:00
Herb Derby
fcac00f2f1 Reland "Remove devKerning"
This is a reland of c86c5c0144

Original change's description:
> Remove devKerning
> 
> Dev kerning is not supported by any scalers. This is
> mostly removed. The remaining fields fRsbDelta and
> fLsbDelta are kept to keep Android compiling.
> 
> Change-Id: If1a9ee9bb599d4e1bdf4b3751ac0c65246350809
> Reviewed-on: https://skia-review.googlesource.com/124921
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Commit-Queue: Herb Derby <herb@google.com>

Change-Id: Ibf5fac5f1442c7e62392d5146ad460da27b10d5c
Reviewed-on: https://skia-review.googlesource.com/125300
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2018-05-02 15:15:08 +00:00
Herb Derby
efe39bcfb8 Take sk_sp<SkDevice> instead of SkDevice*
Change-Id: I0b296bf5b80adc19758a3dc99160be9d2ed05680
Reviewed-on: https://skia-review.googlesource.com/125160
Commit-Queue: Herb Derby <herb@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Auto-Submit: Herb Derby <herb@google.com>
2018-05-02 14:46:17 +00:00
Mike Klein
8a232023e1 Revert "fonts: Set up remote glyph caching to push fonts."
This reverts commit 101d56359a.

Reason for revert: 5 of 5

Original change's description:
> fonts: Set up remote glyph caching to push fonts.
> 
> Currently the SkStrikeClient is designed to pull fonts from the server
> on demand, and to pre-fetch a batched request by analyzing the ops using
> a SkTextBlobCacheDiffCanvas. This change modifies the design to support
> a push based model, where the server pushes fonts required by the client
> and sets up the requisite SkGlyphCaches on the client prior to
> rasterizing the ops.
> 
> This model still relies on the SkTextBlobCacheDiffCanvas for analyzing
> the glyphs required for rasterizing an op. The glyph caches required for
> raster are locked and missing glyphs to be sent to the client are tracked
> by the SkStrikeServer. The embedder can serialize this font data at any
> point, but must ensure that this data is deserialized by the
> SkStrikeClient at the remote end, before rasterizing any ops analyzed
> prior to serialization. Any refs on the caches are released once the
> font data is serialized by the server.
> 
> The locking of glyph caches relies on the embedder providing discardable
> handles. These handles can be created on the server and serialized to be
> sent to the client, and map to an instance of SkGlyphCache. This allows
> the server to control the lifetime of the caches on the client.
> 
> Bug: skia:7515
> Change-Id: Id39f346b47b60899778404bbd0429ee811d0e53b
> Reviewed-on: https://skia-review.googlesource.com/120283
> Commit-Queue: Khusal Sagar <khushalsagar@chromium.org>
> Reviewed-by: Herb Derby <herb@google.com>

TBR=mtklein@google.com,herb@google.com,khushalsagar@chromium.org

Change-Id: If72caf968ddcbf70b8b9d71782a2339a118ed202
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7515
Reviewed-on: https://skia-review.googlesource.com/125264
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-05-02 13:55:08 +00:00
Mike Klein
c76e26a6bb Revert "Remove devKerning"
This reverts commit c86c5c0144.

Reason for revert: 4 of 5

Original change's description:
> Remove devKerning
> 
> Dev kerning is not supported by any scalers. This is
> mostly removed. The remaining fields fRsbDelta and
> fLsbDelta are kept to keep Android compiling.
> 
> Change-Id: If1a9ee9bb599d4e1bdf4b3751ac0c65246350809
> Reviewed-on: https://skia-review.googlesource.com/124921
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Commit-Queue: Herb Derby <herb@google.com>

TBR=bungeman@google.com,herb@google.com,reed@google.com

Change-Id: If865f702868192a1b72cd811baa996dd1282bbce
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/125263
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-05-02 13:54:54 +00:00
Mike Klein
192b18a261 Revert "fonts: Bandaid fix for desc mismatch in SkRemoteGlyphCache."
This reverts commit ef4142a9bc.

Reason for revert: 2 of 5

Original change's description:
> fonts: Bandaid fix for desc mismatch in SkRemoteGlyphCache.
> 
> Since the typeface proxies on the client don't perform the same
> filtering done on the server during SkDescriptor generation, it causes
> the desc mismatches during raster. Disable this filtering on the server
> until this is resolved.
> 
> Bug: 831354
> Change-Id: I5683372fb497a4874dede5aec9c734cd1392872c
> Reviewed-on: https://skia-review.googlesource.com/125140
> Commit-Queue: Khusal Sagar <khushalsagar@chromium.org>
> Reviewed-by: Herb Derby <herb@google.com>

TBR=herb@google.com,khushalsagar@chromium.org

Change-Id: I8e732f57aa49323c186e3c4ea6120ff1caf8e25b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 831354
Reviewed-on: https://skia-review.googlesource.com/125261
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-05-02 13:53:18 +00:00
Khushal
ef4142a9bc fonts: Bandaid fix for desc mismatch in SkRemoteGlyphCache.
Since the typeface proxies on the client don't perform the same
filtering done on the server during SkDescriptor generation, it causes
the desc mismatches during raster. Disable this filtering on the server
until this is resolved.

Bug: 831354
Change-Id: I5683372fb497a4874dede5aec9c734cd1392872c
Reviewed-on: https://skia-review.googlesource.com/125140
Commit-Queue: Khusal Sagar <khushalsagar@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
2018-05-01 22:55:37 +00:00
Herb Derby
c86c5c0144 Remove devKerning
Dev kerning is not supported by any scalers. This is
mostly removed. The remaining fields fRsbDelta and
fLsbDelta are kept to keep Android compiling.

Change-Id: If1a9ee9bb599d4e1bdf4b3751ac0c65246350809
Reviewed-on: https://skia-review.googlesource.com/124921
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2018-05-01 21:12:15 +00:00
Brian Salomon
3fc6a185ca Fix index overflow check for rewriting fans as triangles.
Not only could the old test cause int overflow, it was just wrong.

Bug: skia:8085
Change-Id: Id6b81f4aa1b115f0dbfd2266aee8fab5d5d30aee
Reviewed-on: https://skia-review.googlesource.com/124779
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-05-01 19:58:45 +00:00
Khushal
101d56359a fonts: Set up remote glyph caching to push fonts.
Currently the SkStrikeClient is designed to pull fonts from the server
on demand, and to pre-fetch a batched request by analyzing the ops using
a SkTextBlobCacheDiffCanvas. This change modifies the design to support
a push based model, where the server pushes fonts required by the client
and sets up the requisite SkGlyphCaches on the client prior to
rasterizing the ops.

This model still relies on the SkTextBlobCacheDiffCanvas for analyzing
the glyphs required for rasterizing an op. The glyph caches required for
raster are locked and missing glyphs to be sent to the client are tracked
by the SkStrikeServer. The embedder can serialize this font data at any
point, but must ensure that this data is deserialized by the
SkStrikeClient at the remote end, before rasterizing any ops analyzed
prior to serialization. Any refs on the caches are released once the
font data is serialized by the server.

The locking of glyph caches relies on the embedder providing discardable
handles. These handles can be created on the server and serialized to be
sent to the client, and map to an instance of SkGlyphCache. This allows
the server to control the lifetime of the caches on the client.

Bug: skia:7515
Change-Id: Id39f346b47b60899778404bbd0429ee811d0e53b
Reviewed-on: https://skia-review.googlesource.com/120283
Commit-Queue: Khusal Sagar <khushalsagar@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
2018-05-01 18:15:15 +00:00
Brian Osman
0ab0f1c120 Convert skcms to only export functions (not data)
This simplifies shared library builds on Windows (no need to
conditionally change declspec to dllimport).

Once this lands, we can make the same change (plus update
internal references):
    https://skia-review.googlesource.com/c/skcms/+/124982

Change-Id: I0d4fa9031258f77d370e6e6e018afaf543c29d85
Reviewed-on: https://skia-review.googlesource.com/124983
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2018-05-01 17:42:35 +00:00
Brian Osman
12e4e84f73 Add test to ensure that skcms' sRGB turns into Skia's sRGB color space
Change-Id: Ib69926218895f9c3df8d02906188f5e54d134fad
Reviewed-on: https://skia-review.googlesource.com/124265
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2018-04-30 13:24:00 +00:00
Brian Salomon
cccafe8cfd Rewrite SkVertices specified with triangle fans as indexed triangles
Change-Id: Ifaacc426bc657b324f6a885a8ef70b347b048226
Reviewed-on: https://skia-review.googlesource.com/124349
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
2018-04-28 20:32:15 +00:00
Brian Salomon
e4949406eb Revert "Reland "Revert "Add arcs as a specialized geometry to GrShape."""
This reverts commit 580aee2fa4.

Bug: skia:7794
Change-Id: I9c2b923859c826dff58c22c529dc4e2ab4d0f186
Reviewed-on: https://skia-review.googlesource.com/124042
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-04-26 19:50:23 +00:00
Brian Salomon
580aee2fa4 Reland "Revert "Add arcs as a specialized geometry to GrShape.""
This reverts commit 8a98bc9674.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Revert "Revert "Add arcs as a specialized geometry to GrShape.""
> 
> This reverts commit af88ec3712.
> 
> Bug: skia:7794
> Change-Id: I2d0e1d7b4e025481241d823b09f5de5d0f1a13eb
> Reviewed-on: https://skia-review.googlesource.com/123627
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

TBR=bsalomon@google.com,robertphillips@google.com

Change-Id: Ib09a533600028b76a69b455c952f3dd12b39bdba
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7794
Reviewed-on: https://skia-review.googlesource.com/123780
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-04-25 21:20:30 +00:00
Brian Salomon
43227522e4 Make SkString::appendf safe for long strings.
Bug: skia:7841
Change-Id: I5bc77f5230b63da74e42d756ab4a1fefcfab9926
Reviewed-on: https://skia-review.googlesource.com/123634
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-04-25 20:58:09 +00:00
Chris Dalton
218c29453f Remove the MSAA path renderer
Bug: skia:
Change-Id: Ib18bede613c8d27fd6326f655dc2d638e35870ff
Reviewed-on: https://skia-review.googlesource.com/123726
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2018-04-25 19:59:59 +00:00
Brian Salomon
8a98bc9674 Revert "Revert "Add arcs as a specialized geometry to GrShape.""
This reverts commit af88ec3712.

Bug: skia:7794
Change-Id: I2d0e1d7b4e025481241d823b09f5de5d0f1a13eb
Reviewed-on: https://skia-review.googlesource.com/123627
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-04-25 18:54:07 +00:00
Mike Reed
910ca0fd01 Experiment to track coverage in a layer
Bug: skia:
Change-Id: I5ed334f63e64991944394dc8103092a2c6280546
Reviewed-on: https://skia-review.googlesource.com/122000
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-04-25 17:34:27 +00:00
Ben Wagner
ff134f20ae Compile with latest clang 7.
Changes to warnings in clang introduced by https://reviews.llvm.org/D43322
and https://reviews.llvm.org/D44883 cause warning as error failures when
building Skia. In particular this addresses return-std-move-in-c++11 and
self-assign-overloaded.

Change-Id: I680318098d8af1b64fba464585c7cdfcfcf39d66
Reviewed-on: https://skia-review.googlesource.com/123582
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2018-04-24 20:58:06 +00:00
Cary Clark
6cdb7d3a4c prepare to remove obsolete macros
SkColorSetARGBMacro and SkColorSetARGBInline
are macros which will be deleted. Replace them
with a standard equivalent.

R=scroggo@google.com
Bug: skia:6898
Change-Id: I16e010776e991c19a375d0686ecd1b1cc4c59a9b
Reviewed-on: https://skia-review.googlesource.com/123501
Auto-Submit: Cary Clark <caryclark@skia.org>
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
2018-04-24 19:19:01 +00:00
Mike Klein
55d330c32d Reland "call skcms_OptimizeForSpeed()"
This is a reland of 3b8feb331a

Original change's description:
> call skcms_OptimizeForSpeed()
> 
> I've guarded src and dst separately, so that we can land,
> rebaseline just the src change, and then later (when it
> does something), rebaseline optimizing dst separately.
> 
> Small threshold tweak to keep a unit test passing.
> 
> Change-Id: I57cc43c54b6065f58fa8f9448ea1d73fc42505f0
> Reviewed-on: https://skia-review.googlesource.com/123181
> Commit-Queue: Mike Klein <mtklein@chromium.org>
> Reviewed-by: Brian Osman <brianosman@google.com>

Change-Id: Ia29b4c941e121486a627ac7221947f4a452211ad
Reviewed-on: https://skia-review.googlesource.com/123480
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-04-24 18:55:36 +00:00
Mike Klein
af88ec3712 Revert "Add arcs as a specialized geometry to GrShape."
This reverts commit 255bcf57ff.

Reason for revert: layout and scuba image diffs

Original change's description:
> Add arcs as a specialized geometry to GrShape.
> 
> BUG: skia:7794
> 
> Change-Id: I484693711f48e55631732a0f4ee97e2848dec89d
> Reviewed-on: https://skia-review.googlesource.com/122900
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

TBR=bsalomon@google.com,robertphillips@google.com

Change-Id: I9293b8fbb535d940bca5fc30a95908416b9eb7a7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/123362
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-04-24 12:18:47 +00:00
Mike Klein
1b4ad0d1eb Revert "call skcms_OptimizeForSpeed()"
This reverts commit 3b8feb331a.

Reason for revert: darks too bright

Original change's description:
> call skcms_OptimizeForSpeed()
> 
> I've guarded src and dst separately, so that we can land,
> rebaseline just the src change, and then later (when it
> does something), rebaseline optimizing dst separately.
> 
> Small threshold tweak to keep a unit test passing.
> 
> Change-Id: I57cc43c54b6065f58fa8f9448ea1d73fc42505f0
> Reviewed-on: https://skia-review.googlesource.com/123181
> Commit-Queue: Mike Klein <mtklein@chromium.org>
> Reviewed-by: Brian Osman <brianosman@google.com>

TBR=mtklein@chromium.org,brianosman@google.com

Change-Id: I23e59d4dc711e8b112e70f31a5c9abad67551bcd
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/123361
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-04-24 00:11:06 +00:00
Brian Salomon
255bcf57ff Add arcs as a specialized geometry to GrShape.
BUG: skia:7794

Change-Id: I484693711f48e55631732a0f4ee97e2848dec89d
Reviewed-on: https://skia-review.googlesource.com/122900
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-04-23 23:27:53 +00:00
Mike Klein
3b8feb331a call skcms_OptimizeForSpeed()
I've guarded src and dst separately, so that we can land,
rebaseline just the src change, and then later (when it
does something), rebaseline optimizing dst separately.

Small threshold tweak to keep a unit test passing.

Change-Id: I57cc43c54b6065f58fa8f9448ea1d73fc42505f0
Reviewed-on: https://skia-review.googlesource.com/123181
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-04-23 23:27:52 +00:00
Robert Phillips
c90b4dbec5 Reland "Prevent masked solid-color draws from being turned into clears"
This reverts commit f92bb3785f.

Reason for revert: The new unit test has been suppressed on ANGLE

Original change's description:
> Revert "Prevent masked solid-color draws from being turned into clears"
> 
> This reverts commit e9f2bbe082.
> 
> Reason for revert: ANGLE
> 
> Original change's description:
> > Prevent masked solid-color draws from being turned into clears
> > 
> > GrRenderTargetContext::drawRect was eliding a BlurMask filtered circle.
> > 
> > Bug: skia:7765
> > Change-Id: Id98c059f7d786ee5c9bca839c8e099997ff2aedb
> > Reviewed-on: https://skia-review.googlesource.com/122793
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> 
> TBR=bsalomon@google.com,robertphillips@google.com
> 
> Change-Id: I1b7752eab0fcf55ab6248eed587fd85d438efd78
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:7765
> Reviewed-on: https://skia-review.googlesource.com/122960
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

TBR=bsalomon@google.com,robertphillips@google.com

Change-Id: If432c24548ef0f6df4fd6a06aa3b1fb38ba793b8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7765
Reviewed-on: https://skia-review.googlesource.com/123000
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-04-23 15:12:11 +00:00
Robert Phillips
f92bb3785f Revert "Prevent masked solid-color draws from being turned into clears"
This reverts commit e9f2bbe082.

Reason for revert: ANGLE

Original change's description:
> Prevent masked solid-color draws from being turned into clears
> 
> GrRenderTargetContext::drawRect was eliding a BlurMask filtered circle.
> 
> Bug: skia:7765
> Change-Id: Id98c059f7d786ee5c9bca839c8e099997ff2aedb
> Reviewed-on: https://skia-review.googlesource.com/122793
> Reviewed-by: Brian Salomon <bsalomon@google.com>

TBR=bsalomon@google.com,robertphillips@google.com

Change-Id: I1b7752eab0fcf55ab6248eed587fd85d438efd78
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7765
Reviewed-on: https://skia-review.googlesource.com/122960
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-04-23 13:39:30 +00:00
Robert Phillips
e9f2bbe082 Prevent masked solid-color draws from being turned into clears
GrRenderTargetContext::drawRect was eliding a BlurMask filtered circle.

Bug: skia:7765
Change-Id: Id98c059f7d786ee5c9bca839c8e099997ff2aedb
Reviewed-on: https://skia-review.googlesource.com/122793
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-04-23 12:54:28 +00:00
Robert Phillips
3d0e8507fa Prevent matrix stack from being corrupted if a rotated image filter is clipped out
Bug: skia:7765
Change-Id: Id76b63cebc25dcdff02d4ba3f6d6bba6f2b6b842
Reviewed-on: https://skia-review.googlesource.com/122782
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-04-20 15:13:55 +00:00
Greg Daniel
57bf4a3dbf When creating testing backendTexture take colorspace into account.
Bug: skia:
Change-Id: Ifa8dbad3eca81790648476f9a6d3fa5a088fede9
Reviewed-on: https://skia-review.googlesource.com/122341
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-04-19 15:02:34 +00:00
Cary Clark
dbc59ba23b path is rect track corners
This was triggered by an exploit that started the first
edge well outside the final rectangle, causing the captured
to exceed the correct result.

Ivan observes that we really only want the first and third
corners to compute the bounds, so remove the tracking code
that looks for a valid range of points, and record the
corners instead.

R=robertphillips@google.com
Bug: 824145,skia:7792
Change-Id: If228573d0f05c7158dba8142c144d13834e691ec
Reviewed-on: https://skia-review.googlesource.com/122081
Commit-Queue: Cary Clark <caryclark@skia.org>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Auto-Submit: Cary Clark <caryclark@skia.org>
2018-04-19 12:11:34 +00:00
Florin Malita
c274f8f942 Prevent unnecessary/unbounded growth of SkTDynamicHash capacity
SkTDynamicHash doesn't immediately recycle slots for removed entries,
but instead just marks them as deleted.

The only way to reclaim deleted slots currently is when an exponential
grow/resize is triggered.

A consequence of this is that the capacity/allocated storage can grow
indefinitely when the hash is long-lived and churning -- even if the
number of active entries is small/stable.

To prevent this, I propose we only grow the capacity when the number of
active slots constitutes a significant portion.  Otherwise (when most
slots are deleted), we trigger a "purge" (resize to the same capacity)
to clear the tombstones.

Bug: chromium:832482
Change-Id: Iefdcd7439f7d62ac021e176b71007d207c8bc876
Reviewed-on: https://skia-review.googlesource.com/122082
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-04-18 21:46:33 +00:00
Chris Dalton
9f2dab0fdd ccpr: Implement conics
TBR=egdaniel@google.com

Bug: skia:
Change-Id: Idf7811dc285961db52db41c9ff145afda40c274d
Reviewed-on: https://skia-review.googlesource.com/122127
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2018-04-18 20:43:54 +00:00
Chris Dalton
91ab155884 Always call endFlush on opLists that might survive a flush
We were missing a few that got unreffed due to failed proxy
instantiation.

Bug: skia:7655
Bug: skia:7111
Change-Id: I95847a16890f2993a1433d4d9fdaa8a4a6c2f0b6
Reviewed-on: https://skia-review.googlesource.com/122121
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2018-04-18 20:00:53 +00:00
Florin Malita
15a64e71f6 Convert A8 D32 mask blitters to Sk4px
Improves the newly added bench by ~25% (hsw):

-- before --

    micros   	bench
   2298.34  	shadermaskfilter_picture_80	8888
   2339.60  	shadermaskfilter_picture_ff	8888
   2287.11  	shadermaskfilter_bitmap_80	8888
   2223.14  	shadermaskfilter_bitmap_ff	8888

-- after --

   1693.36  	shadermaskfilter_picture_80	8888
   1637.45  	shadermaskfilter_picture_ff	8888
   1691.65  	shadermaskfilter_bitmap_80	8888
   1637.70  	shadermaskfilter_bitmap_ff	8888

But: skia:7810
Change-Id: I7274b10f517551ee2c0646842f72e0372d55e509
Reviewed-on: https://skia-review.googlesource.com/121642
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-04-18 19:52:53 +00:00
Cary Clark
b120e9291a fix path is rect flaw exposed by gold
One of the path is rect bug fixes changed
the behavior of zero-length strokes which
showed up as a change in Gold.

The bug is if a rect is defined by a
series of colinear movetos, the bounds
did not work out if the rect started
and stopped in the middle of a side.

R=robertphillips@google.com
Bug: 824145,skia:7792
Change-Id: I226545efeda03dedd928eebc120d2508b428fef0
Reviewed-on: https://skia-review.googlesource.com/122002
Auto-Submit: Cary Clark <caryclark@skia.org>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Cary Clark <caryclark@skia.org>
2018-04-18 17:46:03 +00:00