Commit Graph

8813 Commits

Author SHA1 Message Date
Mike Reed
73329c8df9 remove alignenum flag -- rely on clients to add it as needed
Bug: skia:
Change-Id: Ic4ee895c3d04c7d22aee026859f84c65e1252505
Reviewed-on: https://skia-review.googlesource.com/c/166563
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2018-10-31 14:21:51 +00:00
Jim Van Verth
9bf8120cab More YUV cleanup
* Remove more uses of colortype
* Add back SkImage_GpuYUVA::MakeFromYUVATextures

Bug: skia:7903
Change-Id: I3ee119d190db39c128516dbb78db34fe29ba3cce
Reviewed-on: https://skia-review.googlesource.com/c/165943
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2018-10-30 21:11:54 +00:00
Brian Salomon
1986f88dd5 Remove unused GrOpList::numOps()
This function was misleading because GrRenderTargetOpList::forwardCombine
can leave holes in the array which were still counted.

It would be harder to track this in op chaining redux.

Change-Id: Ib9619839012cb7dd2d0e4ccac31a231787f90f2d
Reviewed-on: https://skia-review.googlesource.com/c/166442
Commit-Queue: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2018-10-30 18:26:54 +00:00
Brian Osman
78252fedaa Switch GrColor4h to use float storage
This is a test CL to measure perf impact on the bots

Bug: skia:
Change-Id: I8aae0ac1373921d4d1b5f92e1f6b2318e66f0032
Reviewed-on: https://skia-review.googlesource.com/c/166283
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-10-30 17:27:27 +00:00
Mike Reed
3a42ec0ee7 hide the SkPaint::Align enum entirely
Bug: skia:2664
Change-Id: I080b015dbcb3a3cd73bb6847f3243a996d5f7b7d
Reviewed-on: https://skia-review.googlesource.com/c/166282
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2018-10-30 17:26:47 +00:00
Mike Klein
408ef21c79 Revert "replace SkNVRefCnt with SkRefCnt"
This reverts commit 0fb1ee98cf.

Reason for revert: looks like this increased size by ~8K.

Original change's description:
> replace SkNVRefCnt with SkRefCnt
> 
> SkNVRefCnt trades a small amount of code size (vtable) and runtime
> (vptr) memory usage for a larger amount of code size (templating).  It
> was written back in a time when all we were really thinking about was
> runtime memory usage, so I'm curious to see where performance, code
> size, and memory usage all move if it's removed.
> 
> Looking at the types I've changed here, my guess is that performance and
> memory usage will be basically unchanged, and that code size will drop a
> bit.  Nothing else it's nicer to have only one ref-counting base class.
> 
> Change-Id: I7d56a2b9e2b9fb000ff97792159ea1ff4f5e6f13
> Reviewed-on: https://skia-review.googlesource.com/c/166203
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Mike Klein <mtklein@google.com>

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

Change-Id: Ibcfcc4b523c466a535bea5ffa30d0fe2574c5bd7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/166360
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-10-30 15:23:06 +00:00
Jim Van Verth
e24b587a00 Replace use of SkYUVSizeInfo with SkYUVASizeInfo
Bug: skia:7903
Change-Id: If5acd50711ed8bd4a49efcb93db66fd3d14c8992
Reviewed-on: https://skia-review.googlesource.com/c/164681
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2018-10-30 15:00:34 +00:00
Mike Klein
0fb1ee98cf replace SkNVRefCnt with SkRefCnt
SkNVRefCnt trades a small amount of code size (vtable) and runtime
(vptr) memory usage for a larger amount of code size (templating).  It
was written back in a time when all we were really thinking about was
runtime memory usage, so I'm curious to see where performance, code
size, and memory usage all move if it's removed.

Looking at the types I've changed here, my guess is that performance and
memory usage will be basically unchanged, and that code size will drop a
bit.  Nothing else it's nicer to have only one ref-counting base class.

