Commit Graph

51 Commits

Author SHA1 Message Date
Ben Wagner
7ecc59610d Remove SkAutoTDeleteArray
This class is already just an alias for std::unique_ptr<T[]>, so replace
all uses with that and delete the class.

CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Debug-ASAN-Trybot,Test-Ubuntu-Clang-Golo-GPU-GT610-x86_64-Debug-ASAN-Trybot

Change-Id: I40668d398356a22da071ee791666c7f728b59266
Reviewed-on: https://skia-review.googlesource.com/4362
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2016-11-02 21:30:38 +00:00
bungeman
01a16992cc Simplify embeddability test.
There is no reason to read the whole OS/2 table, and no need to spell
out the full names of all the types over and over.

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2256783002

Review-Url: https://codereview.chromium.org/2256783002
2016-08-19 08:45:37 -07:00
bungeman
4f81caf169 Move FamilyClass and Panose enums to enum class.
The IBMFamilyClass and Panose structures are obvious candidates
for simplification now that it is no longer necessary to nest
enums inside structs to avoid name clashes.

Review-Url: https://codereview.chromium.org/2253543004
2016-08-17 10:59:30 -07:00
bungeman
8fd23a86d0 Remove SkPreprocessorSeq.h and SkTypedEnum.h.
These were added to allow the use of typed enums before typed enums were
available on all platforms. Now that typed enums are available, just use
them directly.

Review-Url: https://codereview.chromium.org/2254513002
2016-08-16 12:27:49 -07:00
Ben Wagner
4bcb4c7a25 Make SkOTTable_name.cpp UTF-8.
When editing on Windows this file became iso-8859-1.
2016-07-19 16:10:56 -04:00
mtklein
18300a3aa7 detach -> release
The C++ standard library uses the name "release" for the operation we call "detach".

Rewriting each "detach(" to "release(" brings us a step closer to using standard library types directly (e.g. std::unique_ptr instead of SkAutoTDelete).

This was a fairly blind transformation.  There may have been unintentional conversions in here, but it's probably for the best to have everything uniformly say "release".

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1809733002

Review URL: https://codereview.chromium.org/1809733002
2016-03-16 13:53:35 -07:00
reed
fde05114e6 Make sp variants for SkData
Review URL: https://codereview.chromium.org/1779263003
2016-03-11 13:02:28 -08:00
bungeman
d7dc76f7e9 Remove version checks for _MSC_VER < 1800 (msvs2013).
We already actively do not support older versions of the vc++
compiler and runtime, so don't check for them anymore.

TBR=reed
No API changes.

GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1777213003

Review URL: https://codereview.chromium.org/1777213003
2016-03-10 11:14:40 -08:00
halcanary
96fcdcc219 Style Change: NULL->nullptr
DOCS_PREVIEW= https://skia.org/?cl=1316233002

Review URL: https://codereview.chromium.org/1316233002
2015-08-27 07:41:16 -07:00
bungeman
99fe822606 Use static_assert instead of SK_COMPILE_ASSERT.
Now that static_assert is allowed, there is no need to use a non-
standard compile time assertion

Review URL: https://codereview.chromium.org/1306443004
2015-08-20 07:57:52 -07:00
bungeman
f3c15b7cfc Move SkTemplates.h to private.
SkTemplates.h contains a number of Skia specific utilities which are
not designed for external use. In addition to reducing the external
support burden, this will allow Skia to freely refactor this file.

Review URL: https://codereview.chromium.org/1272293004
2015-08-19 11:56:48 -07:00
mtklein
36352bf5e3 C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla}
NOPRESUBMIT=true

BUG=skia:
DOCS_PREVIEW= https://skia.org/?cl=1037793002

Review URL: https://codereview.chromium.org/1037793002
2015-03-25 18:17:32 -07:00
bungeman
5f213d9627 SkTypeface to use SkStreamAsset.
SkTypeface already requires typeface streams to support SkStreamAsset
in practice, and in practice all users are already supplying them.

