Commit Graph

197 Commits

Author SHA1 Message Date
Julia Lavrova
69f3cab837 Changing the way we select a grapheme
Selecting only graphemes that are fully inside the
[start:end) range. Hopefully, it's a temporary
solution to simplify SkParagraph vs TxtLib comparison.

Change-Id: Iebc74fb4ae20c232bfae762a04e45f0979cf6236
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/322438
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-10-08 19:02:12 +00:00
Harry Terkelsen
223ffcdff9 Add more paragraph bindings to CanvasKit
Change-Id: Ib02b6504724e4d7cfa197a3508f8c0b84b4135bf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/313146
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Yegor Jbanov <yjbanov@google.com>
Auto-Submit: Harry Terkelsen <het@google.com>
2020-10-04 12:56:57 +00:00
Jason Simmons
1a47d891c1 Add an API for clearing the SkParagraph font and paragraph caches
Change-Id: Id8de439c8d872a6dad56acb5db4153186a9a9d96
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/320397
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Jason Simmons <jsimmons@google.com>
2020-09-29 19:56:08 +00:00
Julia Lavrova
b6b7fffc35 Reland "Removing ICU dependencies from skparagraph BUILD.gn file"
This reverts commit 05ce2817f2.

Reason for revert: Fixing the build

Original change's description:
> Revert "Removing ICU dependencies from skparagraph BUILD.gn file"
>
> This reverts commit f1711adb1a.
>
> Reason for revert: Build break
>
> Original change's description:
> > Removing ICU dependencies from skparagraph BUILD.gn file
> >
> > (and from the sources, too)
> >
> > Change-Id: I9d8ff51c91aad4b770b1f183c04734d31252b851
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/313148
> > Commit-Queue: Julia Lavrova <jlavrova@google.com>
> > Reviewed-by: Ben Wagner <bungeman@google.com>
>
> TBR=bungeman@google.com,jlavrova@google.com
>
> Change-Id: I1fce2436855e3e2a4cb7d1d7204b3ae49fd530e8
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/314540
> Reviewed-by: Julia Lavrova <jlavrova@google.com>
> Commit-Queue: Julia Lavrova <jlavrova@google.com>

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

Change-Id: I13d78d75698df47930adc2514d1328abc556a209
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316444
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-09-11 18:31:24 +00:00
Julia Lavrova
0f64e0dfd8 An attempt to make font resolution more predictable.
In case the default font family is not there.
Bug: skia:10701

Change-Id: Ie1155d820bfcc25870bedcd0310b0e779d55e942
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316087
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-09-10 20:35:11 +00:00
Julia Lavrova
9bfe92a39d Fixing a bug (reusing wrong formatting state)
Bug: skia:10702
Change-Id: I2b7814917bb1f2a729f231db6df6f010a7ec1abb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/315654
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-09-08 20:17:06 +00:00
Julia Lavrova
c0d3495e1e Return to save/translate/restore for drawing via SkPicture
Can't really cache (x, y) in the picture - it's coming from the paint

Change-Id: I4ff9abe19dcd5394b40af427dfab03e8c38fba0e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/315648
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-09-08 18:35:12 +00:00
Julia Lavrova
b6030fb2c8 Direct paint by default; remove save/translate/restore
Change-Id: Ic0c85d106012374ae5c467edd3a43a93ff2b57d2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/315603
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-09-08 17:27:35 +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
Julia Lavrova
05ce2817f2 Revert "Removing ICU dependencies from skparagraph BUILD.gn file"
This reverts commit f1711adb1a.

Reason for revert: Build break

Original change's description:
> Removing ICU dependencies from skparagraph BUILD.gn file
> 
> (and from the sources, too)
> 
> Change-Id: I9d8ff51c91aad4b770b1f183c04734d31252b851
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/313148
> Commit-Queue: Julia Lavrova <jlavrova@google.com>
> Reviewed-by: Ben Wagner <bungeman@google.com>

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

