Commit Graph

5250 Commits

Author SHA1 Message Date
Florin Malita
d6db27cfd2 Observe SkFont::textToGlyphs() maxGlyphCount
Change-Id: Ic0f8738a2edf0592aa45333e5fab1f2b09c21fc1
Reviewed-on: https://skia-review.googlesource.com/c/167542
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Ben Wagner <bungeman@google.com>
2018-11-02 17:22:17 +00:00
Cary Clark
d029c0e837 remove color 16 implementation out of public
Make the public include/core/SkColorPriv.h a little smaller
and internal src/core/SkColorData.h a little larger.

R=brianosman@google.com
TBR=reed@google.com

Bug: skia:
Change-Id: Ic51b1c397f0c6ed5383f9c054c7b4f83b7b3c308
Reviewed-on: https://skia-review.googlesource.com/c/167721
Auto-Submit: Cary Clark <caryclark@skia.org>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Cary Clark <caryclark@skia.org>
2018-11-02 15:29:01 +00:00
Mike Klein
6a2a1f6c0f move SkICC::WriteToICC out of line
Change-Id: I03760e49437b82bc8faf76fa42ce876d618bf516
Reviewed-on: https://skia-review.googlesource.com/c/167680
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-11-02 15:17:35 +00:00
Mike Reed
67510d3a7d remove (unused and weird) zoom parameter on getFontMetrics
Bug: skia:
Change-Id: I17d1d79da7518aaa37daf22768f1b2624bd59bcf
Reviewed-on: https://skia-review.googlesource.com/c/167540
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-11-02 00:48:07 +00:00
Brian Osman
6d546b5cd1 Simplify PMColor preprocessor logic, move it all into SkColorPriv.h
This was spread across SkColorPriv.h and SkColorData.h, and was
accomodating fictional users that set SK_PMCOLOR_IS_* themselves.

Also, remove an unused define and stop grilling colors.

Bug: skia:
Change-Id: I70efd51052f32afdc3e19fd55dd38270d98b6b76
Reviewed-on: https://skia-review.googlesource.com/c/167392
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-11-01 18:14:20 +00:00
Mike Klein
ff0e8409e1 clean up some odd SkRefCnt features
SkRefCntBase is an implementation detail of SkRefCnt, so let's not
mention it in SkContext_Compute.h.  While I'm here, I notice SkNVRefCnt
would work fine too.

No one else calls internal_dispose_restore_refcnt_to_1(), so we can
inline it.  While here, I notice it's resetting the ref count to 1 even
in release builds.  I'm not sure if that is/can be optimized away, but
in any case I think we can wrap with #ifdef SK_DEBUG, if only to make it
clear that it's only there to support the assert in the destructor.

I've removed validate().  Most of the places it's called read pretty
weird, and I think suggest some sort of class-specific validation than
just checking that we're holding a ref.  SkWeakRefCnt::validate() isn't
called anywhere.

There were few users of getRefCnt() outside SkRefCnt itself, so I
removed the rest and made it private.

I've added a few this-> to self calls while at it.

Change-Id: I98be06677a6e8b8e66f44cbb17d14e38b0f39d38
Reviewed-on: https://skia-review.googlesource.com/c/167160
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2018-10-31 20:47:16 +00:00
Brian Osman
d5ea99871c Remove SkRGBA4f pinning functions
Bug: skia:
Change-Id: I48ba39465a160e73502ee38d90062d955da6e8e6
Reviewed-on: https://skia-review.googlesource.com/c/167140
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-10-31 20:32:28 +00:00
Cary Clark
82456498d8 give include comments the once over
In preparation for upcoming changes to bookmaker
which validate more include contents, revise
generated files in include/core to fix various
errors.

Fixes include:
- references in comments to other Skia interface elements
- @param names agree with function declarations
- spelling typos
- generic references (e.g. 'x' in place of 'x-axis')
- lines longer than 100 columns

The fix to SkPath::rCubicTo triggered a parallel
fix to SkPath_Reference.bmh; other wed documentation
fixes will be in an upcoming CL.

TBR=reed@google.com

Docs-Preview: https://skia.org/?cl=166680
Bug: skia:
Change-Id: If734696dc64655f1cf40b121a180210c932b1d89
Reviewed-on: https://skia-review.googlesource.com/c/166680
Commit-Queue: Cary Clark <caryclark@skia.org>
Auto-Submit: Cary Clark <caryclark@skia.org>
Reviewed-by: Cary Clark <caryclark@skia.org>
2018-10-31 15:37:37 +00:00
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
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
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
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
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
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
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
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
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
Jim Van Verth
8f11e43f8b Reland: Widen internal API to support more complex YUV formats
Bug: skia:7901
Change-Id: Ic83e9f0c2a493335671fe431ffba6f649812d406
Reviewed-on: https://skia-review.googlesource.com/c/163481
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-10-18 18:44:26 +00:00
Jim Van Verth
f99a67403a Revert "Widen internal API to support more complex YUV formats"
This reverts commit 0c583af06d.

Reason for revert: DDL is failing

Original change's description:
> Widen internal API to support more complex YUV formats
> 
> Bug: skia:7901
> Change-Id: I46fec08711b8b483cf58ccae733e4dc2a9689231
> Reviewed-on: https://skia-review.googlesource.com/c/162280
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

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

Change-Id: Ibe3dd7abbce4a3b6afe74c565198dadc61a9f439
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7901
Reviewed-on: https://skia-review.googlesource.com/c/163257
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2018-10-18 16:13:28 +00:00
Jim Van Verth
0c583af06d Widen internal API to support more complex YUV formats
Bug: skia:7901
Change-Id: I46fec08711b8b483cf58ccae733e4dc2a9689231
Reviewed-on: https://skia-review.googlesource.com/c/162280
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-10-18 15:10:39 +00:00
Mike Reed
e92aae6b36 make legacy shadercontext optional
Current savings : 96K on intel mac

Breaks -- these subclass don't have a pipeline
- emboss
- perlinnoise

For now, shadercontext is still on -- clients must opt-out with SK_DISABLE_LEGACY_SHADERCONTEXT

Bug: skia:
Change-Id: Idd14cae4013e8de92f16b0707f8b8d43bb6d11dd
Reviewed-on: https://skia-review.googlesource.com/c/162362
Auto-Submit: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-10-17 17:19:26 +00:00
Mike Reed
6a388006f5 be consistent about int for incReserve
Bug: 883666
Change-Id: I4070c958ef9ac5891ea75a8ef349e3d362c97f54
Reviewed-on: https://skia-review.googlesource.com/c/162620
Auto-Submit: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-10-16 20:39:28 +00:00
Brian Osman
cb3d087e71 Remove all remaining GrColor4f (other than gradients)
This adds SkPMColor4f conversions to/from RGBA bytes (ie GrColor).
I had previously made some free functions that did the same thing.
I'm ambivalent about which option is nicer, but wanted to have one
method, so I converted everything to use the new versions.

Bug: skia:
Change-Id: I4194c44b5bd12228075fd1932a14cf31c8d6a3c1
Reviewed-on: https://skia-review.googlesource.com/c/162560
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-10-16 19:45:53 +00:00
Brian Osman
82727ad0eb Add documentation to SkRGBA4f
Bug: skia:
Change-Id: I11109b35558630e60118653c9c72a976bc6e4650
Reviewed-on: https://skia-review.googlesource.com/c/159151
Reviewed-by: Mike Klein <mtklein@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-10-15 20:33:21 +00:00
Mike Reed
09bc78b18a remove unused isABitmap code
Waiting on CL to remove calls in Android.

Bug: skia:
Change-Id: I9672ec1602ee3953ab2baa4475f5cdf25e907163
Reviewed-on: https://skia-review.googlesource.com/c/162036
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
2018-10-15 20:09:48 +00:00
Brian Salomon
0087c83a7c Make GrTextureOp disable filtering/aa in more cases.
Previously we didn't do this at all for multiple-texture ops.

Improve the test detecting when filtering can be disabled.

Make draw_image_set GM create tiles with pixel of overlap for correct
filtering.

Add draw_image_set_rect_to_rect to exercise filtering/aa disablement
in combination with tiling.

Makes SkGpuDevice filter out inverted src rects (as is done implicitly
in SkBaseDevice by relying on drawImageRect).

Puts GrTextureOp::fFilter in bitfield.

Change-Id: Iee96cb54d665877c7f4aee422a3a7af2b249b1d6
Reviewed-on: https://skia-review.googlesource.com/c/161641
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2018-10-15 19:28:05 +00:00
Heather Miller
01815d76af Update Skia milestone to 72
No API changes
TBR=reed
NOTRY=TRUE

Bug: skia:
Change-Id: I1ffde14bc6ebf0cf3d89735f70fb9a385b35d167
Reviewed-on: https://skia-review.googlesource.com/c/161940
Commit-Queue: Heather Miller <hcm@google.com>
Reviewed-by: Heather Miller <hcm@google.com>
2018-10-13 01:46:43 +00:00
Brian Osman
a9667fbb73 Revert "Tie mip map cache purging to Images, not Bitmaps/PixelRefs"
This reverts commit 11422c63d3.

Reason for revert: Perf regression

Original change's description:
> Tie mip map cache purging to Images, not Bitmaps/PixelRefs
> 
> We were potentially using different keys for lookup vs. add, because we
> were adding with a key based on the pixelRef, which may not have the
> same uniqueID as the originating image.
> 
> Bug: skia:
> Change-Id: Ib4d3d5ead9f5a574cf6d1920080bc9c4ae66c1d0
> Reviewed-on: https://skia-review.googlesource.com/c/161625
> Reviewed-by: Mike Klein <mtklein@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

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

Change-Id: I9bdce1c6b1d9bf13cc477d2e7f20f7cc0f204b2f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/161828
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-10-12 20:18:35 +00:00
Jim Van Verth
21bd60daa3 Connect up YUVA images for testing.
* Fixes isTextureBacked() for SkImage_GpuYUVA
* Hooks in SkImage_GpuYUVA::MakePromiseYUVATexture()
* Pass down plane texture sizes to MakePromiseYUVATexture()
* Move some other methods to SkImage_GpuBase.

Bug: skia:7901
Change-Id: I33d62c16b426abba5830f7168f9f8fd54a0cb093
Reviewed-on: https://skia-review.googlesource.com/c/161149
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-10-12 19:31:08 +00:00
Brian Salomon
d7065e72da Revert "Revert "Add experimental API to draw a set of SkImages in one SkCanvas call.""
This reverts commit 8d5b41b553.

Bug: skia:8444
Change-Id: I29b52c6fe9475c6113ec954b7918cf591111846c
Reviewed-on: https://skia-review.googlesource.com/c/161627
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-10-12 16:09:21 +00:00
Brian Osman
11422c63d3 Tie mip map cache purging to Images, not Bitmaps/PixelRefs
We were potentially using different keys for lookup vs. add, because we
were adding with a key based on the pixelRef, which may not have the
same uniqueID as the originating image.

