Commit Graph

608 Commits

Author SHA1 Message Date
Mike Reed
81606b5d97 remove unused (and bit-rotting) Lua support
Change-Id: I1ee2d21b79e929e5976825ae75aa4db960b034c9
Docs-Preview: https://skia.org/?cl=315856
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/315856
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-09-09 14:33:32 +00:00
John Stiles
7571f9e490 Replace 'typedef xxxxx INHERITED' with 'using INHERITED = xxxx;'.
Mechanically updated via Xcode "Replace Regular Expression":

  typedef (.*) INHERITED;
    -->
  using INHERITED = $1;

The ClangTidy approach generated an even larger CL which would have
required a significant amount of hand-tweaking to be usable.

Change-Id: I671dc9d9efdf6d60151325c8d4d13fad7e10a15b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/314999
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-09-03 03:41:26 +00:00
Ben Wagner
81eabce6a3 SkCustomTypefaceBuilder to set SkFontStyle
Allow the user of SkCustomTypefaceBuilder to set the SkFontStyle of the
resulting SkTypeface. This allows users to build font families.

Fix the Font_flatten test to actually work (instead of relying on the
magic behavior of nullptr for SkTypeface), add a test with the custom
typeface, and reduce the number of times the inner loop runs from
302,400 times to 4,032 times so that the test finishes in a reasonable
amount of time.

Bug: skia:10630
Change-Id: I0b5e939552ee4a9a1249eefbb7a7279a59b38e5a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/311596
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Xiao Yu <xster@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-08-19 00:09:55 +00:00
John Stiles
fe0de30a87 Enable ClangTidy check modernize-use-nullptr.
https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-nullptr.html

The check converts the usage of null pointer constants (eg. NULL, 0) to
use the new C++11 nullptr keyword.

Change-Id: Iaea2d843154c70e49d62affdc5dceb3bca8c1089
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/310297
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-08-14 16:14:30 +00:00
John Stiles
1cf2c8d6ec Enable ClangTidy flag modernize-use-override.
https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-override.html

Adds override (introduced in C++11) to overridden virtual functions and
removes virtual from those functions as it is not required.

virtual on non base class implementations was used to help indicate to
the user that a function was virtual. C++ compilers did not use the
presence of this to signify an overridden function.

Change-Id: If66d8919358f72a4035190caf8d7569268037a9a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/310160
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-08-14 10:54:45 +00:00
Robert Phillips
dadc0819e9 Add missing recordingContext override to SkPaintFilterCanvas
This should fix the gpu-specific slides in Viewer.

Change-Id: I3ff069005bfe3639eb9608223b13c64f4c28c396
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301441
Reviewed-by: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-07-09 13:35:52 +00:00
Mike Klein
89c909efee Wsign-conversion for public headers
This is an Android request for our public headers,
much like warning about unused parameters.  See bug.

In general I've made two kinds of source changes:

   1) more commonly, explicitly cast to the type which
      is being implicitly cast to at head;

   2) less commonly, flip signedness of a value we're
      storing to match how it's used more smoothly.

Much of this is self inflicted inconsistent use of size_t, unsigned,
int, int32_t, uint32_t, etc.  SkTArray is particularly tricky because
of its std::vector half-compatibility.  E.g. resize() takes size_t,
but operator[] takes int.    ¯\_(ツ)_/¯

Bug: skia:9847
Change-Id: I64626a529e1662b3d3020bc03d477fc641eda544
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/293436
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-06-02 12:34:54 +00:00
Mike Reed
d240d76b34 extract original paths at big size to improve precision
As part of this, start introducing more consistent factories (matching classes like SkM44)

Change-Id: I453f1856c0427b008faaed9dbba5263e53a48ce4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290766
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-05-19 17:27:22 +00:00
Mike Reed
98bc22c689 add fontmetrics to custom typeface
Change-Id: Ib6f468f6fd35b73e590d22a33d1322d3de48edb2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290645
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-05-19 00:38:29 +00:00
Mike Reed
4a9a2d1c28 remove legacy utils for camera3d
Change-Id: I43845925aa7f3bf880b4a63fe09d9d69e7574ad5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/290376
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-05-18 02:05:28 +00:00
Florin Malita
340cd9c99e SkCustomTypeface tweaks
- don't require prior glyph count knowledge - grow dynamically

  - no need to store the glyph count explicitly, it's reflected in
    path/advance vector sizes

