Commit Graph

578 Commits

Author SHA1 Message Date
Mike Reed
a2cf8ae420 switch to virtual with no bones
Bug: skia:9984
Change-Id: I89d8f5f227690c71be875b5a7718aba0ad058650
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/274504
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2020-03-03 13:35:00 +00:00
Mike Reed
9d4e31d6cd rm Sk3D.h -- long live SkMat4
Change-Id: Ib83ee6567b1a32f34364b7ac66a659eaeced3249
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272037
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2020-02-20 13:15:33 +00:00
Mike Reed
a3a704afa3 Override didTranslate, and add virtual for didScale
This completes pushing through the new virtual didConcat44() to our
subclasses, and introduces didScale() for future optimizations. We
don't call didScale yet, until external subclasses are also updated.

This was derived from https://skia-review.googlesource.com/c/skia/+/263349

bug: skia: 9768
Change-Id: Ia26b48e76e323037082e8f2ee83673c26b99ebed
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/263702
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-01-11 02:11:26 +00:00
Mike Reed
f6d70a8e3f Revert "Revert "forward concat44 in nway canvas""
This reverts commit 3723fb7e85.

Fix: don't call the inherited methods on canvas

bug: skia: 9768
Change-Id: Ifb913bd30452ba8389399f709d40c7b58d6157d8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/263776
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-01-10 22:01:41 +00:00
Mike Reed
3723fb7e85 Revert "forward concat44 in nway canvas"
This reverts commit 8964bc13da.

Reason for revert: break flutter unittest?

Original change's description:
> forward concat44 in nway canvas
> 
> Change-Id: If4eb791c0701fb7055283e721308bd3c633576d7
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/263572
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=reed@google.com

Change-Id: I0c8e3b3d0df05948f935ffa6d72ea84ef420b7cc
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/263714
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-01-10 20:27:12 +00:00
Mike Reed
8964bc13da forward concat44 in nway canvas
Change-Id: If4eb791c0701fb7055283e721308bd3c633576d7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/263572
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-01-10 17:23:51 +00:00
Mike Reed
a092028439 Revert "new virtuals for canvas ctm"
This reverts commit 2076b04d15.

Reason for revert: speculative: breaking google3 flutter scuba?

Original change's description:
> new virtuals for canvas ctm
> 
> 1. Feature: Clients need to override didConcat44() (new data)
> 2. Perf: Clients need to override didTranslate (and now didScale) so our
>          default impls can be empty.
> 
> Need SK_SUPPORT_LEGACY_CANVAS_MATRIX_VIRTUALS flag to stage this in
> clients (anyone who subclasses SkCanvas)
> 
> Before (with flag)
>     120.87  	canvas_matrix_4x4	8888
>     108.10 ?	canvas_matrix_3x3	8888
>     108.13 ?	canvas_matrix_2x3	8888
>     141.54  	canvas_matrix_scale	8888
>     128.04  	canvas_matrix_trans	8888
> 
> After (without the flag)
>     ...
>      90.79  	canvas_matrix_scale	8888
>      94.51  	canvas_matrix_trans	8888
> 
> bug: skia:9768
> 
> Change-Id: I6f500138dd6b2b24754dc065c650d0bd3c341540
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/263349
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Florin Malita <fmalita@chromium.org>

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

Change-Id: I9c2e39ea0aa2b19d40eb6454c233258ab7f35829
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/263564
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-01-10 14:26:41 +00:00
Mike Reed
2076b04d15 new virtuals for canvas ctm
1. Feature: Clients need to override didConcat44() (new data)
2. Perf: Clients need to override didTranslate (and now didScale) so our
         default impls can be empty.

Need SK_SUPPORT_LEGACY_CANVAS_MATRIX_VIRTUALS flag to stage this in
clients (anyone who subclasses SkCanvas)

Before (with flag)
    120.87  	canvas_matrix_4x4	8888
    108.10 ?	canvas_matrix_3x3	8888
    108.13 ?	canvas_matrix_2x3	8888
    141.54  	canvas_matrix_scale	8888
    128.04  	canvas_matrix_trans	8888