Change-Id: I7d56a2b9e2b9fb000ff97792159ea1ff4f5e6f13
Reviewed-on: https://skia-review.googlesource.com/c/166203
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-10-30 13:26:12 +00:00
Mike Reed
97047b18eb declare SkFont SK_API
Bug: skia:
Change-Id: I83c5d6aabcb56338b76a5a4e6bba8685e90a83b4
Reviewed-on: https://skia-review.googlesource.com/c/166202
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-10-30 12:24:27 +00:00
Cary Clark
14768f64fb update docs for new/changed textblob apis
Docs-Preview: https://skia.org/?cl=165944
Bug: skia:2664
Change-Id: Ifcd112cae535501d709bc124848e2425d2ec6e5c
Reviewed-on: https://skia-review.googlesource.com/c/165944
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
2018-10-30 01:01:05 +00:00
Brian Osman
1be2b7c64d Keep paint color range/precision into ops and GPs (using GrColor4h)
We still degrade to bytes when creating vertices (tagged TODO4F).

Note: Guarded for Chrome (by making GrColor4h a wrapper around
GrColor).

Bug: skia:
Change-Id: Id8a1d9eec7978d52b059cd9952666bc1217ee073
Reviewed-on: https://skia-review.googlesource.com/c/165527
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-10-29 23:40:30 +00:00
Brian Osman
4408b1cf87 Remove another GrColor helper function
GrPremulColor is only use in test code, and is redundant

Bug: skia:
Change-Id: I4a22941d28cbec3eb203bca393cfeccffe04e053
Reviewed-on: https://skia-review.googlesource.com/c/165524
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2018-10-29 19:28:09 +00:00
Cary Clark
0ac0eddd88 sync bookmaker docs with canvas
removed SrcRectConstraint from docs to match SkCanvas.h
also removed constraint description paragraph from SkCanvas.h

TBR=bsalomon@google.com

Docs-Preview: https://skia.org/?cl=165821
Bug: skia:5679
Change-Id: I34c51f672477076f182946ce71e2d06f049e7f29
Reviewed-on: https://skia-review.googlesource.com/c/165821
Commit-Queue: Cary Clark <caryclark@skia.org>
Auto-Submit: Cary Clark <caryclark@skia.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Cary Clark <caryclark@skia.org>
2018-10-29 15:58:06 +00:00
Mike Reed
3185f90deb expose SkFont as public way to use TextBlobBuilder
Step 1 of many to (eventually) use SkFont to make blobs, and not paint.

Bug: skia:2664
Change-Id: Iaa0682f9d947e18afa96b448519f2f60ffe104cc
Reviewed-on: https://skia-review.googlesource.com/c/165521
Auto-Submit: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-10-29 15:16:58 +00:00
Brian Salomon
f08002cb9e Remove SrcRectConstraint from drawImageRect overloads with no src rect
Bug: skia:5679
Change-Id: I8658099707aab34b047d697b011e741da9019091
Reviewed-on: https://skia-review.googlesource.com/c/165525
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-10-29 15:11:52 +00:00
Brian Osman
76aed1ebe1 Add GrColor4h (half-float), for use in Ops and (eventually) vertices
To keep things sane, move SkNx and SkHalf to include/private

Bug: skia:
Change-Id: Iaee8c3f92a2720bf97583c3f326486d4ce462e8b
Reviewed-on: https://skia-review.googlesource.com/c/165344
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-10-29 15:11:51 +00:00
Mike Reed
7d7c68339d add helpers to SkFont (and SkTypeface)
Bug: skia:2664
Change-Id: I215c951ae2d46fa7ee0ccbff490375fc60694100
Reviewed-on: https://skia-review.googlesource.com/c/165780
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2018-10-29 15:06:45 +00:00
Mike Reed
6e24cd3e28 Reland "hide setTextAlign"
This reverts commit f10ea21088.

Reason for revert: flag added for google3

Original change's description:
> Revert "hide setTextAlign"
> 
> This reverts commit 43c718302e.
> 
> Reason for revert: Google 3 roll.
> 
> Original change's description:
> > hide setTextAlign
> > 
> > Bug: skia:8493
> > Change-Id: Ib3347f600300e90d5bcc47910fd75244039a016c
> > Reviewed-on: https://skia-review.googlesource.com/c/164697
> > Commit-Queue: Mike Reed <reed@google.com>
> > Reviewed-by: Ben Wagner <bungeman@google.com>
> 
> TBR=djsollen@google.com,bungeman@google.com,herb@google.com,fmalita@chromium.org,reed@google.com
> 
> Change-Id: I877bf993e71a6e81f1322c799c533bfea6c5813f
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:8493
> Reviewed-on: https://skia-review.googlesource.com/c/165660
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