Bug: skia:
Change-Id: Ib4d3d5ead9f5a574cf6d1920080bc9c4ae66c1d0
Reviewed-on: https://skia-review.googlesource.com/c/161625
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-10-12 16:04:21 +00:00
Brian Salomon
8d5b41b553 Revert "Add experimental API to draw a set of SkImages in one SkCanvas call."
This reverts commit 0a0304c426.

Reason for revert: Breaking metal

Original change's description:
> Add experimental API to draw a set of SkImages in one SkCanvas call.
> 
> The client provides a src and dst rect for each image as well as
> a bitfield that indicates whether each edge of the image should be
> antialiased. This per-edge AA is useful for tiled compositors.
> 
> Rather than take a full SkPaint this API only takes an alpha, a filter
> quality (which is pinned to kLow), and a blend mode. This is a likely
> point of future evolution.
> 
> Currently the API is only fully implemented for kSrcOver on the GPU
> backend. With other blend modes or on other backends AA will be ignored
> for images that do not have all four edge AA flags set.
> 
> BUG: skia:8444
> 
> Change-Id: I143998dda8ad6a25f64e18cd600392ba553030ac
> Reviewed-on: https://skia-review.googlesource.com/c/159062
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Mike Klein <mtklein@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

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

Change-Id: I815baaeee5de9c6722cf2b9d071a8e2f7c1b6a96
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/161622
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-10-12 14:25:06 +00:00
Brian Salomon
0a0304c426 Add experimental API to draw a set of SkImages in one SkCanvas call.
The client provides a src and dst rect for each image as well as
a bitfield that indicates whether each edge of the image should be
antialiased. This per-edge AA is useful for tiled compositors.

Rather than take a full SkPaint this API only takes an alpha, a filter
quality (which is pinned to kLow), and a blend mode. This is a likely
point of future evolution.

Currently the API is only fully implemented for kSrcOver on the GPU
backend. With other blend modes or on other backends AA will be ignored
for images that do not have all four edge AA flags set.

BUG: skia:8444

Change-Id: I143998dda8ad6a25f64e18cd600392ba553030ac
Reviewed-on: https://skia-review.googlesource.com/c/159062
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-10-12 13:14:24 +00:00
Mike Reed
a631669e50 Revert "Revert "remove unneeded flag SK_SUPPORT_LEGACY_RECTMAKELARGEST""
No clients set this flag

This reverts commit c6471ebc67.

Docs-Preview: https://skia.org/?cl=161151
Bug: skia:
Change-Id: I6100b9f26c588c68cde2172c021f6f3ebe71164f
Reviewed-on: https://skia-review.googlesource.com/c/161151
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-10-11 19:15:53 +00:00
Mike Reed
c6471ebc67 Revert "remove unneeded flag SK_SUPPORT_LEGACY_RECTMAKELARGEST"
This reverts commit 1e29525d5f.

Reason for revert: forgot to also delete float version, and update dox

Original change's description:
> remove unneeded flag SK_SUPPORT_LEGACY_RECTMAKELARGEST
> 
> Bug: skia:
> Change-Id: I42ada9845f4cefd4029c0420d64508decc8eef7a
> Reviewed-on: https://skia-review.googlesource.com/c/161147
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=reed@google.com

Change-Id: If207292c23b1d3c60de2bc83795b8e845d8fdda2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/161150
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-10-10 21:08:16 +00:00
Mike Reed
1e29525d5f remove unneeded flag SK_SUPPORT_LEGACY_RECTMAKELARGEST
Bug: skia:
Change-Id: I42ada9845f4cefd4029c0420d64508decc8eef7a
Reviewed-on: https://skia-review.googlesource.com/c/161147
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-10-10 20:37:37 +00:00
Jim Van Verth
f00b16233d Fix up SkImage_GpuYUVA MakePromiseYUVATexture
Bug: skia:7901
Change-Id: I8722373148f99cb16e2aa9c825832bb83fa4e979
Reviewed-on: https://skia-review.googlesource.com/c/161043
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2018-10-10 17:41:23 +00:00
Robert Phillips
6ba8c83234 Fix yuv_to_rgb_effect GM
This bug was introduced in https://skia-review.googlesource.com/c/skia/+/160162 (Make GrYUVtoRGBEffect more flexible)

I don't know why I wasn't seeing this locally!

Change-Id: Ic4d9b88b70c6d691d1e30d5ee0dc592a00b9b4e7
Reviewed-on: https://skia-review.googlesource.com/c/161044
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-10-10 16:19:25 +00:00
Hal Canary
42137de2b2 SkPDF: stop using linked list of dynamic memory streams.
also:
     delete src/core/SkSinglyLinkedList.h
     add prependToAndReset() to SkDynamicMemoryWStream.

All test PDFs are identical.

Change-Id: I528873f2f5061f07dd416a71f39d97ee97ef3c7d
Reviewed-on: https://skia-review.googlesource.com/c/159323
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
2018-10-09 19:01:49 +00:00
Brian Osman
9e737fe32f Remove unused (Android-only) stable ID from SkPixelRef
Bug: skia:
Change-Id: Ibfe5d7e4c713bf637318f3e2ecc219495bd62879
Reviewed-on: https://skia-review.googlesource.com/c/160767
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-09 15:52:46 +00:00
Mike Klein
0d8084db91 remove deprecated SK_ATTR_DEPRECATED
Change-Id: I73a35fb4d408fb5eeabbb99f0362bd75e8814c7d
Reviewed-on: https://skia-review.googlesource.com/c/159485
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-10-09 15:25:33 +00:00
Herb Derby
434377abfb Split out SkRunFont and SkPaint
Coping paints take significant time. The ApplyFontToPaint
idiom requires a copy and a dtor. This CL keeps the paint and
font in parallel through the code until a paint is actually
needed, then a special ctor is used to create it.

Also, inline a bunch of text blob calls that were showing up
in perf.

Change-Id: I7da746a287e4d3942e45e9536ef9acdc64f084d4
Reviewed-on: https://skia-review.googlesource.com/c/159222
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2018-10-05 16:10:07 +00:00
Robert Phillips
b6df1c1e59 Expose the SkYUVAIndex version of the SkImage factories
TBR=bsalomon@google.com
Bug: skia:7903
Change-Id: Ib5a3bdba99da4cfb79115d1ff7b2c014272a5556
Reviewed-on: https://skia-review.googlesource.com/c/159520
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Cary Clark <caryclark@google.com>
2018-10-05 15:24:59 +00:00
Mike Klein
d945698c5d remove SkColorSpaceTransferFn::operator()()
Looks like SkColorSpaceXformSteps is its only user,
and it can easily switch over to skcms instead.

We're now making 3-6 function calls instead of inlining,
but on the other hand, they're replacing 3-6 calls to powf()...

Guarded with SK_LEGACY_TF_APPLY.

Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I502d4b3979a4e912820c925b63a174406801be0b
Reviewed-on: https://skia-review.googlesource.com/c/159762
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-10-04 22:35:03 +00:00
Mike Klein
7e587330c8 Reland "remove deprecated SkRect::MakeFromIRect()"
This is a reland of 4fea17393a

Original change's description:
> remove deprecated SkRect::MakeFromIRect()
> 
> Needs https://chromium-review.googlesource.com/c/chromium/src/+/1261818
> 
> Change-Id: I529a2cd16d46ad13bc1eb9d3746e3587e25e9dbe
> Reviewed-on: https://skia-review.googlesource.com/c/159481
> Reviewed-by: Cary Clark <caryclark@google.com>

Change-Id: I53e5b23f765d5b28df50bea70cd8d8f9aac7e740
Reviewed-on: https://skia-review.googlesource.com/c/159821
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-10-04 22:05:27 +00:00
Hal Canary
2e01805298 SkDynamicMemoryWStream: make moveable
Motivation:  using this in an experiment of mine (I want a
std::vector<SkDynamicMemoryWStream>.)

Change-Id: I28e2c468156ace2f9e7d5e09937e05bc8b7e8200
Reviewed-on: https://skia-review.googlesource.com/c/159326
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-10-04 21:29:49 +00:00
Mike Klein
4302eb9a6e Revert "remove deprecated SkRect::MakeFromIRect()"
This reverts commit 4fea17393a.

Reason for revert: one more in Google3.

Original change's description:
> remove deprecated SkRect::MakeFromIRect()
> 
> Needs https://chromium-review.googlesource.com/c/chromium/src/+/1261818
> 
> Change-Id: I529a2cd16d46ad13bc1eb9d3746e3587e25e9dbe
> Reviewed-on: https://skia-review.googlesource.com/c/159481
> Reviewed-by: Cary Clark <caryclark@google.com>

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

Change-Id: I02872a3dd6031e360ce7c1988c8a73c9b7096067
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/159820
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-10-04 20:57:58 +00:00
Mike Klein
d295dff5c6 remove SkColorSpaceTransferFn::invert()
Looks like DM may be its only user?
That was me and just for convenience... I can fold it through.

Change-Id: I4ed6ee659df4192e3d6db7ce5b055c4c923673bd
Reviewed-on: https://skia-review.googlesource.com/c/159761
Reviewed-by: Brian Osman <brianosman@google.com>
2018-10-04 20:33:20 +00:00
Hal Canary
d18d7bd294 SK_SUPPORT_LEGACY_DOCUMENT_FACTORY: clean up part 2/2
Change-Id: Ibab2f420c779e0307f4df214f229609b377acf29
Reviewed-on: https://skia-review.googlesource.com/c/156369
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-10-04 20:00:24 +00:00
Mike Klein
ae16b74365 Reland "hash tf, and whole colorspace"
This is a reland of 58887bc3c1

Original change's description:
> hash tf, and whole colorspace
> 
> Change-Id: I088124ead162d369c5c9f8bdd3fc0a39b2b3de46
> Reviewed-on: https://skia-review.googlesource.com/c/159486
> Commit-Queue: Mike Klein <mtklein@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

Change-Id: Idec6b6817f7a2136083caecd20c35e1eb9f2f388
Reviewed-on: https://skia-review.googlesource.com/c/159622
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-10-04 19:33:04 +00:00
Mike Klein
4fea17393a remove deprecated SkRect::MakeFromIRect()
Needs https://chromium-review.googlesource.com/c/chromium/src/+/1261818

Change-Id: I529a2cd16d46ad13bc1eb9d3746e3587e25e9dbe
Reviewed-on: https://skia-review.googlesource.com/c/159481
Reviewed-by: Cary Clark <caryclark@google.com>
2018-10-04 19:09:42 +00:00
Mike Klein
5959353a31 remove SkColorSpace::toXYZD50()
Change-Id: I005623828b6f074077d5ba6a4e72f3192bfbfb12
Reviewed-on: https://skia-review.googlesource.com/c/159623
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-10-04 18:50:24 +00:00
Brian Osman
11c221a5ce Remove unused Options parameter from SkImageGenerator::getPixels
I'd like to remove this from the virtual onGetPixels as well, but that
requires staging a chromium change.