After (without the flag)
    ...
     90.79  	canvas_matrix_scale	8888
     94.51  	canvas_matrix_trans	8888

bug: skia:9768

Change-Id: I6f500138dd6b2b24754dc065c650d0bd3c341540
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/263349
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2020-01-10 13:30:11 +00:00
Ben Wagner
c96f5108df Reland "Replace CGFontCreate with CTFontManagerCreate."
This is a reland of f1d4f00fda

Original change's description:
> Replace CGFontCreate with CTFontManagerCreate.
>
> Replaces calls to CGFontCreateWithDataProvider with calls to
> CTFontManagerCreateFontDescriptorFromData. Note that this means Skia will
> not create CTFonts based on CGFonts, however SkCreateTypefaceFromCTFont
> allows the user to create CTFonts from CGFonts and introduce them to Skia.
>
> Bug: skia:4043,skia:9627
>
> Change-Id: I8eb72c0e4eb257149f1f6a78ca34da4fbfafccab
> TBR: reed@google.com
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/254181
> Commit-Queue: Ben Wagner <bungeman@google.com>
> Reviewed-by: Dominik Röttsches <drott@google.com>

Bug: skia:4043, skia:9627
Change-Id: Ic265f2ce52b816831e6402c5ffd21dac065049dd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/257052
Reviewed-by: Dominik Röttsches <drott@chromium.org>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-11-27 19:42:13 +00:00
Ben Wagner
64331db0a4 Revert "Replace CGFontCreate with CTFontManagerCreate."
This reverts commit f1d4f00fda.

Reason for revert: some of the mac bots appear to be crashing

Original change's description:
> Replace CGFontCreate with CTFontManagerCreate.
> 
> Replaces calls to CGFontCreateWithDataProvider with calls to
> CTFontManagerCreateFontDescriptorFromData. Note that this means Skia will
> not create CTFonts based on CGFonts, however SkCreateTypefaceFromCTFont
> allows the user to create CTFonts from CGFonts and introduce them to Skia.
> 
> Bug: skia:4043,skia:9627
> 
> Change-Id: I8eb72c0e4eb257149f1f6a78ca34da4fbfafccab
> TBR: reed@google.com
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/254181
> Commit-Queue: Ben Wagner <bungeman@google.com>
> Reviewed-by: Dominik Röttsches <drott@google.com>

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

Change-Id: I5dc6b476d9f2b1dbaa2e8bf95755b0bc725dad10
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:4043, skia:9627
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/257051
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-11-27 18:52:35 +00:00
Ben Wagner
f1d4f00fda Replace CGFontCreate with CTFontManagerCreate.
Replaces calls to CGFontCreateWithDataProvider with calls to
CTFontManagerCreateFontDescriptorFromData. Note that this means Skia will
not create CTFonts based on CGFonts, however SkCreateTypefaceFromCTFont
allows the user to create CTFonts from CGFonts and introduce them to Skia.

Bug: skia:4043,skia:9627

Change-Id: I8eb72c0e4eb257149f1f6a78ca34da4fbfafccab
TBR: reed@google.com
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/254181
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Dominik Röttsches <drott@google.com>
2019-11-27 18:37:33 +00:00
Florin Malita
cfbc4d496d [skottie] Add DataURI image support in utils/tools
BodyMovin can export inline (dataURI) images.

Change-Id: I821a2e225359f8ac37d4d2c9479d4ff5d78f924e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/249516
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2019-10-21 18:02:39 +00:00
Michael Ludwig
a595f86428 Add Color4f variant for DrawEdgeAAQuad
Bug: chromium:795132,chromium:985500
Change-Id: Idbb4d45b29d2c0d0fd54b05b807086ecf0b8cf26
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/237492
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-08-27 23:22:32 +00:00
Mike Klein
359f61b101 track SkNoPixelsDevice's origin
Today we do a fairly decent job of tracking device bounds as an SkIRect,
with a little more of that plumbed through here, but that gets foiled in
SkNoPixelsDevice's constructor where we only look at bounds.width() and
bounds.height().

I think the idea was to follow the usual constraint that a "base" layer
has an origin at (0,0) and only temporary "save" layers on top might be
offset, but for a device without any pixels it's pretty reasonable for
the base layer to be offset too.