Review URL: https://codereview.chromium.org/869763002
2015-01-27 05:39:10 -08:00
scroggo
a1193e4b0e Make SkStream *not* ref counted.
SkStream is a stateful object, so it does not make sense for it to have
multiple owners. Make SkStream inherit directly from SkNoncopyable.

Update methods which previously called SkStream::ref() (e.g.
SkImageDecoder::buildTileIndex() and SkFrontBufferedStream::Create(),
which required the existing owners to call SkStream::unref()) to take
ownership of their SkStream parameters and delete when done (including
on failure).

Switch all SkAutoTUnref<SkStream>s to SkAutoTDelete<SkStream>s. In some
cases this means heap allocating streams that were previously stack
allocated.

Respect ownership rules of SkTypeface::CreateFromStream() and
SkImageDecoder::buildTileIndex().

Update the comments for exceptional methods which do not affect the
ownership of their SkStream parameters (e.g.
SkPicture::CreateFromStream() and SkTypeface::Deserialize()) to be
explicit about ownership.

Remove test_stream_life, which tested that buildTileIndex() behaved
correctly when SkStream was a ref counted object. The test does not
make sense now that it is not.

In SkPDFStream, remove the SkMemoryStream member. Instead of using it,
create a new SkMemoryStream to pass to fDataStream (which is now an
SkAutoTDelete).

Make other pdf rasterizers behave like SkPDFDocumentToBitmap.

SkPDFDocumentToBitmap delete the SkStream, so do the same in the
following pdf rasterizers:

SkPopplerRasterizePDF
SkNativeRasterizePDF
SkNoRasterizePDF

Requires a change to Android, which currently treats SkStreams as ref
counted objects.

Review URL: https://codereview.chromium.org/849103004
2015-01-21 12:09:53 -08:00
mtklein
72c9faab45 Fix up all the easy virtual ... SK_OVERRIDE cases.
This fixes every case where virtual and SK_OVERRIDE were on the same line,
which should be the bulk of cases.  We'll have to manually clean up the rest
over time unless I level up in regexes.

for f in (find . -type f); perl -p -i -e 's/virtual (.*)SK_OVERRIDE/\1SK_OVERRIDE/g' $f; end

BUG=skia:

Review URL: https://codereview.chromium.org/806653007
2015-01-09 10:06:40 -08:00
bsalomon
ef3fcd877a More win64 warning fixes
Review URL: https://codereview.chromium.org/798723002
2014-12-12 08:51:39 -08:00
reed
33a30503d7 SkData can allocate room for its contents in the same block
BUG=skia:
R=bungeman@google.com, mtklein@google.com

Author: reed@google.com

Review URL: https://codereview.chromium.org/560653004
2014-09-11 08:42:36 -07:00
bungeman
0a25b2ccf8 Correct order for alignment in name iterator record.
We must be quite careful about the order of fields in a 'pragma pack(1)'.
On Android the order 'uint16_t, void*' will misalign the pointer,
potentially leading to a crash.

In the future we should move anything which is not strictly part of the
table definition outside of the packed region.

R=mtklein@google.com

Author: bungeman@google.com

Review URL: https://codereview.chromium.org/474313002
2014-08-18 08:07:44 -07:00
bungeman
9d3cdb6886 Fix some issues with sfnt maxp headers.
The TT version was missing the second to last member,
and the names of the asserts in the CFF version were wrong.

R=mtklein@google.com

Author: bungeman@google.com

Review URL: https://codereview.chromium.org/390203003
2014-07-15 20:01:56 -07:00
bungeman
740c3f17f7 Better rendering detection with DirectWrite.
When requesting embedded bitmaps, all sizes in a gridfit gasp range with a
bitmap in that range should be gridfit to the fullest extent possible.

R=eae@chromium.org, reed@google.com, mtklein@google.com

Author: bungeman@google.com

Review URL: https://codereview.chromium.org/341343002
2014-06-23 08:29:23 -07:00
bungeman@google.com
058670b1e5 Add support for kEmbeddedBitmapText_Flag to DirectWrite.
R=reed@google.com

Review URL: https://codereview.chromium.org/263503004