Bug: skia:
Change-Id: I078e5135daaa77803d8474027a98da2973556afb
Reviewed-on: https://skia-review.googlesource.com/c/159522
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
2018-10-04 18:22:12 +00:00
Hal Canary
363a3f838c SkCanvas: remove unused SkCanvas::InitFlags
Change-Id: Ib5a0a873ebe6a3c8c671afc1e9f7f102cfee4aa7
Reviewed-on: https://skia-review.googlesource.com/c/159580
Commit-Queue: Hal Canary <halcanary@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-10-04 16:49:34 +00:00
Mike Klein
5c99c210e0 Revert "hash tf, and whole colorspace"
This reverts commit 58887bc3c1.

Reason for revert: hash collisions reported on 32-bit x86

Original change's description:
> hash tf, and whole colorspace
> 
> Change-Id: I088124ead162d369c5c9f8bdd3fc0a39b2b3de46
> Reviewed-on: https://skia-review.googlesource.com/c/159486
> Commit-Queue: Mike Klein <mtklein@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

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

Change-Id: Ia8580074bd94a9fa158cdd98dc6b021ee5650883
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/159620
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-10-04 16:40:34 +00:00
Mike Klein
58887bc3c1 hash tf, and whole colorspace
Change-Id: I088124ead162d369c5c9f8bdd3fc0a39b2b3de46
Reviewed-on: https://skia-review.googlesource.com/c/159486
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-10-04 16:20:42 +00:00
Mike Klein
fe5ad67dea remove deprecated SkBitmap::eraseRGB()
Change-Id: I1adf711d39f441154aa1c032d49583d0c45d2568
Reviewed-on: https://skia-review.googlesource.com/c/159482
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Cary Clark <caryclark@google.com>
2018-10-04 15:37:27 +00:00
Mike Klein
5f8ef8c1da remove deprecated SkMatrix44::map() 2x
Change-Id: Iac32934a454da7c6edf02aec36fa12e4dbbae408
Reviewed-on: https://skia-review.googlesource.com/c/159483
Reviewed-by: Brian Osman <brianosman@google.com>
2018-10-04 14:55:23 +00:00
Brian Osman
f28e55d5a1 Add SkPMColor4f support to SkSL
Convert GrConstColorProcessor to store SkPMColor4f

Bug: skia:
Change-Id: I6c505856653a02e576ae11fca59dc307545437f7
Reviewed-on: https://skia-review.googlesource.com/c/159152
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-10-04 14:55:04 +00:00
Robert Phillips
66a9734934 Make SkYUVAIndex publicly accessible
Change-Id: I3da7c566cdf9256e57ac7e7f30fee18b9c1a144d
Reviewed-on: https://skia-review.googlesource.com/c/159460
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-10-04 14:14:23 +00:00
Mike Klein
4429a4f82c re-precate SkMatrix44::SkMatrix44()
It's been driving me nuts that I can't just write `SkMatrix44 m;`,
and I often don't care whether it's initialized or not.  The default
identity constructor would be nice to use, but it's deprecated.

By tagging this constructor deprecated, we're only hurting ourselves;
our big clients disable warnings about deprecated routines and use it
freely.

A quick tally in Skia shows we mostly use the uninitialized constructor,
but sometimes the identity constructor, and there is a spread of all
three in Chromium.  So I've left the two explicit calls available.

I switched a bunch of calls in Skia to use the less verbose constructor
where it was clear that it didn't matter if the matrix was initialized.
Literally zero of the kUninitialized constructor calls looked important
for performance, so the only place I've kept is its lone unit test.

A few places read clearer with an explicit "identity" to read.

Change-Id: I0573cb6201f5a36f3b43070fb111f7d9af92736f
Reviewed-on: https://skia-review.googlesource.com/c/159480
Reviewed-by: Brian Osman <brianosman@google.com>
2018-10-04 14:01:11 +00:00
Brian Osman
781e35071d Remove SkPM4f
Bug: skia:
Change-Id: If5ed79680f215ac5087469b4c04942885bdb5fd0
Reviewed-on: https://skia-review.googlesource.com/c/159322
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-10-03 20:21:58 +00:00
Mike Klein
9e0efe3189 remove SkColorSpaceXform
Change-Id: I08181d2f5a81a4f0781304dd7fab2cb1452b2c30
Reviewed-on: https://skia-review.googlesource.com/c/159300
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-10-03 20:08:48 +00:00
Mike Klein
df66894999 cleanup SkColorSpace API and members
I think this is the cleanup we can do immediately
once I rebaseline the previous CL.

Nothing will be using fromXYZD50() any longer.

I've made toXYZD50() lazily cache its SkMatrix44.
Not to many people call that function, so it'd be a
pretty straightforward cleanup to switch to the one
that writes to an SkMatrix44*, which is just fine.

Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Iad45ef7c95ed7f9a9528d543f2307490ca5de087
Reviewed-on: https://skia-review.googlesource.com/158000
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-10-02 18:57:54 +00:00
Kevin Lubick
cbcff385c1 Have pathkit use libpathkit.a for faster builds
Of note, it is very important for the -DSK_RELEASE/-DSK_DEBUG
to match between libskia.a and the WASM bindings, otherwise
things like SKDEBUGCODE are sometimes compiled in and sometimes
not, which can cause headaches like sizeof() mismatching between
.cpp files and .h files.

Bug: skia:
Change-Id: Id6ef58c44a7c10014a243b36708e0891514f6008
Reviewed-on: https://skia-review.googlesource.com/158341
Reviewed-by: Mike Klein <mtklein@google.com>
2018-10-02 13:27:29 +00:00
Brian Osman
1d5b598c4e Towards removing GrColor4f
We'd really like to converge on SkRGBA4f everywhere. This CL continues
to store GrColor4f in the GPU backend, but changes the constantColor
optimization logic to use SkPMColor4f.

GrColor[4f] have "unknown" alpha type, but in this context, they are
nearly always premul, so let's take advantage of our SkRGBA4f type
safety. We lose some of the semantic benefits and helpers that are
present in GrColor4f (OpaqueWhite, TransparentBlack).

The biggest thing that would probably help is a direct path to/from
bytes (GrColor).

Bug: skia:
Change-Id: Ic0838ad3f95d207163b3af51e5f5cf6f499c2047
Reviewed-on: https://skia-review.googlesource.com/157840
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-10-01 18:32:56 +00:00
Robert Phillips
e8e2bb1384 Test YUV images in DDL
The main two CLs calved off (and landed independently) from this CL are:

https://skia-review.googlesource.com/c/skia/+/156761 (Add SkImage_Gpu::MakePromiseYUVATexture)
  -- adds internal place holder for YUVA promise images (only returns Y channel)

https://skia-review.googlesource.com/c/skia/+/156140 (Add SkImage_Base API to access planar data)
  -- adds ability to grab planes for testing purposes (not externally visible)

Bug: skia:7903
Bug: skia:8424
Change-Id: Id0f2f84851dacc66c2c266a30cafa0b628b12eb4
Reviewed-on: https://skia-review.googlesource.com/151983
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-10-01 12:12:29 +00:00
Mike Klein
cfa315390f update SkColorSpace APIs and members
We now store 3x3 matrices, and cache all
destination inversion, not just the matrix.

The 4x4's are still there to support existing APIs,
including the guard flag added for layout tests.

There will be tons of tiny diffs from the inversion
changes, both from inverting transfer functions and
from inverting the matrix.

This doesn't change the numbers I'm seeing in nanobench,
but it does move the matrix concat and tf invert way
down the profile.

Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I66be4a84f12c4fefaf6ac2105d5c82e66d6b42e7
Reviewed-on: https://skia-review.googlesource.com/157522
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-09-28 18:32:47 +00:00
Nathan Rogers
815737cf7d Fix a typo in SkISize comments
Change-Id: I94597214ea3c7e3c0b5f88c42378061f0d217da2
Reviewed-on: https://skia-review.googlesource.com/157400
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: Nathan Rogers <nathanrogers@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-09-27 20:27:18 +00:00
Yuqian Li
bd03b54cb9 Handle dividing by zero in ComputeComplexity
Bug: oss-fuzz:9884
Change-Id: Ibeeb1ffdb46d9a648c7ec8944424af2d0138af59
Reviewed-on: https://skia-review.googlesource.com/156631
Commit-Queue: Yuqian Li <liyuqian@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Auto-Submit: Yuqian Li <liyuqian@google.com>
2018-09-25 22:31:22 +00:00
Mike Klein
f6a4bd8717 Reland "focus exported color apis"
This is a reland of c5de102ff4

This time around, SkColor4f::FromColor() is also exported,
as it is used by Chrome OS.

Original change's description:
> focus exported color apis
>
> Change-Id: I97f9db61698b6fee783fa3d6bfbbdd023fd6fee5
> Reviewed-on: https://skia-review.googlesource.com/156245
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Mike Klein <mtklein@google.com>

Bug: chromium:888381
Cq-Include-Trybots: luci.chromium.try:linux-chromeos-compile-dbg
Change-Id: I616e28ab7262bdce1c80a027a898119f4ff0eee3
Reviewed-on: https://skia-review.googlesource.com/156246
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2018-09-24 15:43:10 +00:00
Mike Klein
ae967aa5c4 Revert "focus exported color apis"
This reverts commit c5de102ff4.

Reason for revert: SkColor4f::FromColor() is used by Chromium too.

Original change's description:
> focus exported color apis
> 
> Change-Id: I97f9db61698b6fee783fa3d6bfbbdd023fd6fee5
> Reviewed-on: https://skia-review.googlesource.com/156245
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Mike Klein <mtklein@google.com>

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

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

Change-Id: Ib8479e8d5ac9e124358188b1f58d3100613312fb
Reviewed-on: https://skia-review.googlesource.com/156362
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-09-24 01:41:44 +00:00
Brian Osman
358558a4ce Cleanup SkPatchUtils, stop using SkColorSpaceXform
Bug: skia:
Change-Id: If60b571be2aaf0ab6e1ec37e28a2fb29a2940270
Reviewed-on: https://skia-review.googlesource.com/156191
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
2018-09-21 21:28:37 +00:00
Mike Klein
c5de102ff4 focus exported color apis
Change-Id: I97f9db61698b6fee783fa3d6bfbbdd023fd6fee5
Reviewed-on: https://skia-review.googlesource.com/156245
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-09-21 21:20:15 +00:00
Brian Osman
d25b7c10b5 Introduce SkRGBA4f, templated on SkAlphaType
Most functionality is shared, but this lets us get type safety.
SkColor4f = SkRGBA4f<kUnpremul>
SkPMColor4f = SkRGBA4f<kPremul>

Change-Id: I27408565dc92e722f42a185cecbf7af15d1dde3f
Reviewed-on: https://skia-review.googlesource.com/156243
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
2018-09-21 20:37:04 +00:00
Hal Canary
00529a1771 SK_SUPPORT_LEGACY_DOCUMENT_FACTORY: clean up part 1/2
part 2 can follow after android patch lands.

Change-Id: If2a8135ac7384d84fd97d68933684ad8486d7471
Reviewed-on: https://skia-review.googlesource.com/156189
Auto-Submit: Hal Canary <halcanary@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2018-09-21 19:50:40 +00:00
Mike Reed
c25f440d53 Reland "add getAlphaf() to pixmap/bitmap"
This is a reland of f3ebd312f2