TBR=djsollen@google.com,bungeman@google.com,herb@google.com,brianosman@google.com,fmalita@chromium.org,reed@google.com

Change-Id: I0f224cd560cea12ddac3cd48d244f85ccd943086
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:8493
Reviewed-on: https://skia-review.googlesource.com/c/165681
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-10-27 14:39:05 +00:00
Brian Osman
f10ea21088 Revert "hide setTextAlign"
This reverts commit 43c718302e.

Reason for revert: Google 3 roll.

Original change's description:
> hide setTextAlign
> 
> Bug: skia:8493
> Change-Id: Ib3347f600300e90d5bcc47910fd75244039a016c
> Reviewed-on: https://skia-review.googlesource.com/c/164697
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Ben Wagner <bungeman@google.com>

TBR=djsollen@google.com,bungeman@google.com,herb@google.com,fmalita@chromium.org,reed@google.com

Change-Id: I877bf993e71a6e81f1322c799c533bfea6c5813f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:8493
Reviewed-on: https://skia-review.googlesource.com/c/165660
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-10-27 12:59:53 +00:00
Mike Reed
43c718302e hide setTextAlign
Bug: skia:8493
Change-Id: Ib3347f600300e90d5bcc47910fd75244039a016c
Reviewed-on: https://skia-review.googlesource.com/c/164697
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2018-10-27 00:37:29 +00:00
Brian Osman
3b79aa3a5a On second thought, remove GrColor4s
We're going to use half-floats, which are far more future-proof.

Bug: skia:
Change-Id: I6e098017381256d6e750ac546c353072802282cb
Reviewed-on: https://skia-review.googlesource.com/c/165522
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-10-26 19:29:50 +00:00
Chris Dalton
a944142412 ccpr: Unregister path listeners when their cache entries are evicted
Bug: skia:8452
Change-Id: Ibd49d8f0ed15c568156c09db358eba0415df48f5
Reviewed-on: https://skia-review.googlesource.com/c/165120
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2018-10-26 16:07:55 +00:00
Mike Reed
331ccfd8e4 add textutils
These are meant to enable several things (eventually)

- fission Align off of paint
- fission TextEncoding off of paint
- fission SkFont of of paint

The first one is explicitly enabled here. The others will (I plan) follow later.

The final state of the world (the goal)
- paint has no font-ish parameters (no typeface or size)
- font has no paint-ish parameters (no aa or lcd)
- neither has alignment or encoding

Bug: skia:8493, skia:8501
Change-Id: I5fcb945b6bcab30ef5e7019dfccb682661f56230
Reviewed-on: https://skia-review.googlesource.com/c/165061
Auto-Submit: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-10-25 17:50:20 +00:00
Brian Osman
4f598e8c82 GrColor4s, a fixed-point signed short type for wide color vertices
Bug: skia:
Change-Id: I91b9816aae74726762c123d9f3454c5961382b7b
Reviewed-on: https://skia-review.googlesource.com/c/164680
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-10-24 18:21:16 +00:00
Mike Reed
c157c0a5a6 more setters for SkFont
Bug: skia:2664
Change-Id: Id5a09f8fd6bba99f77b508aed58147b34c02dbb2
Reviewed-on: https://skia-review.googlesource.com/c/164694
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-10-24 18:14:56 +00:00
Jim Van Verth
f9f073553c Reland "Some more clean-up of YUVA code"
This is a reland of c96740729a

Original change's description:
> Some more clean-up of YUVA code
> 
> * Restore pre-colortype interface
> * Remove other colortype references
> 
> Bug: skia:7903
> Change-Id: I0db6d61e78d719ff941ac195bcbed4416f7d3138
> Reviewed-on: https://skia-review.googlesource.com/c/164610
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

Bug: skia:7903
Change-Id: Iae89ccfa370433663bddf74c14cd1a0e5e6b6d4b
Reviewed-on: https://skia-review.googlesource.com/c/164688
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2018-10-24 15:19:48 +00:00
Mike Reed
472639d9f1 add alignment and lcd to SkFont (for now)
... both of these should be removed eventually. See related bugs to 2664