git-svn-id: http://skia.googlecode.com/svn/trunk@14518 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-05-01 20:39:14 +00:00
commit-bot@chromium.org
f117781362 fix size_t/int warnings
BUG=skia:
R=mtklein@google.com

Author: reed@google.com

Review URL: https://codereview.chromium.org/247753003

git-svn-id: http://skia.googlecode.com/svn/trunk@14332 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-04-23 19:19:44 +00:00
commit-bot@chromium.org
d48ad8e333 Fold SkTSetBit into SkOTSet*Bit.
BUG=b/13729420
R=bungeman@google.com, mtklein@google.com, bsalomon@google.com, reed@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/219023011

git-svn-id: http://skia.googlecode.com/svn/trunk@14009 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-04-01 16:11:53 +00:00
bungeman@google.com
562b2e67a2 Fix (1 << 31) to (1u << 31) in SkOTTable_OS_2.
When ints are 32 bits, (1 << 31) is undefined.

R=reed@google.com

Committed: https://code.google.com/p/skia/source/detail?r=13757

Review URL: https://codereview.chromium.org/189093020

git-svn-id: http://skia.googlecode.com/svn/trunk@13779 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-03-12 21:41:06 +00:00
bungeman@google.com
ad07e69d4c Revert the rest of r13757.
git-svn-id: http://skia.googlecode.com/svn/trunk@13759 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-03-12 04:00:25 +00:00
bungeman@google.com
e60ae2eca3 Revert 13757.
git-svn-id: http://skia.googlecode.com/svn/trunk@13758 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-03-12 03:46:48 +00:00
bungeman@google.com
3258a5348b Fix (1 << 31) to (1u << 31) in SkOTTable_OS_2.
When ints are 32 bits, (1 << 31) is undefined.

R=reed@google.com

Review URL: https://codereview.chromium.org/189093020

git-svn-id: http://skia.googlecode.com/svn/trunk@13757 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-03-12 03:13:48 +00:00
bungeman@google.com
b3d154de5e Remove SK_FONTHOST_USES_FONTMGR.
Review URL: https://codereview.chromium.org/66783003

git-svn-id: http://skia.googlecode.com/svn/trunk@12217 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-11-11 15:53:29 +00:00
mtklein@google.com
1e4c4fea11 We always read out of bounds here. Fix that.
Turns out the comment wasn't lying!

BUG=
R=bungeman@google.com

Review URL: https://codereview.chromium.org/58473002

git-svn-id: http://skia.googlecode.com/svn/trunk@12123 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-11-04 21:22:45 +00:00
bungeman@google.com
a980269c24 Add getFamilyNames to SkTypeface.
Committed: https://code.google.com/p/skia/source/detail?r=10589

Review URL: https://codereview.chromium.org/21716005

git-svn-id: http://skia.googlecode.com/svn/trunk@10592 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-08-07 02:45:25 +00:00
jvanverth@google.com
7ca6d2f070 Reverting r10589: Add getFamilyNames to SkTypeface
git-svn-id: http://skia.googlecode.com/svn/trunk@10590 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-08-06 23:31:44 +00:00
bungeman@google.com
990d85f02b Add getFamilyNames to SkTypeface.
Review URL: https://codereview.chromium.org/21716005

git-svn-id: http://skia.googlecode.com/svn/trunk@10589 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-08-06 22:53:04 +00:00
bungeman@google.com
a3aaf16e0f Fix invalid comparison between int16 and int16be in name table code.
Review URL: https://codereview.chromium.org/21138005

git-svn-id: http://skia.googlecode.com/svn/trunk@10424 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-07-29 22:25:02 +00:00
bsalomon@google.com
20f7f173e0 One SkTSearch to rule them all. Allow key to be of different type than the array.
R=bungeman@google.com

Review URL: https://codereview.chromium.org/15070011