Change-Id: I1fce2436855e3e2a4cb7d1d7204b3ae49fd530e8
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/314540
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-09-01 20:51:33 +00:00
Julia Lavrova
f1711adb1a Removing ICU dependencies from skparagraph BUILD.gn file
(and from the sources, too)

Change-Id: I9d8ff51c91aad4b770b1f183c04734d31252b851
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/313148
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2020-09-01 20:35:34 +00:00
Julia Lavrova
1798f4f35c Reland "Reland "ICU: SkShaper (bidi iterator only)""
This reverts commit 03cde5f999.

Reason for revert: Fixing the build

Original change's description:
> Revert "Reland "ICU: SkShaper (bidi iterator only)""
>
> This reverts commit 7bc5542a9e.
>
> Reason for revert: breaking Android roll
>
> Original change's description:
> > Reland "ICU: SkShaper (bidi iterator only)"
> >
> > This reverts commit 73f003acfd.
> >
> > Reason for revert: Fixed the build
> >
> > Original change's description:
> > > Revert "ICU: SkShaper (bidi iterator only)"
> > >
> > > This reverts commit 64e3d040e9.
> > >
> > > Reason for revert: Breaking google3
> > >
> > > Original change's description:
> > > > ICU: SkShaper (bidi iterator only)
> > > >
> > > > Change-Id: I845cc0a962790ce37600f943473f21f619ee029b
> > > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/308508
> > > > Reviewed-by: Ben Wagner <bungeman@google.com>
> > > > Commit-Queue: Julia Lavrova <jlavrova@google.com>
> > >
> > > TBR=djsollen@google.com,bungeman@google.com,reed@google.com,jlavrova@google.com
> > >
> > > Change-Id: Ib081d97f61e57f74bb9414b3973cca640f3b3929
> > > No-Presubmit: true
> > > No-Tree-Checks: true
> > > No-Try: true
> > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/309442
> > > Reviewed-by: Julia Lavrova <jlavrova@google.com>
> > > Commit-Queue: Julia Lavrova <jlavrova@google.com>
> >
> > TBR=djsollen@google.com,bungeman@google.com,reed@google.com,jlavrova@google.com
> >
> > Change-Id: I2d9c79deaaac97d3e0eb9b39ec9d53815fdb1f59
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/310757
> > Reviewed-by: Ben Wagner <bungeman@google.com>
> > Commit-Queue: Julia Lavrova <jlavrova@google.com>
>
> TBR=bungeman@google.com,jlavrova@google.com
>
> Change-Id: I89e80462edf8e014d7ea273885feeca17748a63a
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/313378
> Reviewed-by: Derek Sollenberger <djsollen@google.com>
> Commit-Queue: Derek Sollenberger <djsollen@google.com>

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

Change-Id: Idce514c64309e7463fa23425d10f1b13dd9c8d18
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/313407
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-08-26 17:46:33 +00:00
Derek Sollenberger
03cde5f999 Revert "Reland "ICU: SkShaper (bidi iterator only)""
This reverts commit 7bc5542a9e.

Reason for revert: breaking Android roll

Original change's description:
> Reland "ICU: SkShaper (bidi iterator only)"
> 
> This reverts commit 73f003acfd.
> 
> Reason for revert: Fixed the build
> 
> Original change's description:
> > Revert "ICU: SkShaper (bidi iterator only)"
> >
> > This reverts commit 64e3d040e9.
> >
> > Reason for revert: Breaking google3
> >
> > Original change's description:
> > > ICU: SkShaper (bidi iterator only)
> > >
> > > Change-Id: I845cc0a962790ce37600f943473f21f619ee029b
> > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/308508
> > > Reviewed-by: Ben Wagner <bungeman@google.com>
> > > Commit-Queue: Julia Lavrova <jlavrova@google.com>
> >
> > TBR=djsollen@google.com,bungeman@google.com,reed@google.com,jlavrova@google.com
> >
> > Change-Id: Ib081d97f61e57f74bb9414b3973cca640f3b3929
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/309442
> > Reviewed-by: Julia Lavrova <jlavrova@google.com>
> > Commit-Queue: Julia Lavrova <jlavrova@google.com>
> 
> TBR=djsollen@google.com,bungeman@google.com,reed@google.com,jlavrova@google.com
> 
> Change-Id: I2d9c79deaaac97d3e0eb9b39ec9d53815fdb1f59
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/310757
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Commit-Queue: Julia Lavrova <jlavrova@google.com>

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