Bug: skia:2664
Change-Id: I49cd78380d84e5383a2a2742fa4dda98cf3d0194
Reviewed-on: https://skia-review.googlesource.com/c/164689
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2018-10-24 15:01:46 +00:00
Brian Salomon
dc82994e3a Revert "Reland "Reland "Revert "Use OpenGL sampler objects when available.""""
This reverts commit 327955b1ba.

Bug: skia:8471
Change-Id: I56eb9509f0e2d5c4aa9e2a110a73a09723f77c4a
Reviewed-on: https://skia-review.googlesource.com/c/164617
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-10-24 12:43:42 +00:00
Mike Klein
70bd0b72f3 Revert "Some more clean-up of YUVA code"
This reverts commit c96740729a.

Reason for revert: looks like this broke a bunch of layout tests on the Chrome roll.

Original change's description:
> Some more clean-up of YUVA code
> 
> * Restore pre-colortype interface
> * Remove other colortype references
> 
> Bug: skia:7903
> Change-Id: I0db6d61e78d719ff941ac195bcbed4416f7d3138
> Reviewed-on: https://skia-review.googlesource.com/c/164610
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

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

Change-Id: Ic04955ad526774080dad79852a974b1b3743dfe0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7903
Reviewed-on: https://skia-review.googlesource.com/c/164683
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-10-24 06:52:38 +00:00
Jim Van Verth
c96740729a Some more clean-up of YUVA code
* Restore pre-colortype interface
* Remove other colortype references

Bug: skia:7903
Change-Id: I0db6d61e78d719ff941ac195bcbed4416f7d3138
Reviewed-on: https://skia-review.googlesource.com/c/164610
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-10-23 21:58:21 +00:00
Mike Reed
168801407b remove vert methods (no callers)
Bug: skia:
Change-Id: I24026c24608aecd9877bd3057f972280a6787230
Reviewed-on: https://skia-review.googlesource.com/c/164615
Auto-Submit: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-10-23 20:21:09 +00:00
Mike Reed
c88cc779ef remove (unused) vertical-text
Bug: skia:8487
Change-Id: Ia6715346a0214b0db2fc67294e45b5e04c1c24d8
Reviewed-on: https://skia-review.googlesource.com/c/163889
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2018-10-23 16:33:02 +00:00
Mike Reed
fe4fc14854 Change SkFont to match needs of textblob
Tentative roadmap:
- land this
- extend TextBlobBuilder to take SkFont for its runs (eventually removing paint option)
- change SkTextBlob to store SkFont instead of SkRunFont (not critical, but makes sense)

After the above, (or during) also work towards:
- removing callers of SkPaint set... (textsize, textscalex, typeface, etc.)
- eventually physically remove those setters/getters/fields
- rev as desired the SkFont API to clean up flags, hinting, etc.

Bug: skia:2664
Change-Id: I0e323c58aef055e26d697911b078797453cb3626
Reviewed-on: https://skia-review.googlesource.com/c/163783
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2018-10-22 18:48:19 +00:00
Jim Van Verth
b7f0b9cd5c Remove use of colorTypes from SkYUVSizeInfo
Bug: skia:7903
Change-Id: I7301d943b679a4670511b6cf60c594baf615834a
Reviewed-on: https://skia-review.googlesource.com/c/164261
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-10-22 18:45:33 +00:00
Brian Salomon
327955b1ba Reland "Reland "Revert "Use OpenGL sampler objects when available."""
This reverts commit bfb3df4cc0.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Revert "Reland "Revert "Use OpenGL sampler objects when available."""
> 
> This reverts commit bffe4ed34b.
> 
> Reason for revert: <INSERT REASONING HERE>
> 
> Original change's description:
> > Reland "Revert "Use OpenGL sampler objects when available.""
> >
> > This reverts commit d46987bb74.
> >
> > Reason for revert: breaking asan bot in chrome roll
> >
> > Original change's description:
> > > Revert "Revert "Use OpenGL sampler objects when available.""
> > >
> > > Put setting GL min/max texture lod behind caps check.
> > >
> > > Bug: skia:8471
> > >
> > >
> > > This reverts commit 1bccae517a.
> > >
> > > Change-Id: I8b98df6578a678bbb8b283d8203621a992be4ede
> > > Reviewed-on: https://skia-review.googlesource.com/c/163782
> > > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > > Commit-Queue: Brian Salomon <bsalomon@google.com>
> >
> > TBR=bsalomon@google.com
> >
> > Change-Id: I8e3a0daea12659721d95967ef94c87f856e21948
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Bug: skia:8471
> > Reviewed-on: https://skia-review.googlesource.com/c/163887
> > Reviewed-by: Greg Daniel <egdaniel@google.com>
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> 
> TBR=egdaniel@google.com,bsalomon@google.com
> 
> Change-Id: Ia35bb7ad13527ffbd04173b517f7399e4a486ff1
> Bug: skia:8471
> Reviewed-on: https://skia-review.googlesource.com/c/163891
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>

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