Change-Id: I3650ba9312db02c99b72bcf7fd3215697ec00b08
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/289893
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2020-05-14 21:44:24 +00:00
Mike Reed
b0210d208c Revert "Revert "custom typeface""
Fix: const auto [...] --> auto [...]

This reverts commit 0066adefa9.

Change-Id: I5d2df8bcc2bc681259a55b2b851d53fb18599287
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288550
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-05-07 22:52:56 +00:00
Brian Osman
c66cd987f7 Reland "Revert "custom typeface""
This reverts commit 61642b3366.

Reason for revert: ../../src/utils/SkCustomTypeface.cpp(179,20): error: cannot decompose this type; 'std::tuple_size<const SkPoint>::value' is not a valid integral constant expression

Original change's description:
> Revert "Revert "custom typeface""
> 
> Fix: implement onComputeBounds() and generateFontMetrics()
> 
> This reverts commit 0066adefa9.
> 
> Change-Id: Idb59336a3d201bb97e494ee0e0bb189e0a7186f1
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288536
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Ben Wagner <bungeman@google.com>

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

# Not skipping CQ checks because this is a reland.

Change-Id: I6845bb96a00a0c9ee54704a4c299556cc32e6438
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288557
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2020-05-07 18:46:16 +00:00
Mike Reed
61642b3366 Revert "Revert "custom typeface""
Fix: implement onComputeBounds() and generateFontMetrics()

This reverts commit 0066adefa9.

Change-Id: Idb59336a3d201bb97e494ee0e0bb189e0a7186f1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288536
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2020-05-07 18:21:30 +00:00
Mike Reed
0066adefa9 Revert "custom typeface"
This reverts commit 3a79f33eca.

Reason for revert: MSAN issues

   Uninitialized value was stored to memory at
     #0 0x2cd74de in SkFontPriv::GetFontBounds(SkFont const&) /mnt/pd0/s/w/ir/cache/work/skia/out/Build-Debian10-Clang-x86_64-Release-MSAN/Release/../../../../../../skia/src/core/SkFont.cpp:400:34
     #1 0x31115ad in SkTextBlobBuilder::ConservativeRunBounds(SkTextBlob::RunRecord const&) /mnt/pd0/s/w/ir/cache/work/skia/out/Build-Debian10-Clang-x86_64-Release-MSAN/Release/../../../../../../skia/src/core/SkTextBlob.cpp:307:31
     #2 0x31104d2 in SkTextBlobBuilder::updateDeferredBounds() /mnt/pd0/s/w/ir/cache/work/skia/out/Build-Debian10-Clang-x86_64-Release-MSAN/Release/../../../../../../skia/src/core/SkTextBlob.cpp:374:47
     #3 0x31104d2 in SkTextBlobBuilder::make() /mnt/pd0/s/w/ir/cache/work/skia/out/Build-Debian10-Clang-x86_64-Release-MSAN/Release/../../../../../../skia/src/core/SkTextBlob.cpp:605:11
     #4 0x31175c1 in SkTextBlob::MakeFromText(void const*, unsigned long, SkFont const&, SkTextEncoding) /mnt/pd0/s/w/ir/cache/work/skia/out/Build-Debian10-Clang-x86_64-Release-MSAN/Release/../../../../../../skia/src/core/SkTextBlob.cpp:782:20
     #5 0x1920415 in UserFontGM::onOnceBeforeDraw() /mnt/pd0/s/w/ir/cache/work/skia/out/Build-Debian10-Clang-x86_64-Release-MSAN/Release/../../../../../../skia/gm/userfont.cpp:65:17