git-svn-id: http://skia.googlecode.com/svn/trunk@9182 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-05-17 19:05:03 +00:00
skia.committer@gmail.com
2b34fe01d7 Sanitizing source files in Housekeeper-Nightly
git-svn-id: http://skia.googlecode.com/svn/trunk@9051 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-05-08 07:01:40 +00:00
commit-bot@chromium.org
b5e34e22aa XPS ttc handling.
R=reed@google.com

Author: bungeman@google.com

Review URL: https://chromiumcodereview.appspot.com/14873006

git-svn-id: http://skia.googlecode.com/svn/trunk@9037 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-05-07 15:28:15 +00:00
skia.committer@gmail.com
041e2dbc06 Sanitizing source files in Skia_Periodic_House_Keeping
git-svn-id: http://skia.googlecode.com/svn/trunk@8503 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-04-03 07:01:14 +00:00
bungeman@google.com
5df74346b9 Fix clang warning as error from 8480.
git-svn-id: http://skia.googlecode.com/svn/trunk@8482 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-04-02 14:40:44 +00:00
bungeman@google.com
07a69f848c Name table iterator.
https://codereview.appspot.com/8180043/


git-svn-id: http://skia.googlecode.com/svn/trunk@8480 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-04-02 14:12:38 +00:00
humper@google.com
0e51577a14 fix warning from scalar --> int32 conversion
BUG=

Review URL: https://codereview.appspot.com/7065050

git-svn-id: http://skia.googlecode.com/svn/trunk@7061 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-01-07 19:54:40 +00:00
bungeman@google.com
e26f2dd41a The short version of the 'loca' table stores offsets divided by 2.
git-svn-id: http://skia.googlecode.com/svn/trunk@6657 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-12-03 22:45:10 +00:00
skia.committer@gmail.com
b0a327e939 Sanitizing source files in Skia_Periodic_House_Keeping
git-svn-id: http://skia.googlecode.com/svn/trunk@6521 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-11-21 02:02:25 +00:00
bungeman@google.com
a544f29496 Additional OpenType tables.
https://codereview.appspot.com/6850075/


git-svn-id: http://skia.googlecode.com/svn/trunk@6509 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-11-20 18:52:23 +00:00
bungeman@google.com
caa3a3beb6 When looking for the head table directory entry, compare against the current entry and not the name table entry.
git-svn-id: http://skia.googlecode.com/svn/trunk@6368 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-11-09 17:07:42 +00:00
george@mozilla.com
7c207e7435 Explicitly cast to uin16_t to avoid an invalid implicit type narrowing.
This was causing a build failure on OS X for us:

SkOTTable_head.h:124:72: error: non-type template argument evaluates to -2, which cannot be narrowed to type 'uint16_t' (aka 'unsigned short') [-Wc++11-narrowing]

Review URL: https://codereview.appspot.com/6482067

git-svn-id: http://skia.googlecode.com/svn/trunk@5290 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-08-27 19:31:10 +00:00
rmistry@google.com
d6176b0dca Result of running tools/sanitize_source_files.py (which was added in https://codereview.appspot.com/6465078/)
This CL is part II of IV (I broke down the 1280 files into 4 CLs).
Review URL: https://codereview.appspot.com/6474054

git-svn-id: http://skia.googlecode.com/svn/trunk@5263 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-08-23 18:14:13 +00:00
bungeman@google.com
ec95a4ae45 Remove multi-byte character constants.
http://codereview.appspot.com/6305117/


git-svn-id: http://skia.googlecode.com/svn/trunk@4317 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-06-25 14:26:48 +00:00
bungeman@google.com
e9678a21ed Fix obviously disallowed copy that Visual Studio allows.
git-svn-id: http://skia.googlecode.com/svn/trunk@4002 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-05-18 19:12:21 +00:00
bungeman@google.com
a550199c6f CreateTypefaceFromStream for GDI.
http://codereview.appspot.com/5616047/


git-svn-id: http://skia.googlecode.com/svn/trunk@4001 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-05-18 19:06:41 +00:00
bungeman@google.com
8ec9956bdf Add more TT table definitions and create fake enum typedef.
git-svn-id: http://skia.googlecode.com/svn/trunk@3150 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-02-07 21:30:21 +00:00