This makes picture_cull_rect draw correctly in serialize-8888 mode.

Bug: skia:9334
Change-Id: I845e74779bb21cbfd4051b0ef07381e684176eac
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/236859
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-08-23 17:52:18 +00:00
Brian Osman
fb32ddf622 Revert "Revert "Shuffle SkSL sources around so compiler and bytecode can be used w/o GPU""
This reverts commit 37a59ef1af.

Change-Id: If38da265ebbb196e72c7d035ba51028438787e2e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221541
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2019-06-18 14:47:12 +00:00
Ben Wagner
51e15a69ce Use SkTextEncoding enum instead of macros.
Change-Id: I4b6259590fa0693ee0522b4999a1c0fe250b173d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/212504
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-05-07 20:54:16 +00:00
Mike Klein
c0bd9f9fe5 rewrite includes to not need so much -Ifoo
Current strategy: everything from the top

Things to look at first are the manual changes:

   - added tools/rewrite_includes.py
   - removed -Idirectives from BUILD.gn
   - various compile.sh simplifications
   - tweak tools/embed_resources.py
   - update gn/find_headers.py to write paths from the top
   - update gn/gn_to_bp.py SkUserConfig.h layout
     so that #include "include/config/SkUserConfig.h" always
     gets the header we want.

No-Presubmit: true
Change-Id: I73a4b181654e0e38d229bc456c0d0854bae3363e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209706
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-04-24 16:27:11 +00:00
Mike Reed
d567408362 Add secret draw-behind method
This is a variant of drawPaint but is automatically clipped
to the bounds of the most recent saveBehind buffer (axis-aligned bounds).

No public exposure.

Impl is pretty simple (its a variant of drawPaint)
- find the most recent saveBehind device bounds
- if there is none, draw nothing, else
  - temporarily intersect the device's clip with that bounds
  - drawPaint
  - restore the clip

See https://buganizer.corp.google.com/issues/129117085

Change-Id: I7c532e63a80b118fb2416c572b8e0d2abf8cf59a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209166
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-04-19 20:50:22 +00:00
Ben Wagner
db13d38748 Move SkTLazy.h to src/
It is no longer used in public or private includes or by any users.

Change-Id: Id3803531b411dc7a565b2bb688505eb2c1212cfd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/208661
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-04-16 20:31:20 +00:00
Ben Wagner
393981d1db Remove deprecated SkPaintFilterCanvas::onFilter.
No longer used by any clients. The new onFilter is made pure virtual to
enforce that it is implemented and the existing fallback forwarding
implementation is removed.

Change-Id: I8ce522db78d28a1e83779fbfa6979e6e16a0cee5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/208507
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2019-04-16 17:52:13 +00:00
Ben Wagner
f55fa0d0cf Make SkPaintFilterCanvas paints no longer COW.
The two existing external users of SkPaintFilterCanvas always end up
making a copy of the paint when the canvas is in use. As a result, the
extra overhead of doing COW is being wasted. In general, it seems easier
for users to optimize by simply not using the filter canvas when it
won't be making any changes. Also, no users are using the 'Type'.

After users are updated to this new API, the old onFilter can be
removed.

Change-Id: Iee1ce3cd22bce8c00664de078375b105abd7c866
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/149806
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-04-11 22:42:13 +00:00
Martin Vejdarski
8842799432 add missing shared lib visibility macros
fixes linker errors when using is_component_build

Change-Id: Ie28b0e8881cb81715a959df3a87bae4fa854afda
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206140
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Auto-Submit: Martin Vejdarski <martin@mainframe.co.uk>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-04-09 14:34:55 +00:00
Stan Iliev
b0a8684e61 Add API to get canvas wrapped by SkPaintFilterCanvas
Implement SkAndroidFrameworkUtil::getBaseWrappedCanvas, which gets
the real canvas behind SkPaintFilterCanvas. This is useful, because
SkCanvas::drawDrawable works differently on a GPU backed canvas.