Change-Id: I89e80462edf8e014d7ea273885feeca17748a63a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/313378
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
2020-08-26 13:09:15 +00:00
Julia Lavrova
7bc5542a9e Reland "ICU: SkShaper (bidi iterator only)"
This reverts commit 73f003acfd.

Reason for revert: Fixed the build

Original change's description:
> Revert "ICU: SkShaper (bidi iterator only)"
>
> This reverts commit 64e3d040e9.
>
> Reason for revert: Breaking google3
>
> Original change's description:
> > ICU: SkShaper (bidi iterator only)
> >
> > Change-Id: I845cc0a962790ce37600f943473f21f619ee029b
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/308508
> > Reviewed-by: Ben Wagner <bungeman@google.com>
> > Commit-Queue: Julia Lavrova <jlavrova@google.com>
>
> TBR=djsollen@google.com,bungeman@google.com,reed@google.com,jlavrova@google.com
>
> Change-Id: Ib081d97f61e57f74bb9414b3973cca640f3b3929
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/309442
> Reviewed-by: Julia Lavrova <jlavrova@google.com>
> Commit-Queue: Julia Lavrova <jlavrova@google.com>

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

Change-Id: I2d9c79deaaac97d3e0eb9b39ec9d53815fdb1f59
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/310757
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-08-25 18:22:52 +00:00
Mike Reed
92f6eb1602 use pathbuilder
Change-Id: I2bca419a3273a9cc8a984b0f4159f518968c6652
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/313077
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-08-25 16:29:48 +00:00
Mike Reed
457c6ddff0 remove unused enums for picture-recorder
Change-Id: I43e74a56d0aa68260ac9a9020a06a308ad75f694
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/312248
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2020-08-21 21:20:40 +00:00
Julia Lavrova
d279cee2f2 Fixing incorrect boundaries calculations + 3 ways of drawing a paragraph
Bug: skia:10620
Change-Id: I70086013130b23435d4e7c5ba375731760deb174
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/311447
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-08-20 18:47:42 +00:00
John Stiles
a008b0fa8b Enable ClangTidy check readability-redundant-smartptr-get.
To my surprise, this even works with homegrown smart pointers (such as
SkTLazy).

https://clang.llvm.org/extra/clang-tidy/checks/readability-redundant-smartptr-get.html

Find and remove redundant calls to smart pointer’s .get() method.

Examples:

  ptr.get()->Foo()  ==>  ptr->Foo()
  *ptr.get()  ==>  *ptr
  *ptr->get()  ==>  **ptr
  if (ptr.get() == nullptr) ... => if (ptr == nullptr) ...

Change-Id: I8ff541e0229656b4d8e875c8053a7e6138302547
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/310976
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-08-16 15:56:48 +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
Julia Lavrova
73f003acfd Revert "ICU: SkShaper (bidi iterator only)"
This reverts commit 64e3d040e9.

Reason for revert: Breaking google3

Original change's description:
> ICU: SkShaper (bidi iterator only)
> 
> Change-Id: I845cc0a962790ce37600f943473f21f619ee029b
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/308508
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Commit-Queue: Julia Lavrova <jlavrova@google.com>

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

Change-Id: Ib081d97f61e57f74bb9414b3973cca640f3b3929
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/309442
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-08-11 21:06:10 +00:00
Julia Lavrova
64e3d040e9 ICU: SkShaper (bidi iterator only)
Change-Id: I845cc0a962790ce37600f943473f21f619ee029b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/308508
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-08-11 19:58:08 +00:00
John Stiles
31954bf23f Enable ClangTidy check performance-unnecessary-copy-initialization.
https://clang.llvm.org/extra/clang-tidy/checks/performance-unnecessary-copy-initialization.html

