Commit Graph

36 Commits

Author SHA1 Message Date
Mike Klein
0b4cc892cb Disable assertion of fBoundsIsDirty.
We allow this to be raced on, and it may have already become not-dirty by the
time we get to this function if computed by another thread.

BUG=skia:

Review URL: https://codereview.chromium.org/398913002
2014-07-16 17:18:20 -04:00
mtklein
497cda3a6b Split SkTRacy into SkTRacy and SkTRacyReffable.
Looks like TSAN can't always suppress our existing implementation of SkTRacy
(what is turning here into SkTRacyReffable).  To minimize flakiness, use
SkTRacy where possible and SkTRacyReffable where necessary.

BUG=skia:
R=robertphillips@google.com, mtklein@google.com, reed@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/388503002
2014-07-10 10:38:22 -07:00
mtklein
0b544ae222 Add SkRacy
SkRacy<T> is a zero-overhead wrapper for a T, except it also
silences race warnings when TSAN is running.

Here we apply in several classes.  In SkMatrix and SkPathRef,
we use it to opportunistically cache some idempotent work.

In SkPixelRef, we wrap the genIDs.  We think the worst that
can happen here is we'll increment the global next-genID a
few times instead of once when we go to get another ID.

BUG=skia:

Committed: https://skia.googlesource.com/skia/+/d5e3e6ae1b3434ad1158f441902ff65f1eeaa3a7