Change-Id: Ie49071bef7f7c20f0b116cd3a7abfda84728de12
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:8471
Reviewed-on: https://skia-review.googlesource.com/c/164241
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-10-22 15:39:26 +00:00
Brian Salomon
bfb3df4cc0 Revert "Reland "Revert "Use OpenGL sampler objects when available."""
This reverts commit bffe4ed34b.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Reland "Revert "Use OpenGL sampler objects when available.""
>
> This reverts commit d46987bb74.
>
> Reason for revert: breaking asan bot in chrome roll
>
> Original change's description:
> > Revert "Revert "Use OpenGL sampler objects when available.""
> >
> > Put setting GL min/max texture lod behind caps check.
> >
> > Bug: skia:8471
> >
> >
> > This reverts commit 1bccae517a.
> >
> > Change-Id: I8b98df6578a678bbb8b283d8203621a992be4ede
> > Reviewed-on: https://skia-review.googlesource.com/c/163782
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Commit-Queue: Brian Salomon <bsalomon@google.com>
>
> TBR=bsalomon@google.com
>
> Change-Id: I8e3a0daea12659721d95967ef94c87f856e21948
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:8471
> Reviewed-on: https://skia-review.googlesource.com/c/163887
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

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

Change-Id: Ia35bb7ad13527ffbd04173b517f7399e4a486ff1
Bug: skia:8471
Reviewed-on: https://skia-review.googlesource.com/c/163891
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2018-10-22 14:12:21 +00:00
Mike Klein
fa5f6ce872 rename some flattenable routines
Initialize felt a little too nebulous, and I think
the verb for "define registrar entry" is "register".

Change-Id: I52f2eb5df5acd46a8b38bb9ea9bb07f4ac8f3789
Reviewed-on: https://skia-review.googlesource.com/c/163990
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-10-20 14:08:32 +00:00
Mike Klein
6ed2a38a16 move all registration into optional hooks
I don't think there's any reason to register any of these types
for deserialization unless the client is using deserialization.

Change-Id: Iea02670f3b6e99851061ac4ec784a6f372a5903b
Reviewed-on: https://skia-review.googlesource.com/c/163988
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-10-20 13:13:39 +00:00
Mike Klein
a3d4099b86 small tweaks to SkFlattenable::Register
The NameToType() function and type argument passed to Register are never
used, so remove them.

While we're at it, switch the stragglers over to use the
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY macro.  The only remaining direct
calls to Register are for legacy effect names, to be deleted in another
CL.

Change-Id: Ia304f960360a6f55b25f6e4eb2aa45533ee13476
Reviewed-on: https://skia-review.googlesource.com/c/163987
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-10-20 12:30:58 +00:00
Herb Derby
b9998cdcee Remove unused methods from SkTDArray
Change-Id: I41a78866187c5eff6a093f45bcbce311535d6798
Reviewed-on: https://skia-review.googlesource.com/c/163982
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2018-10-19 21:29:08 +00:00
Brian Osman
41ba826ad7 (Almost) no one needs to know about SkPixelRef
Bug: skia:
Change-Id: I5c0304cf75f938b20720eaffd2349036da965190
Reviewed-on: https://skia-review.googlesource.com/c/163890
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-10-19 19:31:37 +00:00
Mike Klein
4fee323522 override getTypeName() instead of using table
This should let getTypeName() and serialization work even
when deserialization factories haven't been registered.

I've made getTypeName() pure virtual like getFactory(),
and moved all the overrides into SK_FLATTENABLE_HOOKS,
cleaning up all the various ways we've done it before.

All the subclasses override getTypeName() and getFactory()
privately, so there should be no need to document them?