Finds local variable declarations that are initialized using the copy
constructor of a non-trivially-copyable type but it would suffice to
obtain a const reference.

The check is only applied if it is safe to replace the copy by a const
reference. This is the case when the variable is const qualified or when
it is only used as a const, i.e. only const methods or operators are
invoked on it, or it is used as const reference or value argument in
constructors or function calls.

Change-Id: I1261410deccd8ea64e85edec53fbd5360940e587
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/308759
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-08-07 22:20:36 +00:00
John Stiles
a6841be235 Enable ClangTidy check llvm-namespace-comment.
This fixes a large number of SkSL namespaces which were labeled as if
they were anonymous, and also a handful of other mislabeled namespaces.
Missing namespace-end comments have been added throughout.
A number of diffs are just indentation-related (adjusting 1- or 3-
space indents to 2-space).

Change-Id: I6c62052a0d3aea4ae12ca07e0c2a8587b2fce4ec
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/308503
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-08-06 19:07:52 +00:00
Julia Lavrova
093263ce45 Remove SK_PARAGRAPH_OLD_SPACE_RESOLUTION (staging changes done)
Change-Id: Ia67eb9055cb589c1ff73b5ac851a2c7b538c2575
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/307790
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-08-04 19:35:38 +00:00
Julia Lavrova
2aa72457ba Chromium Project Code Inclusion
Change-Id: Iac6a1ca7131c74f297ee047e0e3841740e24e18b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/307703
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
2020-08-04 15:50:46 +00:00
John Stiles
fbd050bd0b Enable ClangTidy check modernize-make-unique.
The majority of existing call sites were automatically updated using
clang-tidy -fix. A small handful required a manual update,
e.g. CppCodeGen.

This check is a bit lenient, and in particular will not flag cases like
`std::unique_ptr<Base>(new Derived())` which is still pretty common
throughout our codebase. This CL does not attempt to replace all the
cases that ClangTidy does not flag.

Change-Id: I5eba48ef880e25d22de80f321a68c389ba769e36
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/307459
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-08-03 17:53:52 +00:00
Julia Lavrova
3d404beb7c Reland "Attach whitespaces to the neighbor unresolved blocks"
This reverts commit 143646297e.

Reason for revert: Have to fix it and reland again

Original change's description:
> Revert "Attach whitespaces to the neighbor unresolved blocks"
>
> This reverts commit 131c5ad6f1.
>
> Reason for revert: Blocking the G3 roll
>
> Original change's description:
> > Attach whitespaces to the neighbor unresolved blocks
> >
> > Fix the situation when an unresolved {arabic} text is broken into
> > many small runs by resolved english spaces.
> >
> > Bug: skia:10487
> > Change-Id: I3a739501c0fb7e0fc845e68392e1d214df9302db
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304000
> > Commit-Queue: Julia Lavrova <jlavrova@google.com>
> > Reviewed-by: Ben Wagner <bungeman@google.com>
>
> TBR=bungeman@google.com,jlavrova@google.com
>
> Change-Id: Iaa338dd5fb5c9962df2ee32bafbc089da0e2b8a1
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:10487
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/305797
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

TBR=bungeman@google.com,robertphillips@google.com,jlavrova@google.com

Bug: skia:10487
Change-Id: If8a85254fd536f465d80766de0406053d90c96a3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/306062
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-07-28 17:19:21 +00:00
John Stiles
059ed6749d Update types in TextStyle to use member initialization syntax.
While doing a refactor, Clang issued some warnings about having copy-
constructors without assignment operators in some TextStyle classes.
Rewrote the code to minimize custom constructor/copy/assignment methods,
favoring C++11 member initialization syntax instead.

Change-Id: I4f0361ce38d4b0ada346b0ede4fcad4e2b686d67
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/305959
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-07-27 20:53:15 +00:00
John Stiles
c88a6ac43d Add missing #includes for referenced types.
These missing includes were discovered when attempting a refactor.

Change-Id: I8aad5610de2337de6e55885b5868e606c1514eaf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/305997
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-07-27 14:06:31 +00:00
Robert Phillips
143646297e Revert "Attach whitespaces to the neighbor unresolved blocks"
This reverts commit 131c5ad6f1.