PS 2: use faster half->float routine
PS 3: relax tolerance to 2^-10 for half, keeping others 2^-12

Original change's description:
> add getAlphaf() to pixmap/bitmap
>
> Convenient for just extracting alpha (and more efficient than getColor()) and
> works for super-normal formats w/o loss of precision.
>
> Somewhat inspired by examining multiple chrome call-sites for getColor(), where
> chrome only really cared about the alpha. This new method runs about twice
> as fast as getColor() for the simple cases (i.e. no colorspace xforms), and
> even faster in the complex cases (since retrieving alpha doesn't care about
> colorspaces).
>
> Bug: skia:
> Change-Id: I7cd5a2c7f78de781aaa69dd1aa0dba3c532fcb73
> Reviewed-on: https://skia-review.googlesource.com/155606
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Mike Klein <mtklein@google.com>

Cq-Include-Trybots: skia.primary:Test-Android-Clang-Nexus7-CPU-Tegra3-arm-Debug-All-Android,Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-SK_CPU_LIMIT_SSE2,Test-Debian9-GCC-GCE-CPU-AVX2-x86_64-Release-All,Test-Win2016-MSVC-GCE-CPU-AVX2-x86_64-Release-All,Test-Win8-Clang-Golo-CPU-AVX-x86_64-Debug-All
Bug: skia:
Change-Id: Ie94e5c89e185fde12cbd6c56ed4026c4dc5a1623
Reviewed-on: https://skia-review.googlesource.com/156242
Commit-Queue: Ravi Mistry <rmistry@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-09-21 17:41:03 +00:00
Brian Osman
81cbd03a24 Work toward removing SkPM4f
Added SkColor4f premul/unpremul that just return SkColor4f.
Renamed existing premul to toPM4f. For many uses of SkPM4f,
conversion to pure SkColor4f code was simple. In all other
cases, continue to use SkPM4f for now.

Also convert usage of one-off SkRGBAf class in SkPatchUtils,
and delete that class, along with some truly tautological
unit tests that were the only thing keeping some PM4f API
around.

Bug: skia:
Change-Id: I344c3290ee7af6bbe86c3ff74a2df2f5e87afa38
Reviewed-on: https://skia-review.googlesource.com/156005
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-09-21 15:44:51 +00:00
Robert Phillips
be852e44ef Revert "add getAlphaf() to pixmap/bitmap"
This reverts commit f3ebd312f2.

Reason for revert: unhappy bots

Original change's description:
> add getAlphaf() to pixmap/bitmap
> 
> Convenient for just extracting alpha (and more efficient than getColor()) and
> works for super-normal formats w/o loss of precision.
> 
> Somewhat inspired by examining multiple chrome call-sites for getColor(), where
> chrome only really cared about the alpha. This new method runs about twice
> as fast as getColor() for the simple cases (i.e. no colorspace xforms), and
> even faster in the complex cases (since retrieving alpha doesn't care about
> colorspaces).
> 
> Bug: skia:
> Change-Id: I7cd5a2c7f78de781aaa69dd1aa0dba3c532fcb73
> Reviewed-on: https://skia-review.googlesource.com/155606
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Mike Klein <mtklein@google.com>

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

Change-Id: I82ce00c09d16bf3e9b04f1c1bccd8cc6aa706ab2
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/156000
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-09-20 19:48:08 +00:00
Mike Reed
f3ebd312f2 add getAlphaf() to pixmap/bitmap
Convenient for just extracting alpha (and more efficient than getColor()) and
works for super-normal formats w/o loss of precision.

Somewhat inspired by examining multiple chrome call-sites for getColor(), where
chrome only really cared about the alpha. This new method runs about twice
as fast as getColor() for the simple cases (i.e. no colorspace xforms), and
even faster in the complex cases (since retrieving alpha doesn't care about
colorspaces).

Bug: skia:
Change-Id: I7cd5a2c7f78de781aaa69dd1aa0dba3c532fcb73
Reviewed-on: https://skia-review.googlesource.com/155606
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-09-20 19:25:22 +00:00
Hal Canary
23564b9249 SkDocument: Factories now located in SkPDFDocument.h and SkXPSDocument.h
Change-Id: I48e73b27e52511292c2c0bd51ef0168766f53a80
Reviewed-on: https://skia-review.googlesource.com/152780
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2018-09-20 18:21:07 +00:00
Hal Canary
c9873a5f8b Document headers: IWYU
Change-Id: If0c5b7d540d9f5980b30ff4209c57f8c57421282
Reviewed-on: https://skia-review.googlesource.com/155761
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-09-20 16:07:02 +00:00
Hal Canary
c2d0fb17de include: whitespace changes for clang-format
Change-Id: I76ab59d963cebf6cbb450e1873c3e0c63f3f2da0
Reviewed-on: https://skia-review.googlesource.com/155560
Commit-Queue: Hal Canary <halcanary@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2018-09-19 14:54:57 +00:00
Hal Canary
27c8404d87 IWYU: three files
Change-Id: I7d4fefeafce06145818c607b28b30887a52acc74
Reviewed-on: https://skia-review.googlesource.com/155501
Auto-Submit: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-09-19 14:21:55 +00:00
Mike Klein
0191ed8e87 Make listener lists threadsafe with a mutex.
PS1 reverts commit 6c8d242b14.
PS2 uses an SkMutex for thread safety.

Change-Id: I9318f92cc028844b3dc5a99a00282c2762057895
Reviewed-on: https://skia-review.googlesource.com/155060
Reviewed-by: Mike Klein <mtklein@google.com>
2018-09-18 15:46:26 +00:00
Cary Clark
cdc371af3e fix bookmaker
add docs for new SkImage methods

Also, the tool slightly adjusted the spacing
for the include comments, and fixed a few references.

TBR=bsalomon@google.com

Docs-Preview: https://skia.org/?cl=155160
Bug: skia:
Change-Id: I7977ca3048bd7d0c23f84db19f62f7accdcd77bb
Reviewed-on: https://skia-review.googlesource.com/155160
Commit-Queue: Cary Clark <caryclark@skia.org>
Auto-Submit: Cary Clark <caryclark@skia.org>
Reviewed-by: Cary Clark <caryclark@skia.org>
2018-09-18 11:58:35 +00:00
Brian Salomon
d2fcfb5813 WEBGL_video_texture : sharing texture prototype in skia
Bug: 776222

Change-Id: I84c81bdaa6dc0b5548f116a28c6319e601effb32
Reviewed-on: https://skia-review.googlesource.com/146695
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Kenneth Russell <kbr@google.com>
2018-09-18 02:22:00 +00:00
Herb Derby
6c8d242b14 Make atomic lists list for bitmaps and paths
Make the listner list for bitmas and paths use a simple atomic
stack. This stack implementation does not have the ABA problem
because you can only pop the entire stack at once
with exchange(nullptr).

BUG=skia:8324

Change-Id: I7b0438a42c473b36cd4b0cbf236bf1692c5afab3
Reviewed-on: https://skia-review.googlesource.com/154861
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2018-09-17 20:54:06 +00:00
Cary Clark
9bb34b74f3 update generated includes
This fixes all comments in generated includes
to fit in 100 columns.

TBR=reed@google.com

Bug: skia:6898
Change-Id: I6d28a24d4e2d079e4a9284d4b2a25326dc5f2dc6
Reviewed-on: https://skia-review.googlesource.com/154440
Commit-Queue: Cary Clark <caryclark@skia.org>
Auto-Submit: Cary Clark <caryclark@skia.org>
Reviewed-by: Cary Clark <caryclark@skia.org>
2018-09-13 19:03:00 +00:00
Stan Iliev
505dd57406 Add GrSurfaceOrigin to MakeFromAHardwareBuffer
Add support for kBottomLeft_GrSurfaceOrigin origin for SkImage
backed by an Android hardware buffer.

Bug: b/115610873
Change-Id: I8ba142007ee01c3fc2fd48317b29388d07a7b6e0
Reviewed-on: https://skia-review.googlesource.com/154301
Commit-Queue: Stan Iliev <stani@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2018-09-13 18:43:25 +00:00
Cary Clark
dcec329d3b fix 100 column violators in generated includes
Several generated includes include code that exceeds the 100 column
limit. Fix the code that exceeds 100 columns here.
In a later CL, bookmaker will fix the comments that
exceed 100 columns.

TBR=reed@google.com

Bug: skia:6898
Change-Id: I8b44b01675e99c5750f3c89689f29bb709203ec2
Reviewed-on: https://skia-review.googlesource.com/154303
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
Auto-Submit: Cary Clark <caryclark@skia.org>
2018-09-13 16:00:54 +00:00
Mike Reed
5152c4acfb Reland "remove SK_SUPPORT_LEGACY_TYPEFACE_MAKEFROMSTREAM"
This reverts commit b8e125281d.

Reason for revert: flutter has landed in fuchsia

Original change's description:
> Revert "remove SK_SUPPORT_LEGACY_TYPEFACE_MAKEFROMSTREAM"
> 
> This reverts commit 558fabb31c.
> 
> Reason for revert: flutter hasnt rolled into fuschia so this breaks fuschia
> 
> Original change's description:
> > remove SK_SUPPORT_LEGACY_TYPEFACE_MAKEFROMSTREAM
> > 
> > ... now that Brian updated Flutter's callsites
> > 
> > Bug: skia:8350
> > Change-Id: I5ae72700125e09d84392eee8045c9602f718909a
> > Reviewed-on: https://skia-review.googlesource.com/153901
> > Reviewed-by: Brian Osman <brianosman@google.com>
> > Commit-Queue: Brian Osman <brianosman@google.com>
> > Auto-Submit: Mike Reed <reed@google.com>
> 
> TBR=brianosman@google.com,reed@google.com
> 
> Change-Id: I263e3c7694895ac85dc71a785832e7fb89dc81de
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:8350
> Reviewed-on: https://skia-review.googlesource.com/154081
> Reviewed-by: Cary Clark <caryclark@skia.org>
> Commit-Queue: Cary Clark <caryclark@skia.org>

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

Change-Id: Iabf3c78c883275c0256b31bcde87d4cdc8eecbec
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:8350
Reviewed-on: https://skia-review.googlesource.com/154302
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-09-13 15:19:09 +00:00
Florin Malita
d661474866 Improved SkPath packing
sizeof(SkPath): 24 -> 16 (on 64bit)

Change-Id: Iea0d363b70209eb984c816f9fba59c461fe42cec
Reviewed-on: https://skia-review.googlesource.com/154041
Reviewed-by: Mike Klein <mtklein@google.com>
2018-09-12 19:39:40 +00:00
Cary Clark
b8e125281d Revert "remove SK_SUPPORT_LEGACY_TYPEFACE_MAKEFROMSTREAM"
This reverts commit 558fabb31c.

Reason for revert: flutter hasnt rolled into fuschia so this breaks fuschia