Test: Built and ran with Android
Bug: b/128792554
Change-Id: I5b75d42256d7a4efca987d55be2ce064c10fb4e7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/204442
Commit-Queue: Stan Iliev <stani@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-03-28 21:16:10 +00:00
Michael Ludwig
390f0cc1f8 Reland "Reland "Update SkCanvas' experimental SkiaRenderer API""
This reverts commit 138a06d1b1.

Reason for revert: add explicit constructors to ImageSetEntry to account for the new arguments,
matching SkiaRenderer's current initializer list. Also hardens SkPictureDrawback's deserialization
code for drawEdgeAAImageSet and drawEdgeAAQuad from a fuzz that was found during the CL's brief
lifespan.

Original change's description:
> Revert "Reland "Update SkCanvas' experimental SkiaRenderer API""
>
> This reverts commit bd9d88a6e4.
>
> Reason for revert: Breaks SkiaRenderer on Android. Rendering is all corrupted, bisected to this change.
>
> Original change's description:
> > Reland "Update SkCanvas' experimental SkiaRenderer API"
> >
> > This reverts commit 90791c202d.
> >
> > Reason for revert: Jumped the gun, just need to update blacklist
> >
> > Original change's description:
> > > Revert "Update SkCanvas' experimental SkiaRenderer API"
> > >
> > > This reverts commit 4bf964602a.
> > >
> > > Reason for revert: vulkan dm crashes
> > >
> > > Original change's description:
> > > > Update SkCanvas' experimental SkiaRenderer API
> > > >
> > > > This lifts the temporary functions in SkGpuDevice into SkCanvas and
> > > > deprecates the older experimental_DrawImageSetV1 and
> > > > experimental_DrawEdgeAARect.  The new functions can handle paints and
> > > > transform batching. Internally, SkCanvas routes the old functions to the
> > > > new entry points and all device-level code is updated to handle the new
> > > > API features.
> > > >
> > > > While touching all of the canvas/device/recording areas, the
> > > > experimental functions are grouped in an "EdgeAA" cluster instead of being
> > > > separated into the image category and the rectangle category.
> > > >
> > > > Bug: skia:8739
> > > > Change-Id: I67c2a724873040ad5dc3307ab5b2823ba1eac54b
> > > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/190221
> > > > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> > > > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > >
> > > TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com
> > >
> > > Change-Id: I87a5a258c5a1bd15e16389cdf91743772d6fa98a
> > > No-Presubmit: true
> > > No-Tree-Checks: true
> > > No-Try: true
> > > Bug: skia:8739
> > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201226
> > > Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> > > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> >
> > TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com
> >
> > Change-Id: I75e9b6cbf079a7739b69a7e208730a930621abf9
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Bug: skia:8739
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201229
> > Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> > Auto-Submit: Michael Ludwig <michaelludwig@google.com>
>
> TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com
>
> Change-Id: Ib87ef9b8b8598c16a8a6915920adf0b5dffc644b
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:8739
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201391
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

Bug: skia:8739, oss-fuzz:13794
Change-Id: Ibd7df4a398928c3170d16300bf3ade496125372c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201650
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-03-19 14:18:52 +00:00
Brian Salomon
138a06d1b1 Revert "Reland "Update SkCanvas' experimental SkiaRenderer API""
This reverts commit bd9d88a6e4.

Reason for revert: Breaks SkiaRenderer on Android. Rendering is all corrupted, bisected to this change.

Original change's description:
> Reland "Update SkCanvas' experimental SkiaRenderer API"
> 
> This reverts commit 90791c202d.
> 
> Reason for revert: Jumped the gun, just need to update blacklist
> 
> Original change's description:
> > Revert "Update SkCanvas' experimental SkiaRenderer API"
> > 
> > This reverts commit 4bf964602a.
> > 
> > Reason for revert: vulkan dm crashes
> > 
> > Original change's description:
> > > Update SkCanvas' experimental SkiaRenderer API
> > > 
> > > This lifts the temporary functions in SkGpuDevice into SkCanvas and
> > > deprecates the older experimental_DrawImageSetV1 and
> > > experimental_DrawEdgeAARect.  The new functions can handle paints and
> > > transform batching. Internally, SkCanvas routes the old functions to the
> > > new entry points and all device-level code is updated to handle the new
> > > API features.
> > > 
> > > While touching all of the canvas/device/recording areas, the
> > > experimental functions are grouped in an "EdgeAA" cluster instead of being
> > > separated into the image category and the rectangle category.
> > > 
> > > Bug: skia:8739
> > > Change-Id: I67c2a724873040ad5dc3307ab5b2823ba1eac54b
> > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/190221
> > > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> > > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > 
> > TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com
> > 
> > Change-Id: I87a5a258c5a1bd15e16389cdf91743772d6fa98a
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Bug: skia:8739
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201226
> > Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> 
> TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com
> 
> Change-Id: I75e9b6cbf079a7739b69a7e208730a930621abf9
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:8739
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201229
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> Auto-Submit: Michael Ludwig <michaelludwig@google.com>

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