Original change's description:
> custom typeface
> 
> - only paths implemented at the moment
> 
> Seems if we want to serialize/deserialize these, we will need to
> register a factory with skia, so it can sniff the beginning of the
> font "file", to know how to recreate it.
> 
> Lots of follow-on things to explore:
> - do we need to even store/know advance widths?
> - should we also (optionally) support a CMAP? names? others?
> 
> Change-Id: If9fa99b7b8f6e265f06eb3ba2ca4fcb073275250
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/287157
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Commit-Queue: Mike Reed <reed@google.com>

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

Change-Id: Iee93db8d0f94d706f0b97566d2d15e2ad2407601
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288463
Reviewed-by: Mike Reed <reed@google.com>
2020-05-07 16:51:09 +00:00
Mike Reed
3a79f33eca custom typeface
- only paths implemented at the moment

Seems if we want to serialize/deserialize these, we will need to
register a factory with skia, so it can sniff the beginning of the
font "file", to know how to recreate it.

Lots of follow-on things to explore:
- do we need to even store/know advance widths?
- should we also (optionally) support a CMAP? names? others?

Change-Id: If9fa99b7b8f6e265f06eb3ba2ca4fcb073275250
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/287157
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-05-07 15:50:16 +00:00
Brian Osman
548de7451e Change Marker IDs to be strings
They are hashed to uint32_t at the API boundary (SkCanvas, SkVertices),
but making them functionally strings will make the SkSL interaction much
nicer.

Change-Id: I0979871bf3d21373812129eb7e994987b3030e00
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/285664
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-04-28 14:12:30 +00:00
Leon Scroggins III
63cfb3638c Reland "Move SkFrontBufferedStream into Android-only dir"
This reverts commit b25f30348b.

Bug: skia:10154

Original message:
> Add client_utils for code that is specifically for a single client.
> Move SkFrontBufferedStream into its android/ subdir. Rename the class
> to android::skia::FrontBufferedStream. Temporarily leave in
> SkFrontBufferedStream until Android updates to the new API.
>
> Add a new optional target for client_utils/android. It is built in dev
> builds for testing, and when building for the Android framework.

Deliberately do not include client_utils in Google3, since the whole
point is to only include where necessary.

Change-Id: I48938c56aabb98e1ed820240d43ffcd0fdce7956
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/285104
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-04-24 17:36:30 +00:00
Joe Gregorio
b25f30348b Revert "Move SkFrontBufferedStream into Android-only dir"
This reverts commit 513720f28e.

Reason for revert: Breaking the google3 roll:
   https://sponge.corp.google.com/invocation?tab=Build+Log&id=5f96970b-8171-4c2f-abf3-006e11b8fff9

Original change's description:
> Move SkFrontBufferedStream into Android-only dir
> 
> Bug: skia:10154
> 
> Add client_utils for code that is specifically for a single client.
> Move SkFrontBufferedStream into its android/ subdir. Rename the class
> to android::skia::FrontBufferedStream. Temporarily leave in
> SkFrontBufferedStream until Android updates to the new API.
> 
> Add a new optional target for client_utils/android. It is built in dev
> builds for testing, and when building for the Android framework.
> 
> Change-Id: Ie0f425051ea370aab7861d61150a3d6007214a93
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284721
> Commit-Queue: Leon Scroggins <scroggo@google.com>
> Reviewed-by: Mike Reed <reed@google.com>
> Reviewed-by: Derek Sollenberger <djsollen@google.com>

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

Change-Id: Iaeedaed184cc35f507d5441631ae709e1c5cb1ac
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10154
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/285100
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
Commit-Queue: Joe Gregorio <jcgregorio@google.com>
2020-04-23 18:23:30 +00:00
Leon Scroggins III
513720f28e Move SkFrontBufferedStream into Android-only dir
Bug: skia:10154

Add client_utils for code that is specifically for a single client.
Move SkFrontBufferedStream into its android/ subdir. Rename the class
to android::skia::FrontBufferedStream. Temporarily leave in
SkFrontBufferedStream until Android updates to the new API.

Add a new optional target for client_utils/android. It is built in dev
builds for testing, and when building for the Android framework.