Reason for revert: Blocking the G3 roll

Original change's description:
> Attach whitespaces to the neighbor unresolved blocks
> 
> Fix the situation when an unresolved {arabic} text is broken into
> many small runs by resolved english spaces.
> 
> Bug: skia:10487
> Change-Id: I3a739501c0fb7e0fc845e68392e1d214df9302db
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304000
> Commit-Queue: Julia Lavrova <jlavrova@google.com>
> Reviewed-by: Ben Wagner <bungeman@google.com>

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

Change-Id: Iaa338dd5fb5c9962df2ee32bafbc089da0e2b8a1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10487
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/305797
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-07-24 19:48:22 +00:00
Julia Lavrova
131c5ad6f1 Attach whitespaces to the neighbor unresolved blocks
Fix the situation when an unresolved {arabic} text is broken into
many small runs by resolved english spaces.

Bug: skia:10487
Change-Id: I3a739501c0fb7e0fc845e68392e1d214df9302db
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304000
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2020-07-24 18:21:49 +00:00
Julia Lavrova
90787fefef Reland #3 "ICU API: only in SkParagraph, simplified."
This is the fix for google3 failure.
This reverts commit e36a466723.

Reason for revert: Trying to fix google3 build brake

Original change's description:
> Revert "Reland "ICU API: only in SkParagraph, simplified (relanding reverted).""
>
> This reverts commit 16fbc24772.
>
> Reason for revert: Checking to see if this is blocking the G3 roll
>
> Original change's description:
> > Reland "ICU API: only in SkParagraph, simplified (relanding reverted)."
> >
> > This reverts commit a30095d17c.
> >
> > Reason for revert: Fixing the build
> >
> > Original change's description:
> > > Revert "ICU API: only in SkParagraph, simplified (relanding reverted)."
> > >
> > > This reverts commit 7479eda3b6.
> > >
> > > Reason for revert: Breaking build
> > >
> > > Original change's description:
> > > > ICU API: only in SkParagraph, simplified (relanding reverted).
> > > >
> > > > Reverted commit: https://skia-review.googlesource.com/c/skia/+/296128/
> > > >
> > > > Change-Id: Iaf793bff94a6060579c7d6176d477e598c047be6
> > > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303261
> > > > Reviewed-by: Mike Reed <reed@google.com>
> > > > Commit-Queue: Julia Lavrova <jlavrova@google.com>
> > >
> > > TBR=reed@google.com,jlavrova@google.com
> > >
> > > Change-Id: Idd4c41e22aa59e24bdbd07f2fa5e9258c1bbb7a7
> > > No-Presubmit: true
> > > No-Tree-Checks: true
> > > No-Try: true
> > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303358
> > > Reviewed-by: Julia Lavrova <jlavrova@google.com>
> > > Commit-Queue: Julia Lavrova <jlavrova@google.com>
> >
> > TBR=reed@google.com,jlavrova@google.com
> >
> > Change-Id: Iea5da4535ea2e388e8e632e6c556b66c8781631a
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303377
> > Reviewed-by: Ben Wagner <bungeman@google.com>
> > Reviewed-by: Julia Lavrova <jlavrova@google.com>
> > Commit-Queue: Julia Lavrova <jlavrova@google.com>
>
> TBR=bungeman@google.com,reed@google.com,jlavrova@google.com
>
> Change-Id: I1edfecc56add670b251adf44892265088fd32c42
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304058
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

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

Change-Id: Ife73aa21539e870d69bda6b5892979646732d778
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304060
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-07-24 13:28:52 +00:00
Brian Salomon
d007281c9a Fix clang 12 Wsuggest-override and Wsuggest-destructor-override
Change-Id: Ic44e24057b95bb014504f02a736fb4341afc8971
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304856
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-07-22 01:11:36 +00:00
Robert Phillips
e36a466723 Revert "Reland "ICU API: only in SkParagraph, simplified (relanding reverted).""
This reverts commit 16fbc24772.