Change-Id: Ib87ef9b8b8598c16a8a6915920adf0b5dffc644b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:8739
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201391
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2019-03-15 14:33:39 +00:00
Michael Ludwig
bd9d88a6e4 Reland "Update SkCanvas' experimental SkiaRenderer API"
This reverts commit 90791c202d.

Reason for revert: Jumped the gun, just need to update blacklist

Original change's description:
> Revert "Update SkCanvas' experimental SkiaRenderer API"
> 
> This reverts commit 4bf964602a.
> 
> Reason for revert: vulkan dm crashes
> 
> Original change's description:
> > Update SkCanvas' experimental SkiaRenderer API
> > 
> > This lifts the temporary functions in SkGpuDevice into SkCanvas and
> > deprecates the older experimental_DrawImageSetV1 and
> > experimental_DrawEdgeAARect.  The new functions can handle paints and
> > transform batching. Internally, SkCanvas routes the old functions to the
> > new entry points and all device-level code is updated to handle the new
> > API features.
> > 
> > While touching all of the canvas/device/recording areas, the
> > experimental functions are grouped in an "EdgeAA" cluster instead of being
> > separated into the image category and the rectangle category.
> > 
> > Bug: skia:8739
> > Change-Id: I67c2a724873040ad5dc3307ab5b2823ba1eac54b
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/190221
> > Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> 
> TBR=bsalomon@google.com,robertphillips@google.com,michaelludwig@google.com
> 
> Change-Id: I87a5a258c5a1bd15e16389cdf91743772d6fa98a
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:8739
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201226
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>

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

Change-Id: I75e9b6cbf079a7739b69a7e208730a930621abf9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:8739
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201229
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
2019-03-14 17:01:55 +00:00
Michael Ludwig
90791c202d Revert "Update SkCanvas' experimental SkiaRenderer API"
This reverts commit 4bf964602a.

Reason for revert: vulkan dm crashes

Original change's description:
> Update SkCanvas' experimental SkiaRenderer API
> 
> This lifts the temporary functions in SkGpuDevice into SkCanvas and
> deprecates the older experimental_DrawImageSetV1 and
> experimental_DrawEdgeAARect.  The new functions can handle paints and
> transform batching. Internally, SkCanvas routes the old functions to the
> new entry points and all device-level code is updated to handle the new
> API features.
> 
> While touching all of the canvas/device/recording areas, the
> experimental functions are grouped in an "EdgeAA" cluster instead of being
> separated into the image category and the rectangle category.
> 
> Bug: skia:8739
> Change-Id: I67c2a724873040ad5dc3307ab5b2823ba1eac54b
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/190221
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

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

Change-Id: I87a5a258c5a1bd15e16389cdf91743772d6fa98a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:8739
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201226
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-03-14 14:57:12 +00:00
Michael Ludwig
4bf964602a Update SkCanvas' experimental SkiaRenderer API
This lifts the temporary functions in SkGpuDevice into SkCanvas and
deprecates the older experimental_DrawImageSetV1 and
experimental_DrawEdgeAARect.  The new functions can handle paints and
transform batching. Internally, SkCanvas routes the old functions to the
new entry points and all device-level code is updated to handle the new
API features.

While touching all of the canvas/device/recording areas, the
experimental functions are grouped in an "EdgeAA" cluster instead of being
separated into the image category and the rectangle category.