Change-Id: Ie0f425051ea370aab7861d61150a3d6007214a93
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284721
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
2020-04-23 17:02:18 +00:00
Mike Reed
7d45a7ac9c rm unneeded SK_SUPPORT_LEGACY_DIDCONCAT44
Change-Id: I65cec59749f0e7f5fb13675293720afecffa6a80
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284321
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-04-20 20:44:35 +00:00
Mike Reed
14f62de958 SkCamera.h is deprecated
Change-Id: I57bd99f2bddb7ac182f7830245c9d342d2adda62
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/283430
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Heather Miller <hcm@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-04-14 16:15:14 +00:00
Mike Reed
7fe6ee30c4 Add markCTM(id) api, to replace functionality of saveCamera.
Will need followups on Vertices and SkSL to use these handles.

Change-Id: If775cb01168f601541e889bfa2421129e505b4a4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/282416
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-04-09 17:07:36 +00:00
Mike Reed
a735ad98db stage changing didCocnat44 virtual
SK_SUPPORT_LEGACY_DIDCONCAT44

Change-Id: Ie208c245d7121fddc693a7d3c5d6866441c27433
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281864
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-04-07 15:50:57 +00:00
Mike Reed
2f92c93dc7 virtual for saveCamera
Change-Id: Iff486ae8dbf94971cfd513954299e2635c13ef1e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281585
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-04-06 21:31:47 +00:00
Brian Osman
f5ecf51f47 Stop including SkVertices.h from so many places
Change-Id: I50c1f230803faef731b32cad7cd60b7b421678e9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281160
Auto-Submit: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-04-02 14:07:46 +00:00
Mike Reed
0f5e7581a0 can we remove these entirely?
Change-Id: I3dbf9c25e6e0025cc1686789a089420ebce72bbd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/280191
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-04-01 12:13:54 +00:00
Michael Ludwig
b0cee9bf9a Remove drawBitmap et al. from SkDevice
SkCanvas keeps its non-exotic drawBitmap calls for now but they
immediately wrap the bitmap in SkImage::MakeFromBitmap. This will
add a copy for mutable bitmaps, but this can be worked around by using
images directly (preferred), or marking the bitmap as immutable. In
practice, mutable bitmaps do not seem to be widely used so this is
deemed acceptable for now.

Several GMs are updated to mark the bitmaps as immutable in order to
avoid pixel churn in how CPU vs. GPU mipmaps are generated. As we move
towards explicit mipmap generation, this distinction will become less
critical, so I'm just avoiding it for now. See skbug.com/9337 for mipmap
proposal. The image diffs encountered in this CL directly related to
generating mipmaps for bitmaps already cached on the GPU vs. not on the
GPU yet.

It was decided to copy if mutable vs. never copying the bitmap because
it preserves the image guarantees the devices and canvas' rely on,
and imposing the need to inspect an image for mutability is undesired.

Bug: skia:10037, skia:9337
Change-Id: If152e6cae1e155ccf6bd2cd755895f3c7a0135a5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276004
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-03-12 15:28:00 +00:00
Mike Reed
fdf94044ff Remove exotic legacy bitmap drawing entry points: Nine, Lattice
follow-ups:
- remove associated virtuals in canvas

Change-Id: I3efa7a88ed0905ebf080712993e7f43148df36dc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276282
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-03-11 13:11:47 +00:00
Mike Reed
121c2afb99 clipShader -- raster implementation
1. pass shader+op down to device
2. bitmapdevice pass it down to rasterclip
3. rasterclip only ever stores at most one shader
   - if there is a ctm, fold that into (another) shader
   - if the op is difference, invert the sense of alpha
   - if there was a previous shader, compose with it
4. pass through to rasterpipelineblitter
5. it prepends the colorPipeline with the clipShader, and stashes its
   results in a buffer (fClipShaderBuffer)
6. in each blit, scale/lerp from the buffer before storing the result

Change-Id: I07c7a8a20b9ae95cdcc9954237d115e63819f7c1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275798
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2020-03-10 18:43:21 +00:00
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