Change-Id: I723cb20099d250c2f2a10be266e3aacc6a061937
Reviewed-on: https://skia-review.googlesource.com/c/163543
Reviewed-by: Cary Clark <caryclark@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-10-19 18:07:04 +00:00
Greg Daniel
bffe4ed34b Reland "Revert "Use OpenGL sampler objects when available.""
This reverts commit d46987bb74.

Reason for revert: breaking asan bot in chrome roll

Original change's description:
> Revert "Revert "Use OpenGL sampler objects when available.""
> 
> Put setting GL min/max texture lod behind caps check.
> 
> Bug: skia:8471
> 
> 
> This reverts commit 1bccae517a.
> 
> Change-Id: I8b98df6578a678bbb8b283d8203621a992be4ede
> Reviewed-on: https://skia-review.googlesource.com/c/163782
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

TBR=bsalomon@google.com

Change-Id: I8e3a0daea12659721d95967ef94c87f856e21948
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:8471
Reviewed-on: https://skia-review.googlesource.com/c/163887
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-10-19 17:58:47 +00:00
Hal Canary
da7a5679ca SkTArray: behave a little more like std::vector
Change-Id: Ia29b5dbda707bfd993cc40396a7fc2127d7f1952
Reviewed-on: https://skia-review.googlesource.com/c/163785
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-10-19 16:41:51 +00:00
Greg Daniel
9ed1a2cd71 Add ability for an SkDevice to handle the drawing of an SkDrawable.
If supported, an Sk*Device can take charge of handling of an SkDrawable.
The specific use case right now will be to use this to execute Vulkan
specific SkDrawable's that need to know information about our Vulkan state
and objects at the time the SkDrawable is executed. If a device does not
support the SkDrawable we fall back to the cavans version like we did
previously.

BUG=skia:

Change-Id: I821fa600a80ff645412f296be36990ef390ae0a9
Reviewed-on: https://skia-review.googlesource.com/c/7740
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-10-19 15:21:54 +00:00
Greg Daniel
eb772c0869 Revert "ccpr: Unregister path listeners when their cache entries are evicted"
This reverts commit f30e49310f.

Reason for revert: Slow down on skps across multiple bots and configs

Original change's description:
> ccpr: Unregister path listeners when their cache entries are evicted
> 
> Bug: skia:8452
> Change-Id: I5cf63c07481db38fc37e920e04ca140bad8966e4
> Reviewed-on: https://skia-review.googlesource.com/c/163560
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>

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

Change-Id: I1f9859a02d9c78e4a83e68c6b26fd8d3badd2d8e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:8452
Reviewed-on: https://skia-review.googlesource.com/c/163787
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-10-19 15:00:18 +00:00
Brian Salomon
d46987bb74 Revert "Revert "Use OpenGL sampler objects when available.""
Put setting GL min/max texture lod behind caps check.

Bug: skia:8471


This reverts commit 1bccae517a.

Change-Id: I8b98df6578a678bbb8b283d8203621a992be4ede
Reviewed-on: https://skia-review.googlesource.com/c/163782
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-10-19 14:47:41 +00:00
Mike Klein
1bccae517a Revert "Use OpenGL sampler objects when available."
This reverts commit 0f7e55a818.

Reason for revert: Chrome roll, even alone (https://chromium-review.googlesource.com/c/chromium/src/+/1290785), maybe Android roll too?

Original change's description:
> Use OpenGL sampler objects when available.
> 
> Bug: skia:8471
> Change-Id: Ida3d08aa72772b8bbd08707048182bee5d27407c
> Reviewed-on: https://skia-review.googlesource.com/c/163123
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

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

Change-Id: Ieee6823e83b9992a7281806b5a9156cd91fb22b9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:8471
Reviewed-on: https://skia-review.googlesource.com/c/163780
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-10-19 11:38:50 +00:00
Chris Dalton
f30e49310f ccpr: Unregister path listeners when their cache entries are evicted
Bug: skia:8452
Change-Id: I5cf63c07481db38fc37e920e04ca140bad8966e4
Reviewed-on: https://skia-review.googlesource.com/c/163560
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2018-10-19 01:59:27 +00:00
Brian Salomon
0f7e55a818 Use OpenGL sampler objects when available.
Bug: skia:8471
Change-Id: Ida3d08aa72772b8bbd08707048182bee5d27407c
Reviewed-on: https://skia-review.googlesource.com/c/163123
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-10-19 01:38:56 +00:00