Bug: skia:8739
Change-Id: I67c2a724873040ad5dc3307ab5b2823ba1eac54b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/190221
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-03-14 14:24:11 +00:00
Michael Ludwig
24adb3a356 Revert "Add general quad API to SkGpuDevice"
This reverts commit 339e1cc8d4.

Reason for revert: compositor GM breaks dm on windows

Original change's description:
> Add general quad API to SkGpuDevice
> 
> Heavily refactors SkGpuDevice's internal texturing code in an attempt
> to consolidate entry points for drawing an image. Helps lay the ground
> work for eventually implementing bitmap tiling with per-edge AA.
> 
> Bug: skia:
> Change-Id: I9feb86d5315d73119deb21e954c45e45513a63f6
> Reviewed-on: https://skia-review.googlesource.com/c/191571
> Commit-Queue: Michael Ludwig <michaelludwig@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

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

Change-Id: I74bc7eb08855dff5535cf809fc47ce6f16d2c15d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/195889
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2019-02-27 19:42:31 +00:00
Michael Ludwig
339e1cc8d4 Add general quad API to SkGpuDevice
Heavily refactors SkGpuDevice's internal texturing code in an attempt
to consolidate entry points for drawing an image. Helps lay the ground
work for eventually implementing bitmap tiling with per-edge AA.

Bug: skia:
Change-Id: I9feb86d5315d73119deb21e954c45e45513a63f6
Reviewed-on: https://skia-review.googlesource.com/c/191571
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-02-27 19:07:20 +00:00
Michael Ludwig
7545190e32 Add new experimental API for rectangles with per-edge AA control
Also updates GM_draw_quad_set to use this API instead of the
bulk API on GrRenderTargetContext.

Bug: skia:8506
Change-Id: Ia342d83c509f9db69f06f01599c7041c98aabdb6
Reviewed-on: https://skia-review.googlesource.com/c/184488
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-01-23 16:45:01 +00:00
Mike Reed
a6d1c0a13a start to build with no paint-text fields
Bug: skia:
Change-Id: Ie425fb73d70d45c05108ecca6ce8a89e8eafc02a
Reviewed-on: https://skia-review.googlesource.com/c/181161
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-01-04 04:54:34 +00:00
Mike Reed
b579f07110 change textutils to require font param
Bug: skia:
Change-Id: I8ba252e3fc5c0970fd9d83f73c32b68f3c68452e
Reviewed-on: https://skia-review.googlesource.com/c/180771
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-01-03 21:11:52 +00:00
Mike Reed
f78b7ea945 don't use paint's gettextpath
Bug: skia:
Change-Id: I8ad0b924195f46a29b095e85a8c0573912f0045d
Reviewed-on: https://skia-review.googlesource.com/c/179986
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2018-12-26 03:32:31 +00:00
Mike Reed
dc5863c4d6 use font in SkTextUtils
Bug: skia:
Change-Id: If87032f3aa9f9faa2bcf547ee95a477fbb113417
Reviewed-on: https://skia-review.googlesource.com/c/179983
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2018-12-24 04:48:15 +00:00
Mike Reed
1332743dcc remove overrides of (dead) onDrawTextRSXform
Bug: skia:
Change-Id: Iebfe7bd322849e73a0e84c1b04ac0f4c922fb746
Reviewed-on: https://skia-review.googlesource.com/c/179561
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2018-12-20 22:52:35 +00:00
Mike Reed
148b7fd3ad add saveBehind to canvas
Bug: skia:
Change-Id: I62e48b116b2d7efef585d4f465441f24ae4d2b29
Reviewed-on: https://skia-review.googlesource.com/c/177892
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-12-19 14:44:09 +00:00
Mike Reed
704a3429e6 Abandon onDrawText and its variants, turn everything into textblobs
Follow-ups assuming this sticks:
- remove client overrides, so we can remove the (empty) base class virtuals
- mark as obsolete the .skp enums for these entrypoints, and note date
- remove glyphrunlist helpers that now may not have any callers
- remove DrawCommands related to these entrypoints