Reason for revert: Checking to see if this is blocking the G3 roll

Original change's description:
> Reland "ICU API: only in SkParagraph, simplified (relanding reverted)."
> 
> This reverts commit a30095d17c.
> 
> Reason for revert: Fixing the build
> 
> Original change's description:
> > Revert "ICU API: only in SkParagraph, simplified (relanding reverted)."
> >
> > This reverts commit 7479eda3b6.
> >
> > Reason for revert: Breaking build
> >
> > Original change's description:
> > > ICU API: only in SkParagraph, simplified (relanding reverted).
> > >
> > > Reverted commit: https://skia-review.googlesource.com/c/skia/+/296128/
> > >
> > > Change-Id: Iaf793bff94a6060579c7d6176d477e598c047be6
> > > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303261
> > > Reviewed-by: Mike Reed <reed@google.com>
> > > Commit-Queue: Julia Lavrova <jlavrova@google.com>
> >
> > TBR=reed@google.com,jlavrova@google.com
> >
> > Change-Id: Idd4c41e22aa59e24bdbd07f2fa5e9258c1bbb7a7
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303358
> > Reviewed-by: Julia Lavrova <jlavrova@google.com>
> > Commit-Queue: Julia Lavrova <jlavrova@google.com>
> 
> TBR=reed@google.com,jlavrova@google.com
> 
> Change-Id: Iea5da4535ea2e388e8e632e6c556b66c8781631a
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303377
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Reviewed-by: Julia Lavrova <jlavrova@google.com>
> Commit-Queue: Julia Lavrova <jlavrova@google.com>

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

Change-Id: I1edfecc56add670b251adf44892265088fd32c42
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304058
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-07-20 16:39:15 +00:00
Julia Lavrova
16fbc24772 Reland "ICU API: only in SkParagraph, simplified (relanding reverted)."
This reverts commit a30095d17c.

Reason for revert: Fixing the build

Original change's description:
> Revert "ICU API: only in SkParagraph, simplified (relanding reverted)."
>
> This reverts commit 7479eda3b6.
>
> Reason for revert: Breaking build
>
> Original change's description:
> > ICU API: only in SkParagraph, simplified (relanding reverted).
> >
> > Reverted commit: https://skia-review.googlesource.com/c/skia/+/296128/
> >
> > Change-Id: Iaf793bff94a6060579c7d6176d477e598c047be6
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303261
> > Reviewed-by: Mike Reed <reed@google.com>
> > Commit-Queue: Julia Lavrova <jlavrova@google.com>
>
> TBR=reed@google.com,jlavrova@google.com
>
> Change-Id: Idd4c41e22aa59e24bdbd07f2fa5e9258c1bbb7a7
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303358
> Reviewed-by: Julia Lavrova <jlavrova@google.com>
> Commit-Queue: Julia Lavrova <jlavrova@google.com>

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

Change-Id: Iea5da4535ea2e388e8e632e6c556b66c8781631a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303377
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-07-20 15:26:31 +00:00
Julia Lavrova
a30095d17c Revert "ICU API: only in SkParagraph, simplified (relanding reverted)."
This reverts commit 7479eda3b6.

Reason for revert: Breaking build

Original change's description:
> ICU API: only in SkParagraph, simplified (relanding reverted).
> 
> Reverted commit: https://skia-review.googlesource.com/c/skia/+/296128/
> 
> Change-Id: Iaf793bff94a6060579c7d6176d477e598c047be6
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303261
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Julia Lavrova <jlavrova@google.com>

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

Change-Id: Idd4c41e22aa59e24bdbd07f2fa5e9258c1bbb7a7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303358
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-07-16 16:35:12 +00:00
Julia Lavrova
7479eda3b6 ICU API: only in SkParagraph, simplified (relanding reverted).
Reverted commit: https://skia-review.googlesource.com/c/skia/+/296128/