CQ_EXTRA_TRYBOTS=tryserver.skia:Canary-Chrome-Ubuntu13.10-Ninja-x86_64-ToT-Trybot,Canary-Chrome-Win7-Ninja-x86-SharedLib_ToT-Trybot,Test-Ubuntu13.10-GCE-NoGPU-x86_64-Release-TSAN-Trybot
R=reed@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/371363004
2014-07-08 19:37:47 -07:00
mtklein
d3f3e5895e Revert of Add SkRacy (https://codereview.chromium.org/371363004/)
Reason for revert:
hidden symbol 'AnnotateBenignRaceSized' in obj/base/third_party/dynamic_annotations/libdynamic_annotations.a(obj/base/third_party/dynamic_annotations/dynamic_annotations.dynamic_annotations.o) is referenced by DSO lib/libblink_platform.so

Original issue's description:
> Add SkRacy
>
> SkRacy<T> is a zero-overhead wrapper for a T, except it also
> silences race warnings when TSAN is running.
>
> Here we apply in several classes.  In SkMatrix and SkPathRef,
> we use it to opportunistically cache some idempotent work.
>
> In SkPixelRef, we wrap the genIDs.  We think the worst that
> can happen here is we'll increment the global next-genID a
> few times instead of once when we go to get another ID.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/d5e3e6ae1b3434ad1158f441902ff65f1eeaa3a7

R=reed@google.com, mtklein@chromium.org
TBR=mtklein@chromium.org, reed@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Author: mtklein@google.com

Review URL: https://codereview.chromium.org/377693005
2014-07-08 14:06:46 -07:00
mtklein
d5e3e6ae1b Add SkRacy
SkRacy<T> is a zero-overhead wrapper for a T, except it also
silences race warnings when TSAN is running.

Here we apply in several classes.  In SkMatrix and SkPathRef,
we use it to opportunistically cache some idempotent work.

In SkPixelRef, we wrap the genIDs.  We think the worst that
can happen here is we'll increment the global next-genID a
few times instead of once when we go to get another ID.

BUG=skia:
R=reed@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/371363004
2014-07-08 12:30:39 -07:00
mtklein
78358bf624 Port most uses of SkOnce to SkLazyPtr.
BUG=skia:

Committed: http://code.google.com/p/skia/source/detail?r=15006

Committed: http://code.google.com/p/skia/source/detail?r=15014

R=reed@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/304383005
2014-06-02 08:44:27 -07:00
commit-bot@chromium.org
f71e8fd0c5 Revert of Port most uses of SkOnce to SkLazyPtr. (https://codereview.chromium.org/304383005/)
Reason for revert:
linux x86-64 release segfault in src/ports/SkFontHost_fontconfig.cpp:107

http://108.170.220.120:10117/builders/Test-Ubuntu12-ShuttleA-GTX660-x86_64-Release/builds/905/steps/RunTests/logs/stdio

Original issue's description:
> Port most uses of SkOnce to SkLazyPtr.
>
> BUG=skia:
>
> Committed: http://code.google.com/p/skia/source/detail?r=15006
>
> Committed: http://code.google.com/p/skia/source/detail?r=15014

R=reed@google.com, mtklein@chromium.org
TBR=mtklein@chromium.org, reed@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Author: mtklein@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@15015 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-05-31 00:15:22 +00:00
commit-bot@chromium.org
56f7cca144 Port most uses of SkOnce to SkLazyPtr.
BUG=skia:

Committed: http://code.google.com/p/skia/source/detail?r=15006

R=reed@google.com, mtklein@google.com

Author: mtklein@chromium.org

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

git-svn-id: http://skia.googlecode.com/svn/trunk@15014 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-05-30 23:59:12 +00:00
commit-bot@chromium.org
f6351a0718 Revert of Port most uses of SkOnce to SkLazyPtr. (https://codereview.chromium.org/304383005/)
Reason for revert:
Leaking refs on SkTypeface on Macs.

Original issue's description:
> Port most uses of SkOnce to SkLazyPtr.
>
> BUG=skia:
>
> Committed: http://code.google.com/p/skia/source/detail?r=15006

R=reed@google.com, mtklein@chromium.org
TBR=mtklein@chromium.org, reed@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Author: mtklein@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@15009 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-05-30 21:00:52 +00:00
commit-bot@chromium.org
5a70945ddd Port most uses of SkOnce to SkLazyPtr.
BUG=skia:
R=reed@google.com, mtklein@google.com

Author: mtklein@chromium.org

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

git-svn-id: http://skia.googlecode.com/svn/trunk@15006 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-05-30 20:42:00 +00:00
commit-bot@chromium.org
5e1a7f2cc6 Revert of r13379 (Move fLastMoveToIndex from SkPath to SkPathRef - https://codereview.chromium.org/146913002/) due to image quality regression in Chromium. See crbug.com/343123 (Regression - UI issue observed for any "Notification infobars" in Chrome browser)
R=bsalomon@google.com
TBR=bsalomon@google.com

Author: robertphillips@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@13421 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-02-12 17:44:30 +00:00
commit-bot@chromium.org
61e96cd446 SkBitmap now really stores SkImageInfo -- config is just a ruse
BUG=skia:
R=scroggo@google.com

Author: reed@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@13411 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-02-11 18:21:45 +00:00
mike@reedtribe.org
1195a28892 Revert "SkBitmap now really stores SkImageInfo -- config is just a ruse"
BUG=skia:

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

git-svn-id: http://skia.googlecode.com/svn/trunk@13395 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-02-11 03:24:02 +00:00
skia.committer@gmail.com
8ed6443e6c Sanitizing source files in Housekeeper-Nightly
git-svn-id: http://skia.googlecode.com/svn/trunk@13393 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-02-11 03:02:13 +00:00
robertphillips@google.com
f66cf72c68 Move fLastMoveToIndex from SkPath to SkPathRef
https://codereview.chromium.org/146913002/



git-svn-id: http://skia.googlecode.com/svn/trunk@13379 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-02-10 13:51:32 +00:00
commit-bot@chromium.org
709ca75f03 SkOnce: add option to call another cleanup function once at exit.
Use this to clean up empty SkData and SkPathRef.

Current leaks:
  Leaked SkRefCntBase: 40
     Leaked SkFlattenable: 32
         Leaked SkPixelRef: 32
             Leaked SkMallocPixelRef: 32
     Leaked SkFontConfigInterface: 1
     Leaked SkWeakRefCnt: 1
         Leaked SkTypeface: 1
     Leaked SkFontMgr: 1
     Leaked SkDataTable: 3
     Leaked SkImage: 1
         Leaked ???: 1
     Leaked ???: 1

BUG=skia:
R=halcanary@google.com, reed@google.com

Author: mtklein@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@13180 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-01-24 22:38:39 +00:00
commit-bot@chromium.org
fed2ab6483 No deduping dictionaries for matrices and regions.
There's little benefit to deduping matrices and regions: they're infrequently
used, and doubly infrequently reused.  Their use-weighted byte cost is tiny.

There is some downside to deduping matrices and regions.  Even when they're not
used, we prepare dictionaries for deduping them for every picture.  Each of
these dictionaries costs 160 bytes, so two unused dictionaries make a big chunk
of the ~1100 bytes it takes to allocate an SkPictureRecord. (~330 come from
parent class SkCanvas, 768 from SkPictureRecord itself, here reduced to 448).

One side benefit of not deduping these guys is that the change weighs -140 lines of code.

It may go without saying, but this breaks the picture format.

Testing: out/Debug/tests && out/Debug/dm  (which runs all picture modes by default)

BUG=skia:1850
R=reed@google.com, bensong@google.com, robertphillips@google.com

Author: mtklein@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@13149 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-01-23 15:16:05 +00:00
skia.committer@gmail.com
96f5fa02e9 Sanitizing source files in Housekeeper-Nightly
git-svn-id: http://skia.googlecode.com/svn/trunk@12685 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-12-16 07:01:40 +00:00
robertphillips@google.com
0efb21bd1c Improved SkPathRef interface security
https://codereview.chromium.org/115323004/



git-svn-id: http://skia.googlecode.com/svn/trunk@12676 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-12-13 19:36:25 +00:00
robertphillips@google.com
6b8dbb668f Move segment mask from SkPath to SkPathRef
https://codereview.chromium.org/105083003/



git-svn-id: http://skia.googlecode.com/svn/trunk@12660 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-12-12 23:03:51 +00:00
skia.committer@gmail.com
6e515d67d2 Sanitizing source files in Housekeeper-Nightly
git-svn-id: http://skia.googlecode.com/svn/trunk@12477 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-12-04 07:02:26 +00:00
robertphillips@google.com
466310dbd3 Move fIsOval from SkPath to SkPathRef
https://codereview.chromium.org/89123002/



git-svn-id: http://skia.googlecode.com/svn/trunk@12463 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-12-03 16:43:54 +00:00
robertphillips@google.com
ca316f576e Revert of r12450 (Move fIsOval from SkPath to SkPathRef)
git-svn-id: http://skia.googlecode.com/svn/trunk@12452 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-12-03 00:23:39 +00:00
robertphillips@google.com
31f0ffc9c3 Move fIsOval from SkPath to SkPathRef
https://codereview.chromium.org/89123002/



git-svn-id: http://skia.googlecode.com/svn/trunk@12450 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-12-02 23:55:11 +00:00
commit-bot@chromium.org
1ab9f737f0 Use SkPathRef gen id for SkPath::getGenerationID
R=mtklein@google.com, robertphillips@google.com

Author: bsalomon@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@12029 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-10-30 18:57:55 +00:00
robertphillips@google.com
7101abe5b3 Reverting r12010 (Use SkPathRef gen id for SkPath::getGenerationID https://codereview.chromium.org/49693002) due to test failures in PathTest on Android
git-svn-id: http://skia.googlecode.com/svn/trunk@12012 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-10-29 22:45:37 +00:00
commit-bot@chromium.org
4cc7518d9b Use SkPathRef gen id for SkPath::getGenerationID
R=mtklein@google.com

Author: bsalomon@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@12010 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-10-29 21:34:55 +00:00
commit-bot@chromium.org
1f81fd6546 SK_ONCE for SkData and SkPathRef
Adds SK_ONCE_FRIEND, to allow SK_DEF_ONCE code to be friends with a class.  This had to go in include/core to be visible to headers there.

BUG=
R=reed@google.com, bungeman@google.com

Author: mtklein@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@11914 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-10-23 14:44:08 +00:00
robertphillips@google.com
aaf3e64b2c Move makeSpace and resetToSize from SkPathRef.cpp to .h
https://codereview.chromium.org/25754002/



git-svn-id: http://skia.googlecode.com/svn/trunk@11578 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-10-02 17:49:50 +00:00
commit-bot@chromium.org
80390ec0f5 Threads can race to be the first one to calculate the empty path ref's bounds.
To dodge the problem, call computeBounds when creating the global empty path
ref.

There's still another race here, which is that we can race to create the empty
path ref in the first place.  As written we can conceivably allocate an
arbitrary number of empty path refs, one of which ends up pointed to by the
global variable at the end.

I've punted on fixing this for now because 1) tsan has not complained yet; 2) I
think it can be fixed by the same approach as we can fix the memsets in
25415003, so I want to wait to see how that review goes
first.

BUG=
R=reed@google.com, robertphillips@google.com

Author: mtklein@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@11576 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-10-02 16:42:58 +00:00
robertphillips@google.com
0308707248 Make it explicit that some validate methods are debug only
https://codereview.chromium.org/25716003/



git-svn-id: http://skia.googlecode.com/svn/trunk@11575 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-10-02 16:42:21 +00:00
robertphillips@google.com
650ead2f1b Added SK_API to SkPathRef.h
git-svn-id: http://skia.googlecode.com/svn/trunk@11515 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-09-29 14:48:38 +00:00
robertphillips@google.com
3e292aa398 Move unlikely-to-be-inlined code from SkPathRef.h to SkPathRef.cpp
https://codereview.chromium.org/24998004/



git-svn-id: http://skia.googlecode.com/svn/trunk@11506 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-09-27 17:48:49 +00:00
robertphillips@google.com
080958599e Compiler warning/error fix for Chromium
git-svn-id: http://skia.googlecode.com/svn/trunk@11494 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-09-27 12:27:27 +00:00
skia.committer@gmail.com
65caeaf32d Sanitizing source files in Housekeeper-Nightly
git-svn-id: http://skia.googlecode.com/svn/trunk@11493 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-09-27 07:01:29 +00:00
robertphillips@google.com
ca0c8389e2 Move bound and isFinite into pathref
https://codereview.chromium.org/24350006/



git-svn-id: http://skia.googlecode.com/svn/trunk@11467 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-09-26 12:18:23 +00:00