Commit Graph

9 Commits

Author SHA1 Message Date
Mike Klein
f46d5ca492 use std::make_unique
Change-Id: I7c672ff6b8eb95ec8c1123a5bfdb202e1644f494
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/259281
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-12-12 22:32:45 +00:00
Mike Klein
b78729a8f3 Fix some GCC warnings.
Drop unnecessary () in `const char* (*fText)`.  Sure, whatever.

Then a couple tweaks where we use strncpy():

    In one case in SkICC.cpp, GCC warns us we're passing sizeof(dst) as
    the copy count, which can be error prone because you may miss a
    terminating nul.  I believe the existing strncpy() behavior is what
    we want here, so I've stifled this and left a note.  We don't really
    want a terminating nul... we want a zero fill of the remaining dst.

    On the other side of that if-statment in that same function, GCC
    warns that we've passed exactly sizeof(src) as the copy count when
    writing the calculated description prefix, which again might be
    buggy due to a missed terminating nul.  Seemed like memcpy() was the
    way to go here for that prefix. Ultimately we check to make sure we
    wrote every single destination byte.

    Over in SkPDFMetadata.cpp, strncpy() is concerned once again that
    we're copying strlen(src) and thus omitting the terminating nul.  As
    usual we don't want that terminating nul, so switch to memcpy() to
    make that explicit.

I'm starting to think strncpy() is too helpful to reason about sanely.

Change-Id: I1bcd5f4e406ca388c1c236c5f3ee531bf1737705
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/257408
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-12-03 16:21:40 +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
64670cb1b8 Reland "Simplify SkTypeface::charsToGlyphs API to require UTF32 input"
This is a reland of fde841de44

Original change's description:
> Simplify SkTypeface::charsToGlyphs API to require UTF32 input
> 
> Change-Id: I486713c496c40103eef13fa6068ac4d69e32f606
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/207865
> Commit-Queue: Ben Wagner <bungeman@google.com>
> Reviewed-by: Ben Wagner <bungeman@google.com>

Change-Id: I5162c93b3ea6146d09334545744b791d993397b8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/208679
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-04-17 17:56:39 +00:00
Robert Phillips
33906ad1e2 Reland "Revert "Simplify SkTypeface::charsToGlyphs API to require UTF32 input""
This reverts commit 652b007a4c.

Reason for revert: Potentially causing Google3 errors

Original change's description:
> Revert "Revert "Simplify SkTypeface::charsToGlyphs API to require UTF32 input""
> 
> with legacy guard for google3
> 
> Needs this to land first: https://critique.corp.google.com/#review/243924283
> 
> This reverts commit 70ed05e53a.
> 
> Change-Id: I3e821dfcdbf3004382092338ebad7cceaf40cefd
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/208668
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>
> Auto-Submit: Mike Reed <reed@google.com>

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

Change-Id: Id2b3ed8a6157b5e33721b0c5168c5680bfac15b0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/208669
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-04-17 12:03:53 +00:00
Mike Reed
652b007a4c Revert "Revert "Simplify SkTypeface::charsToGlyphs API to require UTF32 input""
with legacy guard for google3

Needs this to land first: https://critique.corp.google.com/#review/243924283

This reverts commit 70ed05e53a.

Change-Id: I3e821dfcdbf3004382092338ebad7cceaf40cefd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/208668
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-04-17 03:08:40 +00:00
Mike Reed
70ed05e53a Revert "Simplify SkTypeface::charsToGlyphs API to require UTF32 input"
This reverts commit fde841de44.

Reason for revert: used in headless on google3, need to add a guard

Original change's description:
> Simplify SkTypeface::charsToGlyphs API to require UTF32 input
> 
> Change-Id: I486713c496c40103eef13fa6068ac4d69e32f606
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/207865
> Commit-Queue: Ben Wagner <bungeman@google.com>
> Reviewed-by: Ben Wagner <bungeman@google.com>

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

Change-Id: I1d28ed5c31deaa76aa3c4b627454b0ad3356a6fc
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/208800
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-04-17 00:02:12 +00:00
Mike Reed
fde841de44 Simplify SkTypeface::charsToGlyphs API to require UTF32 input
Change-Id: I486713c496c40103eef13fa6068ac4d69e32f606
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/207865
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-04-16 21:34:10 +00:00
Herb Derby
2e845910be Benchmark for charToGlyph
Change-Id: Id8c7a37c62b596b9f73e331d9a3e36ccd3a51513
Reviewed-on: https://skia-review.googlesource.com/c/188461
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2019-02-04 18:03:52 +00:00