Original change's description:
> remove SK_SUPPORT_LEGACY_TYPEFACE_MAKEFROMSTREAM
> 
> ... now that Brian updated Flutter's callsites
> 
> Bug: skia:8350
> Change-Id: I5ae72700125e09d84392eee8045c9602f718909a
> Reviewed-on: https://skia-review.googlesource.com/153901
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>
> Auto-Submit: Mike Reed <reed@google.com>

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

Change-Id: I263e3c7694895ac85dc71a785832e7fb89dc81de
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:8350
Reviewed-on: https://skia-review.googlesource.com/154081
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
2018-09-12 18:55:00 +00:00
Mike Reed
558fabb31c remove SK_SUPPORT_LEGACY_TYPEFACE_MAKEFROMSTREAM
... now that Brian updated Flutter's callsites

Bug: skia:8350
Change-Id: I5ae72700125e09d84392eee8045c9602f718909a
Reviewed-on: https://skia-review.googlesource.com/153901
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2018-09-12 15:23:48 +00:00
Florin Malita
0e0f1a71da SkPath::shrinkToFit docs
Add header and .bmh docs for shrinkToFit().

Also remove SkPath::debugging_private_getFreeSpace() and refactor tests
to use (friended) helper classes.

Docs-Preview: https://skia.org/?cl=153668
Change-Id: I3f93f9561b25025ce04a81d5e2f0271295b3daad
Reviewed-on: https://skia-review.googlesource.com/153668
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-09-11 20:43:22 +00:00
Florin Malita
3d413c5761 Reland: add SkPath::shrinkToFit
Original CL: https://skia-review.googlesource.com/c/skia/+/150967

  * expanded tests
  * fixed shared pathref copying

Change-Id: I4bfe89f597485aa2db68f58d99112188615faceb
Reviewed-on: https://skia-review.googlesource.com/153553
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
Auto-Submit: Florin Malita <fmalita@chromium.org>
2018-09-11 18:33:00 +00:00
Mike Reed
a21a16b5dd Revert "add SkPath::shrinkToFit"
This reverts commit 3d69be51bb.

Reason for revert: breaks on SAN builds

Original change's description:
> add SkPath::shrinkToFit
> 
> Bug: skia:
> Change-Id: Ief647bcea53c0aeae2750473288bd31f16521772
> Reviewed-on: https://skia-review.googlesource.com/150967
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Mike Reed <reed@google.com>
> Auto-Submit: Mike Reed <reed@google.com>

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

Change-Id: Ic3d6497268df1eb86392f83844d3fdcdb0674373
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/153261
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-09-10 21:03:53 +00:00
Mike Reed
3d69be51bb add SkPath::shrinkToFit
Bug: skia:
Change-Id: Ief647bcea53c0aeae2750473288bd31f16521772
Reviewed-on: https://skia-review.googlesource.com/150967
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2018-09-10 20:49:31 +00:00
Mike Reed
87ce0690b7 Revert "Revert "add flag to soften the blow of removing a legacy api for flutter""
Remember to delete the define from SkTypeface.h

This reverts commit b5f23f398d.

Bug: skia:
Change-Id: I63b2e395dac3850d352f38fdfee9ad751cdcace9
Reviewed-on: https://skia-review.googlesource.com/152590
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-09-07 20:58:54 +00:00
Mike Klein
d9187c085b Revert "SkMath takes some functions from from SkTypes"
This reverts commit 3b347232bc.

Reason for revert: tree done gone red.

Original change's description:
> SkMath takes some functions from from SkTypes
> 
> Moved to include/core/SkMath.h: Sk{Is|}Align{2|4|8|Ptr}, SkLeftShift,
> SkAbs{32|}, SkM{ax|in}32 SkTM{in|ax}, SkTClamp, SkFastMin32, SkTPin.
> 
> Change-Id: Ibcc07be0fc3677731048e7cc86006e7aa493cb92
> Reviewed-on: https://skia-review.googlesource.com/133381
> Auto-Submit: Hal Canary <halcanary@google.com>
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Commit-Queue: Hal Canary <halcanary@google.com>

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

Change-Id: I44073cf397e2a3a6a941a90f0aa63c6396d4c742
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/152587
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-09-07 17:32:54 +00:00
Hal Canary
3b347232bc SkMath takes some functions from from SkTypes
Moved to include/core/SkMath.h: Sk{Is|}Align{2|4|8|Ptr}, SkLeftShift,
SkAbs{32|}, SkM{ax|in}32 SkTM{in|ax}, SkTClamp, SkFastMin32, SkTPin.

Change-Id: Ibcc07be0fc3677731048e7cc86006e7aa493cb92
Reviewed-on: https://skia-review.googlesource.com/133381
Auto-Submit: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-09-07 17:18:46 +00:00
Hal Canary
2d40490d4c Move some functions to MathPriv.h
Change-Id: I22c57a746e4a997fc03f35aa06b23d9fa9ed4fa9
Reviewed-on: https://skia-review.googlesource.com/152183
Commit-Queue: Hal Canary <halcanary@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-09-06 15:48:25 +00:00
Cary Clark
60ebf14ccc Revert "SkStream: remove some WStream functions from public api"
This reverts commit 8b68110507.

Reason for revert: breaks bots

Original change's description:
> SkStream: remove some WStream functions from public api
> 
> move functions to SkStringPriv.h
> 
> also add SkStrAppendU32Hex() function, and re-write
> SkString::insertHex() to use SkStrAppendU32Hex.
> 
> add unit tests.
> 
> Change-Id: Ieda98fb4106db71565b607e593713a91a5ddd892
> Reviewed-on: https://skia-review.googlesource.com/151986
> Reviewed-by: Cary Clark <caryclark@google.com>
> Commit-Queue: Hal Canary <halcanary@google.com>

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

Change-Id: Idbac615092f46c18b38e08385dafba20930f0ff0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/152121
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
2018-09-06 12:22:41 +00:00
Hal Canary
8b68110507 SkStream: remove some WStream functions from public api
move functions to SkStringPriv.h

also add SkStrAppendU32Hex() function, and re-write
SkString::insertHex() to use SkStrAppendU32Hex.

add unit tests.

Change-Id: Ieda98fb4106db71565b607e593713a91a5ddd892
Reviewed-on: https://skia-review.googlesource.com/151986
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-09-06 11:44:11 +00:00
Mike Klein
71f8475a0d Revert "update to new MakeFromStream signature"
This reverts commit edc6ea7a9e.

Reason for revert: need to update Flutter, Google3.

Original change's description:
> update to new MakeFromStream signature
> 
> Bug: skia:
> Change-Id: Ic18a45628905b90a2477043989ad4cb9fa11ab52
> Reviewed-on: https://skia-review.googlesource.com/151880
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Derek Sollenberger <djsollen@google.com>

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

Change-Id: I22daf2cdb86f9e5ca3b78db45f8e15efe4b21005
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/152120
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-09-06 11:37:06 +00:00
Mike Reed
edc6ea7a9e update to new MakeFromStream signature
Bug: skia:
Change-Id: Ic18a45628905b90a2477043989ad4cb9fa11ab52
Reviewed-on: https://skia-review.googlesource.com/151880
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
2018-09-06 00:43:20 +00:00
Mike Klein
5595f6ef0e clean up S16CPU
S16CPU is used only inside Skia, and only sparsely.

    - SkRandom::nextS16() and nextU16() were used rarely enough
      that it makes things simpler to get rid of them.
    - SkAlphaBlend255() was unused outside tests.
    - SkIntToFDot6() looks like it really wants to take an int.

Change-Id: I3ca773beb6c04c691947d4602f27c819b660554d
Reviewed-on: https://skia-review.googlesource.com/151700
Reviewed-by: Brian Osman <brianosman@google.com>
2018-09-05 15:48:04 +00:00
Mike Klein
7af2bc8802 more skcolorspace cleanup
This time with infinitely less stack usage.

Change-Id: Ic0b4662203eb2787fd9d793fee65ebcd592ad5f3
Reviewed-on: https://skia-review.googlesource.com/151420
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-09-05 14:39:31 +00:00
Brian Osman
b0f4d0a658 Reland "Switch SkPaint's color to SkColor4f"
This reverts commit cacf496a9d.

Reason for revert: Android tests have been updated.

Original change's description:
> Revert "Switch SkPaint's color to SkColor4f"
> 
> This reverts commit ee87c8629c.
> 
> Reason for revert: Android tests.
> 
> Original change's description:
> > Switch SkPaint's color to SkColor4f
> > 
> > Change-Id: Ic2b83a05739720013a7c30ec014df0747b3f99a5
> > Reviewed-on: https://skia-review.googlesource.com/149229
> > Commit-Queue: Brian Osman <brianosman@google.com>
> > Reviewed-by: Mike Klein <mtklein@google.com>
> 
> TBR=djsollen@google.com,mtklein@google.com,brianosman@google.com,reed@google.com
> 
> Change-Id: I85efd020598d70cbfb90c4f4af7d33482a3d7280
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/151544
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

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

Change-Id: Ifb817ab496fef22a7b1306af82186c6badbfa992
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/151664
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-09-05 14:16:33 +00:00
Brian Osman
cacf496a9d Revert "Switch SkPaint's color to SkColor4f"
This reverts commit ee87c8629c.

Reason for revert: Android tests.

Original change's description:
> Switch SkPaint's color to SkColor4f
> 
> Change-Id: Ic2b83a05739720013a7c30ec014df0747b3f99a5
> Reviewed-on: https://skia-review.googlesource.com/149229
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Mike Klein <mtklein@google.com>

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

Change-Id: I85efd020598d70cbfb90c4f4af7d33482a3d7280
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/151544
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-09-04 19:55:02 +00:00
Brian Osman
cca8c6fa47 SkColorSpace cleanup
Remove SkColorSpace_XYZ, no need for an interface with one
implementation.

Change-Id: I47a23293334b5e02a6e5af8356b3df0262f86d5a
Reviewed-on: https://skia-review.googlesource.com/150138
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-09-04 15:48:02 +00:00
Mike Reed
271d1d9001 Change SkTypeface::MakeFromStream to take unique_ptr
Also, add MakeFromData variant, which matches SkFontMgr

Bug: skia:8350
Change-Id: Ia220496bab8ecf0e7eefaf0c8b62d88ea1394a17
Reviewed-on: https://skia-review.googlesource.com/150969
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2018-09-04 15:24:12 +00:00
Nigel Tao
de124022f4 Remove obsolete kIndex_8_SkColorType reference
Bug: skia:6828

No public API change. Just removing an obsolete comment.
TBR=reed@google.com

Change-Id: I6c729c62bf7d94fc6acb677d68e7091f80d73b3e
Reviewed-on: https://skia-review.googlesource.com/150781
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
2018-09-04 14:55:48 +00:00
Brian Osman
ee87c8629c Switch SkPaint's color to SkColor4f
Change-Id: Ic2b83a05739720013a7c30ec014df0747b3f99a5
Reviewed-on: https://skia-review.googlesource.com/149229
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-09-04 13:55:46 +00:00
Mike Reed
bf67741140 add behavior enum to SkTypeface::serialize()
This enables a simple SkSerialProc for typefaces that can decide,
during picture serialization, how much data to serialize for each
typeface.