Change-Id: Iaf793bff94a6060579c7d6176d477e598c047be6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/303261
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-07-16 15:57:28 +00:00
Julia Lavrova
70258c79be add SkParagraph to public headers and fix warnings
Change-Id: Icb62636e96f1fecb97c4f4c918d073ab611420f3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/302900
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-07-15 17:56:43 +00:00
Julia Lavrova
196515cbd7 Line metrics: correct text width
Bug: skia:10439
Change-Id: Ic9ac1b5305fb785aceb12eab9c24d488001a91c7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301377
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-07-09 15:03:02 +00:00
Julia Lavrova
1d784c7939 TextStyle::matchOneAttribute compares backgrounds even if they don’t exist
Bug: skia:10432
Change-Id: I7e615de2dad82fc4a978574a4f2458e56a90e93f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301358
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-07-08 19:58:55 +00:00
Julia Lavrova
ce6f24d7fd Placeholders coming from flutter can have Inf sizes
Dealing with it for now; should not be allowed in the first place!

Change-Id: I52141d0543d60342c45813d35264c7ee49f1e972
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/301298
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-07-08 17:55:17 +00:00
Julia Lavrova
a6d1e98b65 Revert "ICU API: only in SkParagraph, simplified."
This reverts commit 8d639e1a42.

Reason for revert: Build break

Original change's description:
> ICU API: only in SkParagraph, simplified.
> 
> Change-Id: I4f7fbb233217cb3b7a171c91720c9c2289e28a5f
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/296128
> Commit-Queue: Julia Lavrova <jlavrova@google.com>
> Reviewed-by: Mike Reed <reed@google.com>

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

Change-Id: If41d7ebaa081837bf2615b24d9035f37cdb76081
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/300712
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-07-06 19:59:15 +00:00
Julia Lavrova
8d639e1a42 ICU API: only in SkParagraph, simplified.
Change-Id: I4f7fbb233217cb3b7a171c91720c9c2289e28a5f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/296128
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-07-06 19:13:23 +00:00
Ben Wagner
7000ccdffd Cleanup for TextLine::getGlyphPositionAtCoordinate.
Rename a few variables to make existing issues apparent. Also fix
potential divide by zero.

Change-Id: I071c4958f6eb2dcb79d34b4be95f57a4bbcb7b32
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298750
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2020-06-25 16:27:39 +00:00
Julia Lavrova
2002b863da Fixing line metrics (baseline) - de-coupled from ICU CL
Bug: skia:10347
Change-Id: I8a10f4873d88f1ecf4698cedb27efe031c7eaa51
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/297720
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2020-06-22 15:03:34 +00:00
Julia Lavrova
c4d49056b4 Cleaning codepoints/grapheme mess; it also helps with ICU API
Renamed all codepoints into utf16Index

Change-Id: Ie915395a56ac825637f6dbb25824cd1635a5b0a6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/296438
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-06-17 14:51:24 +00:00
John Stiles
30212b7941 Fix implicit fallthroughs throughout Skia.
This CL is not fully comprehensive; for instance, it does not contain
fixes for backends that don't compile on Mac. But it does resolve the
vast majority of cases that trigger -Wimplicit-fallthrough.

A few minor bugs were found and fixed, but none that were likely to
affect normal operation.

Change-Id: I43487602b0d56200ce8b42702e04f66390d82f60
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295916
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2020-06-11 22:29:53 +00:00
Mike Klein
f69e40841e move dummy onMakeFromFontData() into .cpp
It's borderline illegal to implement it there in the header with a
forward-declared SkFontData.  See also cl/314969840.

Change-Id: I81e981198014cce03fa9604aada5a383a847cfeb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295640
Reviewed-by: 🤓Vy Nguyen <vyng@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2020-06-11 00:13:15 +00:00
Julia Lavrova
f7005498d4 Keeping run metrics rather than calculating them every time
Change-Id: Ic0257859317cf46dbb90277573f184d565fdb58d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295322
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-06-10 14:05:26 +00:00
Julia Lavrova
73905c3db2 Removing fOffsets array from Run; optimizing copyTo
Change-Id: I4df661f800436ddb2b2bdb0cf19017e651332971
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/295236
Commit-Queue: Julia Lavrova <jlavrova@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-06-09 19:49:36 +00:00