Commit Graph

18 Commits

Author SHA1 Message Date
Mike Reed
10a5ff2cac Must pass filtering to picture shader
Change-Id: I820867df80daa1594d6202cad5e8e95c060293fe
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/386838
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2021-03-18 22:18:47 +00:00
Mike Reed
039f1367ae filter-quality is deprecated, pass sampling to drawImage
Bug: skia:7650
Change-Id: Ifd92705bd042db74a6c2527858239b0b8e5a4def
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/360981
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2021-01-28 03:22:51 +00:00
John Stiles
c1c3c6d70d Enable ClangTidy flag bugprone-suspicious-string-compare.
https://clang.llvm.org/extra/clang-tidy/checks/bugprone-suspicious-string-compare.html

Find suspicious usage of runtime string comparison functions.
This check is valid in C and C++.

Checks for calls with implicit comparator and proposed to
explicitly add it:

  if (strcmp(...))       // Implicitly compare to zero
  if (!strcmp(...))      // Won't warn
  if (strcmp(...) != 0)  // Won't warn

Checks that compare function results (i,e, strcmp) are compared to valid
constant. The resulting value is

  <  0    when lower than,
  >  0    when greater than,
  == 0    when equals.

A common mistake is to compare the result to 1 or -1:

  if (strcmp(...) == -1)  // Incorrect usage of the returned value.

Additionally, the check warns if the results value is implicitly cast
to a suspicious non-integer type. It’s happening when the returned
value is used in a wrong context:

  if (strcmp(...) < 0.)  // Incorrect usage of the returned value.

Change-Id: I001b88d06cc4f3eb5846103885be675f9b78e126
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/310761
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-08-16 03:54:08 +00:00
Michael Ludwig
55edb50262 Update tests to use new image filter factories
Bug: skia:9280
Change-Id: Id8253baa6ca387b6f2f0583f29b2c25cc1005545
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230880
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-08-05 15:15:45 +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
fae8fceb4a Use SkTileMode instead of nested enum
Add guard to transition clients

Change-Id: Ia7a3e8f95722f91e84af262168dadf89a78707da
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205720
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-04-03 15:24:18 +00:00
Mike Klein
ea3f014e2b sk_tool_utils -> ToolUtils, and git clang-format
sk_tool_utils doesn't really fit the naming convention
the rest of code under tools/ tends to use.

Change-Id: I45326a174101c6eb4b6149e9c742f658f2fd23b1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/202313
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-20 18:05:42 +00:00
Hal Canary
3560ea702f drawText Cleanup, part 3
Change-Id: I17bdc317b2f22bb3d4c33785aa2163e8beb3b280
Reviewed-on: https://skia-review.googlesource.com/c/182201
Auto-Submit: Hal Canary <halcanary@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-01-09 16:07:03 +00:00
Mike Klein
ff0e8409e1 clean up some odd SkRefCnt features
SkRefCntBase is an implementation detail of SkRefCnt, so let's not
mention it in SkContext_Compute.h.  While I'm here, I notice SkNVRefCnt
would work fine too.

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

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

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

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

Change-Id: I98be06677a6e8b8e66f44cbb17d14e38b0f39d38
Reviewed-on: https://skia-review.googlesource.com/c/167160
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2018-10-31 20:47:16 +00:00
Mike Reed
32ade4cedf Deliberately call typefaceproc only once per face in pictures
Before this CL, the new test would write out 2 copies of each typeface,
since each one is referenced twice in the picture.

Bug: skia:
Change-Id: I6ebfe6b5ea0bb0cca2869ef0cccad21a51e48411
Reviewed-on: https://skia-review.googlesource.com/151667
Auto-Submit: Mike Reed <reed@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-09-05 16:45:16 +00:00
Mike Reed
d07e4a226a Change behavior of custom image serial/deserial
New behavior is to *always* call the client's deserial image proc for all data.
This allows the client to make decisions even on "std" image data like PNG.

The change also means that if there is no client deserial image proc, Skia will
still attempt to create an image from the data, even if it was written by a
custom serial proc.

Bug: skia:7706
Change-Id: Ia58bdd10b86d497f02187082c6373c029e9c8293
Reviewed-on: https://skia-review.googlesource.com/113302
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-03-08 21:50:51 +00:00
Mike Reed
47fdf6c85e add serialprocs to MultiDocument, hide redundant methods
Bug: skia:
Change-Id: I6521e93af79439bd8c1d2f5130a68492044a2ee9
Reviewed-on: https://skia-review.googlesource.com/87788
Reviewed-by: Wei Li <weili@chromium.org>
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-12-21 12:36:30 +00:00
Mike Reed
45ab630045 Revert "Revert "impl SkSerial picture procs""
This reverts commit 2a3009931d.

Implement SkSerialProcs for pictures

Bug: skia:
Change-Id: Icde2d912941a19999e204ac5213f519ed5387e12
Reviewed-on: https://skia-review.googlesource.com/84480
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-12-13 17:02:10 +00:00
Mike Reed
2a3009931d Revert "impl SkSerial picture procs"
This reverts commit c822672854.

Reason for revert: broke old skps

Original change's description:
> impl SkSerial picture procs
> 
> The picture serialization code is a bit of a mess, with duplicated functions for streams and buffers.
> Could not see how to fix that and land this at the same time, but I will try to circle back and
> simplify if possible afterwards.
> 
> Bug: skia:
> Change-Id: I9053fdc476c60f483df013d021e248258181c199
> Reviewed-on: https://skia-review.googlesource.com/83943
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Mike Reed <reed@google.com>

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

Change-Id: I68ae019a286691b65cc373cb29c941d6620fd34a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/84460
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-12-13 15:16:53 +00:00
Mike Reed
c822672854 impl SkSerial picture procs
The picture serialization code is a bit of a mess, with duplicated functions for streams and buffers.
Could not see how to fix that and land this at the same time, but I will try to circle back and
simplify if possible afterwards.

Bug: skia:
Change-Id: I9053fdc476c60f483df013d021e248258181c199
Reviewed-on: https://skia-review.googlesource.com/83943
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2017-12-13 13:41:32 +00:00
Hal Canary
c465d13e6f resources: orgainize directory.
Should make it easier to ask just for images.

Change-Id: If821743dc924c4bfbc6b2b2d29b14affde7b3afd
Reviewed-on: https://skia-review.googlesource.com/82684
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
2017-12-08 17:16:00 +00:00
Mike Reed
64f73764b7 return data instead of bool
Bug: skia:
Change-Id: Id7c3044a2fce087703544c624c75a7756b9c62b4
Reviewed-on: https://skia-review.googlesource.com/82602
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-12-08 15:58:00 +00:00
Mike Reed
60691a5127 add serial procs to pictures
Bug: skia:7380
Change-Id: Ic1b7e437316c7913711cf5cb119e3fe904cd2c05
Reviewed-on: https://skia-review.googlesource.com/76980
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-12-05 20:33:18 +00:00