Bug: skia:
Change-Id: Ic9d18b24d9e650fd2a78304520a73aa0645dc139
Reviewed-on: https://skia-review.googlesource.com/150968
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Yuqian Li <liyuqian@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2018-09-03 16:52:26 +00:00
Chris Dalton
09a7bb2221 Reland "ccpr: Implement stroking with fine triangle strips"
This is a reland of 2f2757fa6b

Original change's description:
> ccpr: Implement stroking with fine triangle strips
>
> Implements strokes by linearizing the curve into fine triangle strips
> and interpolating a coverage ramp for edge AA. Each triangle in the
> strip emits either positive or negative coverage, depending on its
> winding direction. Joins and caps are drawn with the existing CCPR
> shaders for triangles and conics.
>
> Conic strokes and non-rigid-body transforms are not yet supported.
>
> Bug: skia:
> Change-Id: I45a819abd64e91c2b62e992587eb85c703e09e77
> Reviewed-on: https://skia-review.googlesource.com/148243
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Allan MacKinnon <allanmac@google.com>

TBR=robertphillips@google.com

Bug: skia:
Change-Id: I3f0065e80975ee8334300bc5e934231b66b49178
Reviewed-on: https://skia-review.googlesource.com/151188
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
2018-09-03 10:16:28 +00:00
Jim Van Verth
0b7645f6d9 Simplify perspective shadows to match future MD specs.
* For ambient we outset a constant amount around the perspective shape.
* For spot we compute the projection of the bounds from the light's
  perspective, and from that compute a matrix to transform the path.

Bug: skia:7971
Change-Id: I7fffdd1446423956773d145ff4fae0a81602ad5b
Reviewed-on: https://skia-review.googlesource.com/150471
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-08-31 18:15:19 +00:00
Mike Klein
835b2f5769 update SkPreConfig a little
- add AVX-512 to SK_CPU_SSE_LEVEL
  - remove unused SK_ARM_ARCH
  - small formatting changes
  - no need to check for __ARM_NEON__ and __ARM_NEON...
    __ARM_NEON is defined anywhere we'll find NEON.

Change-Id: I6841097d62cf73ddb749f961261e583474470276
Reviewed-on: https://skia-review.googlesource.com/150960
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-08-31 15:09:19 +00:00
Chris Dalton
02e6efe0a4 Revert "ccpr: Implement stroking with fine triangle strips"
This reverts commit 2f2757fa6b.

Reason for revert: issues with DDL

Original change's description:
> ccpr: Implement stroking with fine triangle strips
> 
> Implements strokes by linearizing the curve into fine triangle strips
> and interpolating a coverage ramp for edge AA. Each triangle in the
> strip emits either positive or negative coverage, depending on its
> winding direction. Joins and caps are drawn with the existing CCPR
> shaders for triangles and conics.
> 
> Conic strokes and non-rigid-body transforms are not yet supported.
> 
> Bug: skia:
> Change-Id: I45a819abd64e91c2b62e992587eb85c703e09e77
> Reviewed-on: https://skia-review.googlesource.com/148243
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Allan MacKinnon <allanmac@google.com>

TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com,caryclark@google.com,csmartdalton@google.com,reed@google.com,allanmac@google.com

Change-Id: I1980b09976df8275817eaffb6766dbd9fd3e59c7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/150980
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2018-08-31 14:45:44 +00:00
Chris Dalton
2f2757fa6b ccpr: Implement stroking with fine triangle strips
Implements strokes by linearizing the curve into fine triangle strips
and interpolating a coverage ramp for edge AA. Each triangle in the
strip emits either positive or negative coverage, depending on its
winding direction. Joins and caps are drawn with the existing CCPR
shaders for triangles and conics.

Conic strokes and non-rigid-body transforms are not yet supported.

Bug: skia:
Change-Id: I45a819abd64e91c2b62e992587eb85c703e09e77
Reviewed-on: https://skia-review.googlesource.com/148243
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Allan MacKinnon <allanmac@google.com>
2018-08-31 12:51:47 +00:00
Heather Miller
c9367d33dc Update Skia milestone to 71
TBR:reed@google.com
NOTRY=true

Bug: skia:
Change-Id: Ic3a9b2511fed9a731867200e4f298f8f54eaf85b
Reviewed-on: https://skia-review.googlesource.com/150580
Reviewed-by: Heather Miller <hcm@google.com>
2018-08-30 18:02:33 +00:00
Mike Reed
500cbc6533 clean up for removing drawTextOnPath from canvas
Docs-Preview: https://skia.org/?cl=150127
Bug: skia:7554
Change-Id: I4aa980e083626e25c2f04d8e18a75bdc280b5191
Reviewed-on: https://skia-review.googlesource.com/150127
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2018-08-29 16:27:48 +00:00
Mike Reed
a62d036586 textonpath no longer in canvas
Prev behavior available via utils SkDrawTextOnPath

Bug: skia:7554
Change-Id: I3d71963c632cc947e418757bb83cdc18ec3b184e
Reviewed-on: https://skia-review.googlesource.com/150123
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2018-08-29 14:04:45 +00:00
Brian Osman
18d7cf76cc Reland "Remove old ICC parser, A2B SkColorSpace, SkGammas, etc..."
This reverts commit 7ba1d64f07.

Reason for revert: Chrome's MakeICC calls are gone now.
Original change's description:
> Revert "Remove old ICC parser, A2B SkColorSpace, SkGammas, etc..."
> 
> This reverts commit 8ae7c90faf.
> 
> Reason for revert: Chrome roll
> 
> Original change's description:
> > Remove old ICC parser, A2B SkColorSpace, SkGammas, etc...
> > 
> > Docs-Preview: https://skia.org/?cl=148807
> > Change-Id: I2d77f6543e390c4948d57242a518af77443f0165
> > Reviewed-on: https://skia-review.googlesource.com/148807
> > Commit-Queue: Mike Klein <mtklein@google.com>
> > Reviewed-by: Mike Klein <mtklein@google.com>
> 
> TBR=mtklein@google.com,brianosman@google.com,reed@google.com
> 
> Change-Id: I5821591b22e395327ec0cd29ec18569bf7f61859
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/150142
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

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

Change-Id: I0269f8627f3afadeed7d1559a2a3dabf0c7f7b3f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/150122
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-08-28 20:07:16 +00:00
Brian Osman
7ba1d64f07 Revert "Remove old ICC parser, A2B SkColorSpace, SkGammas, etc..."
This reverts commit 8ae7c90faf.

Reason for revert: Chrome roll

Original change's description:
> Remove old ICC parser, A2B SkColorSpace, SkGammas, etc...
> 
> Docs-Preview: https://skia.org/?cl=148807
> Change-Id: I2d77f6543e390c4948d57242a518af77443f0165
> Reviewed-on: https://skia-review.googlesource.com/148807
> Commit-Queue: Mike Klein <mtklein@google.com>
> Reviewed-by: Mike Klein <mtklein@google.com>

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

Change-Id: I5821591b22e395327ec0cd29ec18569bf7f61859
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/150142
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-08-28 17:52:22 +00:00
Mike Reed
7c8d2e940e don't support virtual onDrawTextOnPath
Bug: skia:7554
Change-Id: Ia8c663918fea7bc91f3474d1c94e7a1c5536a1d4
Reviewed-on: https://skia-review.googlesource.com/149805
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2018-08-28 16:54:18 +00:00
Cary Clark
153e76d4bf deprecate draw text on path in docs
Remove documentation, see also references, and examples
that rely on SkCanvas::drawTextOnPath(HV).

Move example that uses SkDrawTextOnPath into illustrations.
TBR=reed@google.com

Docs-Preview: https://skia.org/?cl=150020
Bug: skia:6898
Change-Id: I1d92f258b75a8a10a6aa89ebf9380871ba7ecac5
Reviewed-on: https://skia-review.googlesource.com/150020
Commit-Queue: Cary Clark <caryclark@skia.org>
Reviewed-by: Cary Clark <caryclark@skia.org>
2018-08-28 16:22:53 +00:00
Cary Clark
1cb97a2f32 fix empty region iter rect
Region iterators return bounds but do not initialize
the result if Iterator has no region or region is
empty.

Add general tests for empty region iterators.

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

Docs-Preview: https://skia.org/?cl=149980
Bug: skia:8186
Change-Id: If4367d4c0eef7fc9c7bfd7d1436143e155b78309
Reviewed-on: https://skia-review.googlesource.com/149980
Commit-Queue: Cary Clark <caryclark@skia.org>
Reviewed-by: Hal Canary <halcanary@google.com>
2018-08-28 15:21:25 +00:00
Brian Osman
8ae7c90faf Remove old ICC parser, A2B SkColorSpace, SkGammas, etc...
Docs-Preview: https://skia.org/?cl=148807
Change-Id: I2d77f6543e390c4948d57242a518af77443f0165
Reviewed-on: https://skia-review.googlesource.com/148807
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-08-28 14:25:35 +00:00
Mike Reed
c349f18ee8 use textonpath util for canvas::drawTextOnPath
- slight change in pixels
- will allow us to remove lots of virtuals

Bug: skia:7554
Change-Id: I8f95c07bf67760824d9d9bf59c28f11835971d4b
Reviewed-on: https://skia-review.googlesource.com/149683
Commit-Queue: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Auto-Submit: Mike Reed <reed@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2018-08-27 19:37:24 +00:00
Robert Phillips
4f6c9157ba Remove occluder parameter from SkMaskFilter::MakeBlur factory
I've cleaned up the call sites in Chrome so we should be able to remove this

Change-Id: I945c0cd54647b20f47012c26f31667b4dd6a07f0
Reviewed-on: https://skia-review.googlesource.com/148662
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-08-22 15:59:29 +00:00
Herb Derby
65956874e0 Rename SkGlyphRunListDrawer to SkGlyphRunListPainter
Change-Id: I43aa72e67b87f03e234cf5d451ef7259611222da
Reviewed-on: https://skia-review.googlesource.com/148398
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2018-08-21 21:31:50 +00:00
Robert Phillips
557aad7775 Remove occluder feature from blur mask filter
AFAICT none of our clients are using this feature

This will change the occludedrrectblur GM.

Change-Id: I7e5b8fa67db0373dee11a1467d2b2b6a414a1574
Reviewed-on: https://skia-review.googlesource.com/147561
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-08-17 14:15:30 +00:00
Ben Wagner
035aa329ba SkFontMgr::matchFamilyStyle can return nullptr.
The current documentation states that SkFontMgr::matchFamilyStyle will
never return nullptr, resolving to the default system font or the empty
typeface if necessary. This isn't the behavior desired by any users,
since doing so makes it difficult for the user to check if a 'good'
match was made or not. All of the current SkFontMgr implementations can
return nullptr anyway for a number of reasons, from lack of a 'good'
match to an error.