Bug: skia:
Change-Id: I44b4e6ef3bee61911e77b9b2ab73f82c0817536a
Reviewed-on: https://skia-review.googlesource.com/c/175240
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2018-12-06 21:54:20 +00:00
Brian Salomon
d003d22eb0 Remove SkCanvas::experimental_drawImageSetV0
Bug: skia:8563
Change-Id: I4421a19979a2a1ddae4ca52871c71e9d7d1220d8
Reviewed-on: https://skia-review.googlesource.com/c/172870
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-11-26 20:17:30 +00:00
Leon Scroggins III
c41a5f58b2 Generate Android Framework host-side Skia (linux)
Bug: b/118742766

Update gn_to_bp to write an Android.bp file that will build a host-side
Skia library.

Switch some methods from SK_BUILD_FOR_ANDROID to
SK_BUILD_FOR_ANDROID_FRAMEWORK.

Prior reviews were done at ag/5482397.

gn_to_bp.py:
- Run GN twice - once for android and once for linux
- Disable GPU (depends on a to-be-written host side GL target) and HEIF
  (which relies on Android hardware) on linux
  - TODO: Turn on GPU on linux
- Split sources into everywhere, android-only, and linux-only.
  It seems that Android.bp does not allow using the same cpp
  file in multiple targets.
  - note that we currently *only* divide out the sources. The cflags are
    the same (except for a couple manual ones) and include
    directories are mostly the same (again, except for manual ones).
    Android has a "gpu" include directory, which I don't expect to
    make a difference to the linux build, which isn't using GPU (yet).
- Use the same "custom empty" font manager on the host as on Android
- Write separate SkUserConfig files; one for android and one for linux.
  This allows libskia to force libraries that use it to use the right
  defines by setting export_include_dirs.
- Add extra checks to SkUserConfig.h to ensure we have only the
  appropriate SK_BUILD_FOR macro defined
- Add host_supported: true for libskia

gn_to_bp_utils.py:
- Switch SkUserConfig.h from include guards to pragma once so it is
  easier to append to the end. This matches how Android generally
  includes headers.

BUILD.gn:
- Add skia_use_fixed_gamma_text so host build can use the same SK_GAMMA
  defines as the device.

SkPreConfig.h:
- Stop making SK_BUILD_FOR_ANDROID_FRAMEWORK imply SK_BUILD_FOR_ANDROID.
  The host build needs the former defined but not the latter.

SkRegion.cpp/.h:
- Make toString() SK_BUILD_FOR_ANDROID_FRAMEWORK so it can be called on
  the host.

SkCamera.h/.cpp:
- Switch methods to SK_BUILD_FOR_ANDROID_FRAMEWORK so they can be called
  on the host.
- Make getCameraLocation*() const. They are logically const, and this
  allows removing a const_cast + TODO in hwui.

Change-Id: I771f825d06380e01c0488fd1c00df1d8a2454dc0
Reviewed-on: https://skia-review.googlesource.com/c/171231
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2018-11-19 17:51:32 +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 Reed
331ccfd8e4 add textutils
These are meant to enable several things (eventually)

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

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

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

Bug: skia:8493, skia:8501
Change-Id: I5fcb945b6bcab30ef5e7019dfccb682661f56230
Reviewed-on: https://skia-review.googlesource.com/c/165061
Auto-Submit: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-10-25 17:50:20 +00:00
Brian 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 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
964aedb5e3 play with animated gif
Bug: skia:
Change-Id: If86314cda6aa84f4824958cca30cde88a78d4b59
Reviewed-on: https://skia-review.googlesource.com/c/158562
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2018-10-03 14:43:18 +00:00
Mike Reed
1eb9af9029 delete textonpath code -- not used anywhere
Bug: skia:
Change-Id: Ib645f7c140f87123429170a0bf6f7ed86ce53b3f
Reviewed-on: https://skia-review.googlesource.com/158224
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2018-10-01 16:52:32 +00:00
Mike Klein
d30937a499 remove SkRandom::next64()
It appears to be unused, and exploits undefined behavior.

Change-Id: I935de36cd2f07e811958b1696afa62d410e1cb5f
Reviewed-on: https://skia-review.googlesource.com/152123
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Cary Clark <caryclark@google.com>
2018-09-06 12:46:46 +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 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