Bug: skia:8260
Change-Id: I96299c16aaa7228fd42a9d8ec4889c7355cb53a5
Reviewed-on: https://skia-review.googlesource.com/147721
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Ben Wagner <bungeman@google.com>
2018-08-16 22:49:52 +00:00
Mike Reed
6d10f8bda1 move patheffect virtuals to protected and rename
- change filterPath to safely handle if src and dst are aliases

Bug: skia:8254
Change-Id: I125d19404ca0a610f73271abb5c5455d1d50f9ed
Reviewed-on: https://skia-review.googlesource.com/147466
Commit-Queue: Mike Reed <reed@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2018-08-16 17:47:22 +00:00
Cary Clark
0251b1be0b fix SkPath documentation
SkPath now returns reference to itself.
There's also a new addPoly() variant.
Update the docs to match.

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

Docs-Preview: https://skia.org/?cl=147216
Bug: skia:6818
Change-Id: I0e40e942cc46a8994285dfea4c81e2042a4e689c
Reviewed-on: https://skia-review.googlesource.com/147216
Commit-Queue: Cary Clark <caryclark@skia.org>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Auto-Submit: Cary Clark <caryclark@skia.org>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Cary Clark <caryclark@skia.org>
2018-08-15 19:57:32 +00:00
Mike Reed
b631742f0b return this from maker calls, so we can chain the calls
Bug: skia:
Change-Id: Id62eda9dab9399ce1183a959438db7dde59889d8
Reviewed-on: https://skia-review.googlesource.com/147113
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2018-08-15 17:21:59 +00:00
Ruiqi Mao
c97a339cd6 added optimizations to speed up skinning
Docs-Preview: https://skia.org/?cl=145148
Bug: skia:
Change-Id: If27722105a1e8999f6440b6fd4044cc1f327827e
Reviewed-on: https://skia-review.googlesource.com/145148
Commit-Queue: Ruiqi Mao <ruiqimao@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-08-15 15:52:29 +00:00
Cary Clark
af04551333 refresh generated includes
generate include documentation for the first time
for SkRegion.h and SkTextBlob.h, and refresh a
few others.

TBR=reed@google.com

Bug: skia:6818
Change-Id: Ie8ad53095b3d7c5d8418c6cf2163a749ab6ecb53
Reviewed-on: https://skia-review.googlesource.com/146704
Commit-Queue: Cary Clark <caryclark@skia.org>
Auto-Submit: Cary Clark <caryclark@skia.org>
Reviewed-by: Cary Clark <caryclark@skia.org>
2018-08-10 17:55:28 +00:00
Herb Derby
c1b482cddb Rename GrTextUtils::Target to GrTextTarget
Change-Id: I29e1c6e117a4cbbde6e43639228b1103966b6358
Reviewed-on: https://skia-review.googlesource.com/146641
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2018-08-10 15:21:52 +00:00
Mike Klein
93ce79dba4 drop SkTextBlob alignas(void*), align in Builder manually
GCC can't handle SK_API and alignas() next to each other,
tested up through GCC 8.1.

Instead, just align up the area we allocate for the SkTextBlob.

Bug: skia:8239

Change-Id: Ibdccfc09649b79a6eaa50ffd731d4bab012d24df
Reviewed-on: https://skia-review.googlesource.com/146703
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-08-10 13:24:23 +00:00
Mike Klein
015c899d34 port most SkAtomic<T> to std::atomic<T>
The only SkAtomic<T> left are the ones overriding the default memory
order in SkPath.  I think I'd like to try switching them to std::atomic
too, but in another CL.

Trim unused APIs in SkAtomics.h.

Change-Id: Ia1c283355902ccb8fcdad70cdf27bb577e8ca407
Reviewed-on: https://skia-review.googlesource.com/146529
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-08-09 23:40:31 +00:00
Herb Derby
bc6f9c9a8c Remove GrTextUtil::Paint
This was just acting like a pair of SkPaint, GrColor. But,
had an additional pointer to a color space. I changed
everything to just pass the pair around.

BUG=chromium:864564

Change-Id: I9858556b8bca0d5359d4d6e9784d63ff8c4f467b
Reviewed-on: https://skia-review.googlesource.com/146381
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-08-09 22:25:13 +00:00
Mike Klein
475c5e93fe turn on alignment sanitizer
This sanitizer checks for overaligned reads and writes,
or put another way, use of underaligned pointers.

This usually happens when you cast, e.g. char* to int*
without checking that the char* is 4-byte aligned.  Each
of the changes under src/ fixes something just like that.

The unusual setup for tools/xsan.blacklist is there to
force a rebuild whenever tools/xsan.blacklist changes.
I spent a good few minutes debugging rebuilds not happening
this morning, perhaps from some strange ccache interaction.

Align SkTextBlobs as void* (today they're just 4-byte) so the
SkTextBlob::RunRecords we put after them in SkTextBlobBuilder
buffers are properly aligned (for the SkTypeface* inside).

There's no obvious error in void SkRRect::computeType(),
but one bot seems to have seen some sort of issue with

    SK_AT_SCOPE_EXIT(SkASSERT(this->isValid()));

I can't reproduce it locally, so I'm just going to unroll it.

Change-Id: I904d94f65f695e1b626b684c32216a4930b72b0c
Reviewed-on: https://skia-review.googlesource.com/146104
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2018-08-09 21:13:15 +00:00
Cary Clark
e12a090a63 make some textblob builders private for now
Move SkTextBlobBuilder::allocRunText* to private: for the time
being, to reduce the documented interface footprint.

No code is deleted; the functions may be restored when a
client is ready to call them.

Also, add SkTextBlob::MakeFromString to complement
SkTextBlob::MakeFromText.

R=halcanary@google.com,fmalita@google.com
TBR=reed@google.com
Bug: skia:6818
Change-Id: If09d4da4ce38b680d73f25d187e3d06eeb0ec652
Reviewed-on: https://skia-review.googlesource.com/146521
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
2018-08-09 15:01:31 +00:00
Cary Clark
c0534fa833 minor SkRegion include edits
name or rename parameters

TBR=reed@google.com

Bug: skia:6818
Change-Id: I04637a25869b3512e241e157528cd794a53481a2
Reviewed-on: https://skia-review.googlesource.com/145720
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
Auto-Submit: Cary Clark <caryclark@skia.org>
2018-08-07 13:34:57 +00:00
Cary Clark
6943689ab4 clean up includes
Prepare SkRegion.h, SkShader.h, SkStream.h for documentation.
Name params, add trailing commas to enum member list,
move or remove some public SkRegion.h stuff.

SkRegion gets a minor overhaul to move some pieces
to private: or SkRegionPriv. The intent is to preserve the
current code so that the fixes for documentation do not impact
performance or code size.

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

Docs-Preview: https://skia.org/?cl=141284
Bug: skia:6818
Change-Id: I0d82794081b8739a9e8af0d1cd4a0e5d32d04f04
Reviewed-on: https://skia-review.googlesource.com/141284
Commit-Queue: Cary Clark <caryclark@skia.org>
Reviewed-by: Mike Reed <reed@google.com>
2018-08-06 14:49:46 +00:00
Brian Osman
04ae8eef82 Add color space to SkColorFilter::filterColor4f
We can assume sRGB in filterColor, but with filterColor4f, we're often
passing a color that's in a different space. We need to plumb that
through, so that mode color filter (eg) converts and works in the right
space. This color space argument is both the space of the SkColor4f
being passed, and the space that the filter operates in.

Fixes several more GMs so they render the same in glp3 and p3-gl.

Bug: skia:
Change-Id: Ia80e0f48459c3ecc9b9f86681006fe44c3009f51
Reviewed-on: https://skia-review.googlesource.com/144787
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-08-01 20:45:50 +00:00
Nigel Tao
70039d8c96 Remove SkFastMin32
SkFastMin32 has been the same as SkMin32 since commit 38bad32cf5 "fold
SK_CPU_HAS_CONDITION_INSTR through as always defined" was submitted in
July 2013 as per https://chromiumcodereview.appspot.com/21122005

TBR=hcm@google.com
The only change to the public API is removing a redundant helper from
SkTypes.h

Bug: skia:
Change-Id: Ic6f7c7dc5612e8b7b1be3923f572ffcc13555d75
Reviewed-on: https://skia-review.googlesource.com/144242
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
2018-07-30 18:14:38 +00:00
Herb Derby
c3bc69f238 Rename MakeAsTextDraw to MakeFromText
Change-Id: I3fbb4d27b728e5fc5ecec9fc9d9e215dd5a83359
Reviewed-on: https://skia-review.googlesource.com/144123
Commit-Queue: Herb Derby <herb@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
Auto-Submit: Herb Derby <herb@google.com>
Reviewed-by: Cary Clark <caryclark@google.com>
2018-07-27 21:03:26 +00:00
Florin Malita
ab54e7394d Hide SkTextBlob::GlyphPositioning from public API
Make private, add corresponding SkTextBlobRunIterator enum.

Also move SkTextBlobRunIterator to SkTextBlobPriv.h.

Change-Id: If3e0beabb0e8484b1ac73c6fc0827e920ca1f93b
Reviewed-on: https://skia-review.googlesource.com/142501
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Cary Clark <caryclark@google.com>
2018-07-27 14:10:17 +00:00
Herb Derby
1347144e3e Centralize bitmap glyph positioning
Centralize all text drawing for bitmap devices into SkGlyphRunListDrawer.
All drawing decisions are encapsulated in this class, and its behavior
only depends on contant properties of the device.

The method drawForBitmap will probably have to be converted to a template
based in preliminary performance numbers.

Change-Id: Id21567c1511eee9d2e9e20c7ae93544530cfdb81
Reviewed-on: https://skia-review.googlesource.com/143106
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2018-07-26 18:16:46 +00:00
Hal Canary
4014ba6ec7 SkUtils: remove some versions of UTF routines.
Change-Id: Ib1f776ae472117c23d2145253adf25fceb412b32
Reviewed-on: https://skia-review.googlesource.com/143111
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-07-25 17:21:56 +00:00
Cary Clark
785586af7d remove unused serialization in textblob
The SKTextBlob serialization code that is tested by Skia is
unused by Chrome. The serialization code that is
used by Chrome is untested by Skia.

Remove the unused code; test the used code.

The code path introduced nearly a year ago,
likely for slimming paint, attempts to make
text blobs smarter by allowing the reuse of typefaces.

Maybe there needs to be a Chrome bug / feature
request to use this?

If if turns out there is no interest to do so,
This CL aligns used interfaces with tests.

R=reed@google.com,fmalita@google.com,bungeman@google.com

Bug: skia:6818
Change-Id: I9b3ec0c326495322986ba26f20f901bcb208be73
Reviewed-on: https://skia-review.googlesource.com/141542
Reviewed-by: Cary Clark <caryclark@skia.org>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Cary Clark <caryclark@skia.org>
Auto-Submit: Cary Clark <caryclark@skia.org>
2018-07-19 14:32:45 +00:00
Heather Miller
81bb123957 Update Skia milestone to 70
TBR:reed

Bug: skia:
Change-Id: Ic85fa9f11d5c635ab7b9c71d31227f29d856473a
Reviewed-on: https://skia-review.googlesource.com/142326
Reviewed-by: Heather Miller <hcm@google.com>
2018-07-19 13:44:30 +00:00
Hal Canary
2b0e6cd4d9 Reland "SkDEBUGF: use __VA_ARGS__"
This is a reland of 2267a09235

Original change's description:
> SkDEBUGF: use __VA_ARGS__
> 
> Change-Id: I42a47e821ff7a7f6cec65b38a8216cabbf0acfce
> Reviewed-on: https://skia-review.googlesource.com/139860
> Reviewed-by: Mike Klein <mtklein@google.com>
> Commit-Queue: Hal Canary <halcanary@google.com>

Change-Id: Ia06567e441a414f4dcdbe5663160082f889f9fef
Reviewed-on: https://skia-review.googlesource.com/141762
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-07-18 15:37:41 +00:00
Herb Derby
4b3a5152a3 MakeAsDrawText for SkTextBlob
Change-Id: I04ebca6b318e0654cc1e598aa323cfb9a21e5a5e
Reviewed-on: https://skia-review.googlesource.com/141960
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Cary Clark <caryclark@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Herb Derby <herb@google.com>
2018-07-17 22:16:41 +00:00
Ben Wagner
d5148e3314 Move SkNoncopyable to include/private.
Change-Id: I62f60ea52faeebddecacf03d9429ac3f7c516b8e
Reviewed-on: https://skia-review.googlesource.com/141823
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2018-07-17 21:39:51 +00:00
Robert Phillips
a8cdbd7431 Restore SkLightingShader and associated classes
This reverts https://skia-review.googlesource.com/c/skia/+/31140 (Remove SkLightingShader and associated classes) and updates the classes to ToT

Change-Id: I3b1df1704cca8907aa00f081a7e93339b65ad4fa
Reviewed-on: https://skia-review.googlesource.com/141545
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-07-17 17:24:50 +00:00
Cary Clark
53c8769002 remove unused untested parts of text blob
SkTextBlob has a number of untested entry points
to serialize and deserialize. Privitize ones only used
by Skia, and remove ones suspected to be unused
and untested.

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

Bug: skia:6818
Change-Id: I6a9982a26a883982af3592f3302029a1bcdf5aa3
Reviewed-on: https://skia-review.googlesource.com/141820
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
2018-07-17 17:01:20 +00:00
Brian Osman
f6db495d2d Remove SkTransferFunctionBehavior
Bug: skia:
Change-Id: Iccbe609b2a8d4c9098ef36aa6530dbc3771e0c11
Reviewed-on: https://skia-review.googlesource.com/141055
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-07-17 14:18:20 +00:00
Cary Clark
7651c1611e refresh generated includes
the newest ones (SkBlendMode.h, SkPicture.h, SkRRect.h)
need additional editing; enough has changed that it is
time to refresh anyway.

TBR=reed@google.com

Docs-Preview: https://skia.org/?cl=141043
Bug: skia:6818
Change-Id: Ic123b02f57005a087f8655cafa1a2537529beca5
Reviewed-on: https://skia-review.googlesource.com/141043
Commit-Queue: Cary Clark <caryclark@skia.org>
Reviewed-by: Cary Clark <caryclark@skia.org>
2018-07-13 14:23:24 +00:00
Herb Derby
8a6348e6d2 Introduce text blob processing but don't wire it up
Have all the old code paths start using lists in preparation
for introducing text blobs.

Change-Id: I65cc02ee3da63bc3c9492db78a08b0eee3b1f931
Reviewed-on: https://skia-review.googlesource.com/141081
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-07-13 03:21:54 +00:00
Ben Wagner
0277440d22 Remove SkRefCnt_SafeAssign.
Change-Id: I590e74c2de8e0c2b8d407bd869c97a4d3bd98fed
Reviewed-on: https://skia-review.googlesource.com/141041
Commit-Queue: Herb Derby <herb@google.com>
Auto-Submit: Ben Wagner <bungeman@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2018-07-12 23:42:44 +00:00
Ben Wagner
9ec70c6bd3 Remove SkSafeSetNull.
Update all users to sk_sp.

Change-Id: I6453b9456b9a8f9e2b756381797f1382ef9e6561
Reviewed-on: https://skia-review.googlesource.com/141052
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2018-07-12 20:59:20 +00:00
Brian Osman
b62f50cf76 Replace nearly all kRespect with kIgnore
- Encoders and decoders always assume kIgnore.
- They are less opinionated about F16 and color space,
  we just trust the color space that's passed in, and
  put that directly in the image (no sRGB encoding).
- SkBitmap and SkPixmap read/write pixels functions were
  defaulting to kResepct, those are now always kIgnore.
- Many other bits of plumbing are simplified, and I
  added a default of kIgnore to SkImage::makeColorSpace,
  so we can phase out that argument entirely.
- Still need to add defaults to other public APIs that
  take SkTransferFunctionBehavior.

- This makes gold think that we've dramatically changed
  the contents of all F16 images, but that's because
  it doesn't understand the (now linear) color space
  that's embedded. Once we triage them all once, they
  will work fine (and they'll look perfect in the browser).

Bug: skia:
Change-Id: I62fa090f96cae1b67d181ce14bd91f34ff2ed747
Reviewed-on: https://skia-review.googlesource.com/140570
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-07-12 20:54:14 +00:00
Ben Wagner
e346b1eea4 Add SkTypeface::getVariationDesignParameters
This adds a way for users to query the axis parameters for a typeface.

Change-Id: Idc2ac0d84bc7ae2ca484ae410cba5b01883418e5
Reviewed-on: https://skia-review.googlesource.com/137706
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2018-07-12 17:30:20 +00:00
Mike Reed
77c138f2cd remove unneeded scale from procs
Bug: skia:
Change-Id: I85adbbaf0e9d7d23c3f07490a1d323c87e8aa4da
Reviewed-on: https://skia-review.googlesource.com/140980
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-07-12 14:33:20 +00:00
Ben Wagner
2c312c4f58 Remove SkDrawFilter.
Change-Id: I0204a9522e828c87bb7c6c20ae34ce51161442af
Reviewed-on: https://skia-review.googlesource.com/137895
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2018-07-12 02:36:44 +00:00
Robert Phillips
e923cccb25 Revert "SkDEBUGF: use __VA_ARGS__"
This reverts commit 2267a09235.

Reason for revert: It looks like Google 3 is failing to compile w/ this CL

Original change's description:
> SkDEBUGF: use __VA_ARGS__
> 
> Change-Id: I42a47e821ff7a7f6cec65b38a8216cabbf0acfce
> Reviewed-on: https://skia-review.googlesource.com/139860
> Reviewed-by: Mike Klein <mtklein@google.com>
> Commit-Queue: Hal Canary <halcanary@google.com>

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

Change-Id: I3aab490f3d2fea103fc915ca01cb0e294df86739
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/140660
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-07-11 16:45:18 +00:00
Hal Canary
2267a09235 SkDEBUGF: use __VA_ARGS__
Change-Id: I42a47e821ff7a7f6cec65b38a8216cabbf0acfce
Reviewed-on: https://skia-review.googlesource.com/139860
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-07-11 15:40:18 +00:00
Brian Osman
c87cfb674b Remove old lazy image decoding heuristic logic
This led to removing a lot of transfer function behavior code. There is
more that could be done, and we need to add in decoding to dst color
space, but this CL is almost entirely mechanical.

Change-Id: I91b2169f95aadcfaacdd2b9821bb1a01ce53f9a6
Reviewed-on: https://skia-review.googlesource.com/140349
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-07-11 14:07:08 +00:00
Ruiqi Mao
9a6e42ff18 added caching of SkVertices
SkVertices can now be "volatile", meaning they should not be cached.
SkVertices is volatile by default if the argument is not given.

Pulled from reverted CL: https://skia-review.googlesource.com/c/skia/+/138596

Docs-Preview: https://skia.org/?cl=139545
Bug: skia:
Change-Id: I92cf832efe1c0aaa8f432eedde2678582dd2454e
Reviewed-on: https://skia-review.googlesource.com/139545
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Ruiqi Mao <ruiqimao@google.com>
2018-07-09 20:31:28 +00:00
Yong-Hwan Baek
688a8e5331 More workarounds on Windows Debug DLL crash.
SkData and SkTextBlob overwrites delete operator in header file.
Which causes crash on Windows Debug DLL Builds.

Sample Solution can be found in https://github.com/DevHwan/SkiaDLLTest

Bug: skia:
Change-Id: I36bc9445f5cd17afdf852009a0695036ee18ecf0
Reviewed-on: https://skia-review.googlesource.com/139680
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-07-09 17:20:17 +00:00
Brian Osman
a50205fca5 Add color type to the image filter DAG's OutputProperties
Don't try to guess the pixel config to use for intermediates. Instead,
just make the intermediates in the same color type (and space) as the
final destination. This removes some no-longer-correct logic that was
using sRGB configs, resulting in linear blending and precision loss.

Change-Id: I627c47193a9f2889c3dc121170ff3e7d5d315fa0
Reviewed-on: https://skia-review.googlesource.com/139547
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-07-06 18:34:58 +00:00
Ruiqi Mao
c05aa7d163 Revert "added skeletal animation support to GPU backend"
This reverts commit b6307340e8.

Reason for revert: patch/atlas failing in gold

Original change's description:
> added skeletal animation support to GPU backend
> 
> added caching of SkVertices
> 
> Docs-Preview: https://skia.org/?cl=138596
> Bug: skia:
> Change-Id: Ia750f55f5f6d0de250d9e9c5619f4d1ac856f9f5
> Reviewed-on: https://skia-review.googlesource.com/138596
> Reviewed-by: Brian Osman <brianosman@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Ruiqi Mao <ruiqimao@google.com>

TBR=robertphillips@google.com,brianosman@google.com,reed@google.com,ruiqimao@google.com

Change-Id: Idfaf016a7ff4cdd8af2543d510706f489d04417a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/139281
Reviewed-by: Ruiqi Mao <ruiqimao@google.com>
Commit-Queue: Ruiqi Mao <ruiqimao@google.com>
2018-07-03 21:18:18 +00:00
Ruiqi Mao
b6307340e8 added skeletal animation support to GPU backend
added caching of SkVertices

Docs-Preview: https://skia.org/?cl=138596
Bug: skia:
Change-Id: Ia750f55f5f6d0de250d9e9c5619f4d1ac856f9f5
Reviewed-on: https://skia-review.googlesource.com/138596
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Ruiqi Mao <ruiqimao@google.com>
2018-07-03 16:07:44 +00:00
Ruiqi Mao
94d57c477f updated SkCanvas documentation for animation overloads of drawVertices
changed bookmaker ParserCommon::writeBlockTrim limit to 20000

disabled broken SkPaint::containsText example

Docs-Preview: https://skia.org/?cl=138862
Bug: skia:8123
Change-Id: Ib4003bf7b9603bf652f86cd56e0975cd09bcbf71
Reviewed-on: https://skia-review.googlesource.com/138862
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-07-03 13:33:43 +00:00