Commit Graph

324 Commits

Author SHA1 Message Date
bsalomon
ac3aa245ac Plumb drawArc to SkDevice.
Plumbs the drawArc canvas method down to SkDevice without converting to a path. Plumbs through the various recording canvas classes.

BUG=skia:5227
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2257023003

Review-Url: https://codereview.chromium.org/2257023003
2016-08-19 11:25:20 -07:00
mtklein
cbdf007bc2 Fast path translate() in SkCanvas and SkLiteDL.
This adds didTranslate() so that SkLiteDL (and other canvas recorders)
can record the translate rather than the full concat.

It also adds a case to SkMatrix::preTranslate() to fast path
translate x translate -> translate (i.e. +=).

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

Committed: https://skia.googlesource.com/skia/+/5fa47f4fd13b3158de4599414c86d17649c2dd1c

Misc bots failing in pictureimagefilter replay modes.
https://luci-milo.appspot.com/swarming/task/30b8e53f3a1f4f10/steps/dm/0/stdout

Problem is FMA vs. not.

CQ_INCLUDE_TRYBOTS=master.client.skia:
Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-Fast-Trybot

Review-Url: https://codereview.chromium.org/2255283002
2016-08-19 09:05:27 -07:00
msarett
10e3d9bf59 Batched implementation of drawLattice() for GPU
Bechmarks (Nexus 6P):

Src=100x100, Dst=250x250, NumRects=9
Android              77.7us
Skia (without patch) 57.2us
Skia (with patch)    30.9us

Src=100x100, Dst=500x500, NumRects=9
Android              77.0us
Skia (without patch) 56.9us
Skia (with patch)    31.8us

Src=100x100, Dst=1000x1000, NumRects=9
Android              180us
Skia (without patch) 96.8us
Skia (with patch)    70.5us

Src=100x100, Dst=250x250, NumRects=15
Android              208us
Skia (without patch) 155us
Skia (with patch)    38.2us

Src=100x100, Dst=500x500, NumRects=15
Android              207us
Skia (without patch) 152us
Skia (with patch)    38.4us

Src=100x100, Dst=1000x1000, NumRects=15
Android              233us
Skia (without patch) 156us
Skia (with patch)    99.9us

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

Committed: https://skia.googlesource.com/skia/+/93242c4ae50dfcc0d922cdb3ba80bbc7b4bbe93d
Review-Url: https://codereview.chromium.org/2255963002
2016-08-18 15:46:03 -07:00
msarett
7fc08585d0 Revert of Batched implementation of drawLattice() for GPU (patchset #7 id:180001 of https://codereview.chromium.org/2255963002/ )
Reason for revert:
Things drawing weird.

Original issue's description:
> Batched implementation of drawLattice() for GPU
>
> Bechmarks (Nexus 6P):
>
> Src=100x100, Dst=250x250, NumRects=9
> Android              77.7us
> Skia (without patch) 57.2us
> Skia (with patch)    34.7us
>
> Src=100x100, Dst=500x500, NumRects=9
> Android              77.0us
> Skia (without patch) 56.9us
> Skia (with patch)    44.5us
>
> Src=100x100, Dst=1000x1000, NumRects=9
> Android              180us
> Skia (without patch) 96.8us
> Skia (with patch)    70.5us
>
> Src=100x100, Dst=250x250, NumRects=15
> Android              208us
> Skia (without patch) 155us
> Skia (with patch)    55.9us
>
> Src=100x100, Dst=500x500, NumRects=15
> Android              207us
> Skia (without patch) 152us
> Skia (with patch)    63.0us
>
> Src=100x100, Dst=1000x1000, NumRects=15
> Android              233us
> Skia (without patch) 156us
> Skia (with patch)    99.9us
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2255963002
>
> Committed: https://skia.googlesource.com/skia/+/93242c4ae50dfcc0d922cdb3ba80bbc7b4bbe93d

TBR=bsalomon@google.com,reed@google.com,djsollen@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review-Url: https://codereview.chromium.org/2255683004
2016-08-18 14:29:22 -07:00
msarett
93242c4ae5 Batched implementation of drawLattice() for GPU
Bechmarks (Nexus 6P):

Src=100x100, Dst=250x250, NumRects=9
Android              77.7us
Skia (without patch) 57.2us
Skia (with patch)    34.7us

Src=100x100, Dst=500x500, NumRects=9
Android              77.0us
Skia (without patch) 56.9us
Skia (with patch)    44.5us

Src=100x100, Dst=1000x1000, NumRects=9
Android              180us
Skia (without patch) 96.8us
Skia (with patch)    70.5us

Src=100x100, Dst=250x250, NumRects=15
Android              208us
Skia (without patch) 155us
Skia (with patch)    55.9us

Src=100x100, Dst=500x500, NumRects=15
Android              207us
Skia (without patch) 152us
Skia (with patch)    63.0us

Src=100x100, Dst=1000x1000, NumRects=15
Android              233us
Skia (without patch) 156us
Skia (with patch)    99.9us

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

Review-Url: https://codereview.chromium.org/2255963002
2016-08-18 13:11:48 -07:00
halcanary
3287588a46 SkPDF: SkPDFFont class changes
SkPDFFont:
  * inline some one-line methdods.
      - SkPDFFont::typeface()
      - SkPDFFont::fontInfo()
      - SkPDFFont::firstGlyphID()
      - SkPDFFont::lastGlyphID()
      - SkPDFFont::getFontDescriptor()
  * de-virtualize some methods:
      - SkPDFFont::getType()
      - SkPDFFont::multiByteGlyphs()
  * Constructor takes more arguments:
    fontType, multiByteGlyphs
  * re-order fields (pointers before shorts)
  * use sk_sp<T> more, T* less

SkAdvancedTypefaceMetrics:
  * SkAdvancedTypefaceMetrics::fFont now a uint8_t
  * other enumes are sized.
  * SkAdvancedTypefaceMetrics::fStyle now big enough.
  * remove use of SkTBitOr, replaced with fancy templates

No public API changes.
TBR=reed@google.com

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

Review-Url: https://codereview.chromium.org/2246903002
2016-08-16 09:36:23 -07:00
csmartdalton
f9635999a4 Add flag for window rectangles to GrRenderTarget
Adds a flag to GrRenderTarget that indicates whether it can be used
with window rectangles. Also attempts to clean up some of the mixed
samples API.

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

Review-Url: https://codereview.chromium.org/2225303002
2016-08-10 11:09:07 -07:00
mtklein
3ff2cc81a5 constexpr NaN,+Inf,-Inf
Reading extern values meant these couldn't be compile-time constants.

math.h has INFINITY, which is macro that is supposed to expand to float +inf.
On MSVC it seems it's natively a double, so we cast just to make sure.

There's nan(const char*) in math.h for NaN too, but I don't trust that
to be compile-time evaluated.  So instead, we keep reinterpreting a bit pattern.

I did try to write

    static constexpr float float_nan() { ... }

and completely failed.  constexpr seems a bit too restrictive in C++11 to make
it work, but Clang kept telling me, you'll be able to do this with C++14.

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

Review-Url: https://codereview.chromium.org/2233853002
2016-08-10 08:31:42 -07:00
mtklein
4e97607d9a Use sse4.2 CRC32 instructions to hash when available.
About 9x faster than Murmur3 for long inputs.

Most of this is a mechanical change from SkChecksum::Murmur3(...) to SkOpts::hash(...).

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2208903002
CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot;master.client.skia.compile:Build-Ubuntu-GCC-x86_64-Release-CMake-Trybot,Build-Mac-Clang-x86_64-Release-CMake-Trybot

Review-Url: https://codereview.chromium.org/2208903002
2016-08-08 09:06:28 -07:00
halcanary
9be372041e std::move(SkTDArray)
Since we don't support MSVC2013 anymore, we can be more
succinct when defining move constructors of compound types.

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

Review-Url: https://codereview.chromium.org/2227673002
2016-08-08 07:21:42 -07:00
msarett
c573a40ed5 Add drawImageLattice() and drawBitmapLattice() APIs
The specified image/bitmap is divided into rects, which
can be draw stretched, shrunk, or at a fixed size.  Will be
used by Android to draw 9patch (which are acutally N-patch)
images.

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

Review-Url: https://codereview.chromium.org/1992283002
2016-08-02 08:05:56 -07:00
mtklein
1bb5fecbea Sketch SkPictureRecorder::optimizeFor(GrContext*).
I'm open to API suggestions.
We can pass this in finishAs(), up front, whatever.

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

Review-Url: https://codereview.chromium.org/2203453002
2016-08-01 13:17:47 -07:00
mtklein
da574d17f8 Replace old SkRecords RefBox with sk_sp.
The main differences are that RefBox's constructor reffed and sk_sp's doesn't,
and that RefBox auto-casts to the underlying pointer while sk_sp doesn't.

I've added a bunch of sk_ref_sp() and .get() to compensate.

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

Review-Url: https://codereview.chromium.org/2197243003
2016-08-01 11:24:03 -07:00
reed
9b84f8c812 turn bitmaps into images during recording
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2185563003

Review-Url: https://codereview.chromium.org/2185563003
2016-07-28 14:26:13 -07:00
mtklein
570c868b38 Clean up some unused atomic routines.
AtomicTest was the only use of sk_atomic_add().
AtomicInc64 bench was the only use of sk_atomic_inc(int64_t*).

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2183473005
CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-TSAN-Trybot,Test-Ubuntu-GCC-Golo-GPU-GT610-x86_64-Release-TSAN-Trybot

Review-Url: https://codereview.chromium.org/2183473005
2016-07-27 08:40:45 -07:00
reed
e93393b311 don't specialize drawBitmapRect for minirecorder; no longer called by blink
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2183193002

Review-Url: https://codereview.chromium.org/2183193002
2016-07-26 12:21:10 -07:00
vjiaoblack
95302da19d Creating framework for drawShadowedPicture
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2146073003

Committed: https://skia.googlesource.com/skia/+/0ae097d116f4332be02a135ffc99c162473dee6a
Review-Url: https://codereview.chromium.org/2146073003
2016-07-21 10:25:54 -07:00
vjiaoblack
33d325890e Revert of Creating framework for drawShadowedPicture (patchset #14 id:260001 of https://codereview.chromium.org/2146073003/ )
Reason for revert:
Decided to re-wait for a final LGTM.

Already found a bug in variable naming to fix.

Original issue's description:
> Creating framework for drawShadowedPicture
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2146073003
>
> Committed: https://skia.googlesource.com/skia/+/0ae097d116f4332be02a135ffc99c162473dee6a

TBR=reed@google.com,robertphillips@google.com,bsalomon@google.com,jvanverth@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review-Url: https://codereview.chromium.org/2167223002
2016-07-21 09:24:16 -07:00
vjiaoblack
0ae097d116 Creating framework for drawShadowedPicture
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2146073003

Review-Url: https://codereview.chromium.org/2146073003
2016-07-21 09:10:23 -07:00
vjiaoblack
e5de130788 Added the framework for having canvas/recorder/picture record depth_set's.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2127233002

Committed: https://skia.googlesource.com/skia/+/6d3fb898d5f73a82e36f11c712a633c3921ed518
Committed: https://skia.googlesource.com/skia/+/1185d90c785f743364cc9113d7007a59af07470c
Review-Url: https://codereview.chromium.org/2127233002
2016-07-13 14:05:28 -07:00
liyuqian
0d2c234e44 Fix SkFixedDiv macro
Previously, the macro won't pass the unit test that I just added in this
CL.

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

Review-Url: https://codereview.chromium.org/2149733002
2016-07-13 13:34:46 -07:00
mtklein
6e998e6137 Revert "Added the framework for having canvas/recorder/picture record depth_set's."
1-click revert failed again.
This reverts commit 1185d90c78.

BUG=skia:

TBR=
NOTRY=true

Review-Url: https://codereview.chromium.org/2147963002
2016-07-13 09:03:48 -07:00
vjiaoblack
1185d90c78 Added the framework for having canvas/recorder/picture record depth_set's.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2127233002

Committed: https://skia.googlesource.com/skia/+/6d3fb898d5f73a82e36f11c712a633c3921ed518
Review-Url: https://codereview.chromium.org/2127233002
2016-07-13 08:35:41 -07:00
mtklein
e504dbc092 Revert "Added the framework for having canvas/recorder/picture record depth_set's."
1-click revert failed.
This reverts commit 6d3fb898d5.

TBR=

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

Review-Url: https://codereview.chromium.org/2148543002
2016-07-12 15:41:08 -07:00
vjiaoblack
6d3fb898d5 Added the framework for having canvas/recorder/picture record depth_set's.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2127233002

Review-Url: https://codereview.chromium.org/2127233002
2016-07-12 14:50:41 -07:00
msarett
afb8539f62 Revert of try to speed-up maprect + round2i + contains (patchset #8 id:140001 of https://codereview.chromium.org/2133413002/ )
Reason for revert:
Breaking the roll...
https://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/253294/steps/compile%20%28with%20patch%29/logs/stdio

Original issue's description:
> try to speed-up maprect + round2i + contains
>
> We call roundOut in a few places. If we can get SkNx::Ceil we could efficiently implement that as well.
>
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2133413002
> CQ_INCLUDE_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot
>
> Committed: https://skia.googlesource.com/skia/+/b42b785d1cbc98bd34aceae338060831b974f9c5

TBR=mtklein@google.com,reed@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review-Url: https://codereview.chromium.org/2136343002
2016-07-11 14:57:26 -07:00
reed
b42b785d1c try to speed-up maprect + round2i + contains
We call roundOut in a few places. If we can get SkNx::Ceil we could efficiently implement that as well.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2133413002
CQ_INCLUDE_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

Review-Url: https://codereview.chromium.org/2133413002
2016-07-11 13:17:35 -07:00
reed
45561a0b15 drawTextRSXform
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2130643004

Review-Url: https://codereview.chromium.org/2130643004
2016-07-07 12:47:17 -07:00
csmartdalton
a7f29640f6 Begin instanced rendering for simple shapes
Adds a module that performs instanced rendering and starts using it
for a select subset of draws on Mac GL platforms. The instance
processor can currently handle rects, ovals, round rects, and double
round rects. It can generalize shapes as round rects in order to
improve batching. The instance processor also employs new drawing
algorithms, irrespective of instanced rendering, that improve GPU-side
performance (e.g. sample mask, different triangle layouts, etc.).

This change only scratches the surface of instanced rendering. The
majority of draws still only have one instance. Future work may
include:

 * Passing coord transforms through the texel buffer.
 * Sending FP uniforms through instanced vertex attribs.
 * Using instanced rendering for more draws (stencil writes,
   drawAtlas, etc.).
 * Adding more shapes to the instance processor’s repertoire.
 * Batching draws that have mismatched scissors (analyzing draw
   bounds, inserting clip planes, etc.).
 * Bindless textures.
 * Uber shaders.

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

Committed: https://skia.googlesource.com/skia/+/42eafa4bc00354b132ad114d22ed6b95d8849891
Review-Url: https://codereview.chromium.org/2066993003
2016-07-07 08:49:11 -07:00
ksakamoto
ec7f2ac728 Revert of Begin instanced rendering for simple shapes (patchset #20 id:380001 of https://codereview.chromium.org/2066993003/ )
Reason for revert:
This caused static initializer regressions in Chromium (crbug.com/625728).

Relevant build logs here:
Linux:
https://build.chromium.org/p/chromium/builders/Linux%20x64/builds/21849

Mac:
https://build.chromium.org/p/chromium/builders/Mac/builds/17350

Relevant lines from the error log:
Linux:
# InstanceProcessor.cpp GrUniqueKey::GenerateDomain()
# InstanceProcessor.cpp gr_instanced::kShapeBufferDomain
FAILED linux-release-64/sizes/nacl_helper-si/initializers: actual 8, expected 7, better lower
FAILED linux-release-64/sizes/chrome-si/initializers: actual 8, expected 7, better lower

Mac:
FAILED mac-release/sizes/chrome-si/initializers: actual 2, expected 0, better lower

Original issue's description:
> Begin instanced rendering for simple shapes
>
> Adds a module that performs instanced rendering and starts using it
> for a select subset of draws on Mac GL platforms. The instance
> processor can currently handle rects, ovals, round rects, and double
> round rects. It can generalize shapes as round rects in order to
> improve batching. The instance processor also employs new drawing
> algorithms, irrespective of instanced rendering, that improve GPU-side
> performance (e.g. sample mask, different triangle layouts, etc.).
>
> This change only scratches the surface of instanced rendering. The
> majority of draws still only have one instance. Future work may
> include:
>
>  * Passing coord transforms through the texel buffer.
>  * Sending FP uniforms through instanced vertex attribs.
>  * Using instanced rendering for more draws (stencil writes,
>    drawAtlas, etc.).
>  * Adding more shapes to the instance processor’s repertoire.
>  * Batching draws that have mismatched scissors (analyzing draw
>    bounds, inserting clip planes, etc.).
>  * Bindless textures.
>  * Uber shaders.
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2066993003
>
> Committed: https://skia.googlesource.com/skia/+/42eafa4bc00354b132ad114d22ed6b95d8849891

NOTREECHECKS=true
TBR=bsalomon@google.com,egdaniel@google.com,robertphillips@google.com,csmartdalton@google.com
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=skia:

Review-Url: https://codereview.chromium.org/2123693002
2016-07-05 03:54:53 -07:00
csmartdalton
42eafa4bc0 Begin instanced rendering for simple shapes
Adds a module that performs instanced rendering and starts using it
for a select subset of draws on Mac GL platforms. The instance
processor can currently handle rects, ovals, round rects, and double
round rects. It can generalize shapes as round rects in order to
improve batching. The instance processor also employs new drawing
algorithms, irrespective of instanced rendering, that improve GPU-side
performance (e.g. sample mask, different triangle layouts, etc.).

This change only scratches the surface of instanced rendering. The
majority of draws still only have one instance. Future work may
include:

 * Passing coord transforms through the texel buffer.
 * Sending FP uniforms through instanced vertex attribs.
 * Using instanced rendering for more draws (stencil writes,
   drawAtlas, etc.).
 * Adding more shapes to the instance processor’s repertoire.
 * Batching draws that have mismatched scissors (analyzing draw
   bounds, inserting clip planes, etc.).
 * Bindless textures.
 * Uber shaders.

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

Review-Url: https://codereview.chromium.org/2066993003
2016-06-30 12:15:49 -07:00
csmartdalton
d0e402f999 Make container classes in SkTemplates.h more consistent
Ensures that ".get()" always returns null when a container is empty.
Also ensures consistent assert behavior for array counts.

There are still differences in that the malloc variants take a size_t
and the arrays take an int, and that SkAutoSTMalloc defaults to the
stack-allocated buffer wheras the other containers default to null.

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

Review-Url: https://codereview.chromium.org/2084213003
2016-06-23 12:55:14 -07:00
brianosman
52ede1d905 More removal of SkColorProfileType...
Scrub GMs. Remove the gDefaultProfile thing (it's unused now), along with
the command line flag that was setting it in DM and nanobench.

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

Committed: https://skia.googlesource.com/skia/+/944876f2745a62a839e49275daf93a0329372e67
Review-Url: https://codereview.chromium.org/2071393002
2016-06-20 08:25:02 -07:00
egdaniel
802acec187 Revert of More removal of SkColorProfileType... (patchset #2 id:20001 of https://codereview.chromium.org/2071393002/ )
Reason for revert:
This was still used in chrome

Original issue's description:
> More removal of SkColorProfileType...
>
> Scrub GMs. Remove the gDefaultProfile thing (it's unused now), along with
> the command line flag that was setting it in DM and nanobench.
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2071393002
>
> Committed: https://skia.googlesource.com/skia/+/944876f2745a62a839e49275daf93a0329372e67

TBR=msarett@google.com,reed@google.com,bsalomon@google.com,brianosman@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review-Url: https://codereview.chromium.org/2074103004
2016-06-17 15:11:46 -07:00
brianosman
944876f274 More removal of SkColorProfileType...
Scrub GMs. Remove the gDefaultProfile thing (it's unused now), along with
the command line flag that was setting it in DM and nanobench.

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

Review-Url: https://codereview.chromium.org/2071393002
2016-06-17 13:43:27 -07:00
mtklein
f10637f279 Type-erase SkAutoMutexAcquire and SkAutoExclusive.
This is purely for convenience, to not need to write the lock type
in the guard anymore.  This should all inline away.

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

Review-Url: https://codereview.chromium.org/2055023003
2016-06-10 13:56:35 -07:00
reed
6644d9353f respect srgb gamma when building mips
Proposed policy:
- If the target is *legacy* (e.g. L32/PMColor) ignore gamma
- If the target is S32/F16 respect gamma

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

Review-Url: https://codereview.chromium.org/2029373004
2016-06-10 11:41:47 -07:00
mtklein
e18fa440e7 Move immintrin/arm_neon includes to where they are used.
On my Mac (so, immintrin), this improves compile time, both wall and cpu,
by about 16%.  To test I ran this on an SSD with files hot in their caches:

  $ env CC=/usr/bin/clang CXX=/usr/bin/clang++ ./gyp_skia && \
    ninja -C out/Release -t clean && \
    time ninja -C out/Release

  Before: 159 wall / 3367 cpu
          159 wall / 3368 cpu

  After:  137 wall / 2860 cpu
          136 wall / 2863 cpu

I also tried further refining immintrin down to emmintrin / tmmintrin / smmintrin etc.
That made no signficant difference, so I've kept immintrin for its simplicity.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2045633002
CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

TBR=reed@google.com
No public API changes.

Committed: https://skia.googlesource.com/skia/+/12dfaaa53c23f3d03050bde8f64136ac1f44164a
Review-Url: https://codereview.chromium.org/2045633002
2016-06-09 13:40:56 -07:00
bungeman
06ca8ec87c sk_sp for Ganesh.
Convert use of GrFragmentProcessor, GrGeometryProcessor, and
GrXPFactory to sk_sp. This clarifies ownership and should
reduce reference count churn by moving ownership.

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

Review-Url: https://codereview.chromium.org/2041113004
2016-06-09 08:01:03 -07:00
halcanary
4dbbd04314 SkLeanWindows.h: #include "Windows.h" fewer places
$ git grep -l '<windows.h>' include src
    include/private/SkLeanWindows.h

    $ git grep -l SkLeanWindows.h | grep '\.h$'
    include/ports/SkTypeface_win.h
    include/utils/win/SkHRESULT.h
    include/utils/win/SkTScopedComPtr.h
    include/views/SkEvent.h
    src/core/SkMathPriv.h
    src/ports/SkTypeface_win_dw.h
    src/utils/SkThreadUtils_win.h
    src/utils/win/SkWGL.h

The same for  `#include <intrin.h>` that was found in SkMath.h.
Those functions that needed it are moved to SkMathPriv.h.

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

CQ_INCLUDE_TRYBOTS=tryserver.chromium.win:win_chromium_compile_dbg_ng,win_chromium_compile_rel_ng

Review-Url: https://codereview.chromium.org/2041943002
2016-06-07 17:21:10 -07:00
mtklein
50bcb189f8 Revert of Move immintrin/arm_neon includes to where they are used. (patchset #2 id:20001 of https://codereview.chromium.org/2045633002/ )
Reason for revert:
Appears to have broken the ARMv7 aspect of the Google3 roll in bizarre seemingly-unrelated ways.

Original issue's description:
> Move immintrin/arm_neon includes to where they are used.
>
> On my Mac (so, immintrin), this improves compile time, both wall and cpu,
> by about 16%.  To test I ran this on an SSD with files hot in their caches:
>
>   $ env CC=/usr/bin/clang CXX=/usr/bin/clang++ ./gyp_skia && \
>     ninja -C out/Release -t clean && \
>     time ninja -C out/Release
>
>   Before: 159 wall / 3367 cpu
>           159 wall / 3368 cpu
>
>   After:  137 wall / 2860 cpu
>           136 wall / 2863 cpu
>
> I also tried further refining immintrin down to emmintrin / tmmintrin / smmintrin etc.
> That made no signficant difference, so I've kept immintrin for its simplicity.
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2045633002
> CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot
>
> TBR=reed@google.com
> No public API changes.
>
> Committed: https://skia.googlesource.com/skia/+/12dfaaa53c23f3d03050bde8f64136ac1f44164a

TBR=herb@google.com,mtklein@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review-Url: https://codereview.chromium.org/2046213002
2016-06-07 16:46:39 -07:00
mtklein
12dfaaa53c Move immintrin/arm_neon includes to where they are used.
On my Mac (so, immintrin), this improves compile time, both wall and cpu,
by about 16%.  To test I ran this on an SSD with files hot in their caches:

  $ env CC=/usr/bin/clang CXX=/usr/bin/clang++ ./gyp_skia && \
    ninja -C out/Release -t clean && \
    time ninja -C out/Release

  Before: 159 wall / 3367 cpu
          159 wall / 3368 cpu

  After:  137 wall / 2860 cpu
          136 wall / 2863 cpu

I also tried further refining immintrin down to emmintrin / tmmintrin / smmintrin etc.
That made no signficant difference, so I've kept immintrin for its simplicity.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2045633002
CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

TBR=reed@google.com
No public API changes.

Review-Url: https://codereview.chromium.org/2045633002
2016-06-07 09:35:28 -07:00
mtklein
785a5b941a Clean up SkFloatBits
- remove dead code
- rewrite float -> int converters

The strategy for the new converters is:
   - convert input to double
   - floor/ceil/round in double space
   - pin that double to [SK_MinS32, SK_MaxS32]
   - truncate that double to int32_t

This simpler strategy does not work:
   - floor/ceil/round in float space
   - pin that float to [SK_MinS32, SK_MaxS32]
   - truncate that float to int32_t

SK_MinS32 and SK_MaxS32 are not representable as floats:
they round to the nearest float, ±2^31, which makes the
pin insufficient for floats near SK_MinS32 (-2^31+1) or
SK_MaxS32 (+2^31-1).

float only has 24 bits of precision, and we need 31.
double can represent all integers up to 50-something bits.

An alternative is to pin in float to ±2147483520, the last
exactly representable float before SK_MaxS32 (127 too small).

Our tests test that we round as floor(x+0.5), which can
return different numbers than round(x) for negative x.
So this CL explicitly uses floor(x+0.5).

I've updated the tests with ±inf and ±NaN, and tried to
make them a little clearer, especially using SK_MinS32
instead of -SK_MaxS32.

I have not timed anything here.  I have never seen any of these
methods in a profile.

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

Review-Url: https://codereview.chromium.org/2012333003
2016-05-27 10:47:32 -07:00
bsalomon
edea94c356 Implement vulkan fence syncs for nanobench
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1974913003

Review-Url: https://codereview.chromium.org/1974913003
2016-05-16 14:09:56 -07:00
brianosman
14f850abfe Remove Sk(Float|Double)PinToFixed functions, only used in tests.
These were triggering compile-time floating point overflow for one user,
and we don't use them.

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

Review-Url: https://codereview.chromium.org/1952303005
2016-05-06 11:45:55 -07:00
mtklein
ffa4a9213b SkOncePtr -> SkOnce
It's always nice to kill off a synchronization primitive.
And while less terse, I think this new code reads more clearly.

... and, SkOncePtr's tests were the only thing now using sk_num_cores()
outside of SkTaskGroup, so I've hidden it as static inside SkTaskGroup.cpp.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1953533002
CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

Committed: https://skia.googlesource.com/skia/+/9bd3fc7fa9bb7cad050bd619aa93d4c48ebb5c02

Review-Url: https://codereview.chromium.org/1953533002
2016-05-05 16:05:56 -07:00
mtklein
42846ed437 Modernize SkMutex and SkSemaphore.
- use <atomic>
   - fuse SkMutex and SkBaseMutex
   - fuse SkSemaphore and SkBaseSemaphore

Still TODO:
   - replace SK_DECLARE_STATIC_MUTEX(name) with static SkMutex name

I just didn't want to bother fixing all that up until I know this CL sticks.

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

No public API changes.
TBR=reed@google.com

Committed: https://skia.googlesource.com/skia/+/427c2819d9237d7d7729c59238036cfc73c072ea

Review-Url: https://codereview.chromium.org/1947153002
2016-05-05 10:57:37 -07:00
reed
959a2937d5 Revert of SkOncePtr -> SkOnce (patchset #1 id:1 of https://codereview.chromium.org/1949313003/ )
Reason for revert:
ok, I have no idea what's going on

Original issue's description:
> Reland of SkOncePtr -> SkOnce (patchset #1 id:1 of https://codereview.chromium.org/1945293004/ )
>
> Reason for revert:
> previous revert unneeded (I think)
>
> Original issue's description:
> > Revert of SkOncePtr -> SkOnce (patchset #4 id:60001 of https://codereview.chromium.org/1953533002/ )
> >
> > Reason for revert:
> > broken the Mac and Linux builders, e.g.:
> >
> > https://build.chromium.org/p/chromium/builders/Mac/builds/15151
> > https://build.chromium.org/p/chromium/builders/Linux%20x64/builds/19052
> >
> > Original issue's description:
> > > SkOncePtr -> SkOnce
> > >
> > > It's always nice to kill off a synchronization primitive.
> > > And while less terse, I think this new code reads more clearly.
> > >
> > > ... and, SkOncePtr's tests were the only thing now using sk_num_cores()
> > > outside of SkTaskGroup, so I've hidden it as static inside SkTaskGroup.cpp.
> > >
> > > BUG=skia:
> > > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1953533002
> > > CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot
> > >
> > > Committed: https://skia.googlesource.com/skia/+/9bd3fc7fa9bb7cad050bd619aa93d4c48ebb5c02
> >
> > TBR=herb@google.com,mtklein@chromium.org
> > # Skipping CQ checks because original CL landed less than 1 days ago.
> > NOPRESUBMIT=true
> > NOTREECHECKS=true
> > NOTRY=true
> > BUG=skia:
> >
> > Committed: https://skia.googlesource.com/skia/+/7eb33da7eede34c050b865dbb1b60c3dcea7191b
>
> TBR=herb@google.com,mtklein@chromium.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/82da9a8aa0ce648f36882830765b42e0ada6c0fa

TBR=herb@google.com,mtklein@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review-Url: https://codereview.chromium.org/1948313002
2016-05-05 01:36:43 -07:00
reed
82da9a8aa0 Reland of SkOncePtr -> SkOnce (patchset #1 id:1 of https://codereview.chromium.org/1945293004/ )
Reason for revert:
previous revert unneeded (I think)

Original issue's description:
> Revert of SkOncePtr -> SkOnce (patchset #4 id:60001 of https://codereview.chromium.org/1953533002/ )
>
> Reason for revert:
> broken the Mac and Linux builders, e.g.:
>
> https://build.chromium.org/p/chromium/builders/Mac/builds/15151
> https://build.chromium.org/p/chromium/builders/Linux%20x64/builds/19052
>
> Original issue's description:
> > SkOncePtr -> SkOnce
> >
> > It's always nice to kill off a synchronization primitive.
> > And while less terse, I think this new code reads more clearly.
> >
> > ... and, SkOncePtr's tests were the only thing now using sk_num_cores()
> > outside of SkTaskGroup, so I've hidden it as static inside SkTaskGroup.cpp.
> >
> > BUG=skia:
> > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1953533002
> > CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot
> >
> > Committed: https://skia.googlesource.com/skia/+/9bd3fc7fa9bb7cad050bd619aa93d4c48ebb5c02
>
> TBR=herb@google.com,mtklein@chromium.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/7eb33da7eede34c050b865dbb1b60c3dcea7191b

TBR=herb@google.com,mtklein@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review-Url: https://codereview.chromium.org/1949313003
2016-05-05 01:28:56 -07:00
sclittle
d9f5d20f81 Revert of Modernize SkMutex and SkSemaphore. (patchset #2 id:20001 of https://codereview.chromium.org/1947153002/ )
Reason for revert:
This CL seems to have broken the Linux x64 and Mac
bots, e.g.

https://build.chromium.org/p/chromium/builders/Linux%20x64/builds/19052
https://build.chromium.org/p/chromium/builders/Mac/builds/15151

The error appears to have something to do with new static initializers being
added.

Original issue's description:
> Modernize SkMutex and SkSemaphore.
>
>    - use <atomic>
>    - fuse SkMutex and SkBaseMutex
>    - fuse SkSemaphore and SkBaseSemaphore
>
> Still TODO:
>    - replace SK_DECLARE_STATIC_MUTEX(name) with static SkMutex name
>
> I just didn't want to bother fixing all that up until I know this CL sticks.
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1947153002
>
> No public API changes.
> TBR=reed@google.com
>
> Committed: https://skia.googlesource.com/skia/+/427c2819d9237d7d7729c59238036cfc73c072ea

TBR=herb@google.com,mtklein@chromium.org,reed@google.com,bsalomon@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=609340

Review-Url: https://codereview.chromium.org/1945343003
2016-05-04 18:23:30 -07:00
reed
7eb33da7ee Revert of SkOncePtr -> SkOnce (patchset #4 id:60001 of https://codereview.chromium.org/1953533002/ )
Reason for revert:
broken the Mac and Linux builders, e.g.:

https://build.chromium.org/p/chromium/builders/Mac/builds/15151
https://build.chromium.org/p/chromium/builders/Linux%20x64/builds/19052

Original issue's description:
> SkOncePtr -> SkOnce
>
> It's always nice to kill off a synchronization primitive.
> And while less terse, I think this new code reads more clearly.
>
> ... and, SkOncePtr's tests were the only thing now using sk_num_cores()
> outside of SkTaskGroup, so I've hidden it as static inside SkTaskGroup.cpp.
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1953533002
> CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot
>
> Committed: https://skia.googlesource.com/skia/+/9bd3fc7fa9bb7cad050bd619aa93d4c48ebb5c02

TBR=herb@google.com,mtklein@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review-Url: https://codereview.chromium.org/1945293004
2016-05-04 17:14:44 -07:00
reed
086eea93b1 Revert of SK_DECLARE_STATIC_MUTEX -> static SkMutex (patchset #1 id:1 of https://codereview.chromium.org/1948193002/ )
Reason for revert:
broken the Mac and Linux builders, e.g.:

https://build.chromium.org/p/chromium/builders/Mac/builds/15151
https://build.chromium.org/p/chromium/builders/Linux%20x64/builds/19052

Original issue's description:
> SK_DECLARE_STATIC_MUTEX -> static SkMutex
>
> There's no need to use a macro to declare static SkMutexes any more
> (and there's likewise no need to restrict them to global scope).
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1948193002
>
> Committed: https://skia.googlesource.com/skia/+/5e56cfd3fa1041dbb83899844fb92fa9a2ef1009

TBR=mtklein@google.com,mtklein@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review-Url: https://codereview.chromium.org/1945353003
2016-05-04 17:12:46 -07:00
mtklein
5e56cfd3fa SK_DECLARE_STATIC_MUTEX -> static SkMutex
There's no need to use a macro to declare static SkMutexes any more
(and there's likewise no need to restrict them to global scope).

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

Review-Url: https://codereview.chromium.org/1948193002
2016-05-04 15:21:12 -07:00
mtklein
9bd3fc7fa9 SkOncePtr -> SkOnce
It's always nice to kill off a synchronization primitive.
And while less terse, I think this new code reads more clearly.

... and, SkOncePtr's tests were the only thing now using sk_num_cores()
outside of SkTaskGroup, so I've hidden it as static inside SkTaskGroup.cpp.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1953533002
CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

Review-Url: https://codereview.chromium.org/1953533002
2016-05-04 14:40:18 -07:00
mtklein
b37c68ad42 Simplify implementation of SkOnce to not need so many comments.
I think this version reads more clearly, and the key invariants are
expressed in code rather than comments:
   - race losers always go through an acquire
   - we never exit the function unless fState is Done

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

Review-Url: https://codereview.chromium.org/1951013004
2016-05-04 13:57:30 -07:00
robertphillips
76948d4faa Add Gr*Proxy classes
This isn't wired in anywhere yet.

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

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

Committed: https://skia.googlesource.com/skia/+/92605b35efa0155c44d24bd8415b4cc1db8831db

Review-Url: https://codereview.chromium.org/1937553002
2016-05-04 12:47:41 -07:00
mtklein
427c2819d9 Modernize SkMutex and SkSemaphore.
- use <atomic>
   - fuse SkMutex and SkBaseMutex
   - fuse SkSemaphore and SkBaseSemaphore

Still TODO:
   - replace SK_DECLARE_STATIC_MUTEX(name) with static SkMutex name

I just didn't want to bother fixing all that up until I know this CL sticks.

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

No public API changes.
TBR=reed@google.com

Review-Url: https://codereview.chromium.org/1947153002
2016-05-04 11:31:29 -07:00
robertphillips
4f16e6361d Revert of Add Gr*Proxy classes (patchset #10 id:220001 of https://codereview.chromium.org/1937553002/ )
Reason for revert:
ASAN

Original issue's description:
> Add Gr*Proxy classes
>
> This isn't wired in anywhere yet.
>
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1937553002
>
> Committed: https://skia.googlesource.com/skia/+/de5bf0cfeca908b81a28cc50065f7bc2da3d2fd1
>
> Committed: https://skia.googlesource.com/skia/+/92605b35efa0155c44d24bd8415b4cc1db8831db

TBR=bsalomon@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review-Url: https://codereview.chromium.org/1944953002
2016-05-03 12:56:04 -07:00
robertphillips
92605b35ef Add Gr*Proxy classes
This isn't wired in anywhere yet.

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

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

Review-Url: https://codereview.chromium.org/1937553002
2016-05-03 08:47:01 -07:00
robertphillips
89d09a1f70 Revert of Add Gr*Proxy classes (patchset #9 id:160001 of https://codereview.chromium.org/1937553002/ )
Reason for revert:
Seems to be breaking N7 & ANGLE bots

Original issue's description:
> Add Gr*Proxy classes
>
> This isn't wired in anywhere yet.
>
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1937553002
>
> Committed: https://skia.googlesource.com/skia/+/de5bf0cfeca908b81a28cc50065f7bc2da3d2fd1

TBR=bsalomon@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review-Url: https://codereview.chromium.org/1949463002
2016-05-03 06:44:50 -07:00
robertphillips
de5bf0cfec Add Gr*Proxy classes
This isn't wired in anywhere yet.

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

Review-Url: https://codereview.chromium.org/1937553002
2016-05-03 05:06:29 -07:00
mtklein
59c12e3f00 remove non-static uses of SkOncePtr
Still slowly working through all the SK_DECLARE_STATIC_FOO macros.

SkOncePtr is complicating things by having SkOncePtr delete its pointer
and SkBaseOncePtr not.  Simplify things by removing SkOncePtr, leaving
only the leaky SkBaseOncePtr.

We replace SkOncePtr<T> instead with SkOnce and T.  In most cases this
did not need to be a pointer, and in some cases here we're even saving
a few bytes by replacing SkOncePtr<T> with SkOnce and a T.

The dependency map of SK_DECLARE_STATIC_FOO is:
  SkBaseMutex -> SkBaseSemaphore -> SkBaseOncePtr

They're intertwined enough that I think I've got to do all three in one
next CL.

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

Review-Url: https://codereview.chromium.org/1939503002
2016-05-02 07:19:41 -07:00
mtklein
e86e51fe7e Add reminders that these classes have constexpr default constructors.
We can do this now that we can write "constexpr".

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

Review-Url: https://codereview.chromium.org/1936653002
2016-04-29 13:58:18 -07:00
bungeman
b4d46f03db Remove skstd::is_function.
The VC++ STL with 2015u2 now provides a complete std::is_function.
Also, Skia is no longer using skstd::is_function.

Review-Url: https://codereview.chromium.org/1929343002
2016-04-29 08:27:14 -07:00
bungeman
801b44c453 Remove skstd::is_convertible.
We should now be able to use std::is_convertible.

TBR=reed@google.com
This doesn't change any API, just where we get a type trait from.

Review-Url: https://codereview.chromium.org/1931003002
2016-04-28 11:18:07 -07:00
reed
1541130b66 remove SK_SUPPORT_LEGACY_DIVBITS_UB -- chrome no longer defines this
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1927823002

TBR=mtklein@google.com

Review-Url: https://codereview.chromium.org/1927823002
2016-04-27 18:45:36 -07:00
halcanary
484b3d0b83 SkDefaultColorProfile: Hide gDefaultProfileIsSRGB
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1917443002

Review URL: https://codereview.chromium.org/1917443002
2016-04-25 10:32:23 -07:00
bungeman
6a6f3c58b4 Fix indentation and casts in SkTArray.
Review URL: https://codereview.chromium.org/1902423007
2016-04-21 10:52:03 -07:00
krasin
e0c1d285a0 SkTArray: fix invalid reinterpret_casts over non-initialized memory.
This should fix 'CFI Linux' buildbot, which is currently horribly broken:
https://build.chromium.org/p/chromium.fyi/builders/CFI%20Linux/builds/5115

BUG=605337

Review URL: https://codereview.chromium.org/1908763002
2016-04-21 08:34:00 -07:00
herb
9bc22351b5 Make all the codecs default profiles based on gTreatSkColorAsSRGB.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1893203006

Review URL: https://codereview.chromium.org/1893203006
2016-04-20 15:07:32 -07:00
mtklein
650f9e9a26 SkOnce: 2 bytes -> 1 byte
This uses the same logic we worked out for SkOncePtr to reduce
the memory footprint of SkOnce from a done byte and lock byte
to a single 3-state byte:

  - NotStarted: no thread has tried to run fn() yet
  - Active:     a thread is running fn()
  - Done:       fn() is complete

Threads which see Done return immediately.
Threads which see NotStarted try to move to Active, run fn(), then move to Done.
Threads which see Active spin until the active thread moves to Done.

This additionally fixes a too-weak memory order bug in SkOncePtr,
and adds a big note to explain.

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

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

Review URL: https://codereview.chromium.org/1904483003
2016-04-20 13:49:15 -07:00
mtklein
9134686fd9 Revert of SkOnce: 2 bytes -> 1 byte (patchset #4 id:60001 of https://codereview.chromium.org/1904483003/ )
Reason for revert:
bust the roll

Original issue's description:
> SkOnce: 2 bytes -> 1 byte
>
> This uses the same logic we worked out for SkOncePtr to reduce
> the memory footprint of SkOnce from a done byte and lock byte
> to a single 3-state byte:
>
>   - NotStarted: no thread has tried to run fn() yet
>   - Active:     a thread is running fn()
>   - Done:       fn() is complete
>
> Threads which see Done return immediately.
> Threads which see NotStarted try to move to Active, run fn(), then move to Done.
> Threads which see Active spin until the active thread moves to Done.
>
> This additionally fixes a too-weak memory order bug in SkOncePtr,
> and adds a big note to explain.
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1904483003
>
> Committed: https://skia.googlesource.com/skia/+/df02d338be8e3c1c50b48a3a9faa582703a39c07

TBR=herb@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1898413004
2016-04-20 13:02:09 -07:00
mtklein
df02d338be SkOnce: 2 bytes -> 1 byte
This uses the same logic we worked out for SkOncePtr to reduce
the memory footprint of SkOnce from a done byte and lock byte
to a single 3-state byte:

  - NotStarted: no thread has tried to run fn() yet
  - Active:     a thread is running fn()
  - Done:       fn() is complete

Threads which see Done return immediately.
Threads which see NotStarted try to move to Active, run fn(), then move to Done.
Threads which see Active spin until the active thread moves to Done.

This additionally fixes a too-weak memory order bug in SkOncePtr,
and adds a big note to explain.

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

Review URL: https://codereview.chromium.org/1904483003
2016-04-20 10:54:54 -07:00
bungeman
0d9e9bee17 SkTArray movable and swap for move only elements.
SkTArray cannot currently contain move only elements because its swap
currently requires the SkTArray to be copyable. This makes SkTArray
movable and makes its swap move instead of copy.

Review URL: https://codereview.chromium.org/1904663004
2016-04-20 10:22:20 -07:00
mtklein
d9dd428211 Modernize and trim down SkOnce.
The API and implementation are very much simplified.
You may not want to bother reading the diff.

As is our trend, SkOnce now uses <atomic> directly.

Member initialization means we don't need SK_DECLARE_STATIC_ONCE.
SkSpinlock already works this same way.

All uses of the old API taking an external bool* and Lock* were pessimal,
so I have not carried this sort of API forward.  It's simpler, faster,
and more space-efficient to always use this single SkOnce class interface.

SkOnce weighs 2 bytes: a done bool and an SkSpinlock, also a bool internally.
This API refactoring opens up the opportunity to fuse those into a single
three-state byte if we'd like.

No public API changes.
TBR=reed@google.com

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

Review URL: https://codereview.chromium.org/1894893002
2016-04-18 08:09:11 -07:00
bungeman
2c4bd0798e Convert SkRefCnt to std::atomic.
This enables removing the more complicated atomic shims from SkAtomics.h.

TBR=reed
This doesn't actually change any API.

CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-TSAN-Trybot,Test-Ubuntu-GCC-Golo-GPU-GT610-x86_64-Release-TSAN-Trybot

Review URL: https://codereview.chromium.org/1867863002
2016-04-08 06:58:52 -07:00
fmalita
e7365065ac Revert of For *ToFixed, in debug mode, assert that the value is in range. (patchset #6 id:140001 of https://codereview.chromium.org/1824733002/ )
Reason for revert:
Asserts in Blink rolls:

https://storage.googleapis.com/chromium-layout-test-archives/linux_blink_rel/84520/layout-test-results/results.html

STDERR: [1:1:0407/120919:1455366829:INFO:SkFixed.h(88)] ../../third_party/skia/include/private/SkFixed.h:88: fatal error: ""truncf(x * (1 << 16)) == static_cast<float>

Original issue's description:
> For *ToFixed, in debug mode, assert that the value is in range.
>
> Use SkFloatPinToFixed in SkTwoPointConicalGradient.cpp because it is failing in DM. fmalita is working on replacing this code with the 4f version, so I'm not bothering to fix it. (The beginnings of a real fix are in https://codereview.chromium.org/1767163003, which I do not plan to commit.)
>
> BUG=skia:4632
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1824733002
>
> Committed: https://skia.googlesource.com/skia/+/93dc33972cd6a418e84270298b856d2de08d9c1c

TBR=mtklein@google.com,reed@google.com,benjaminwagner@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:4632

Review URL: https://codereview.chromium.org/1868933004
2016-04-07 19:27:45 -07:00
benjaminwagner
93dc33972c For *ToFixed, in debug mode, assert that the value is in range.
Use SkFloatPinToFixed in SkTwoPointConicalGradient.cpp because it is failing in DM. fmalita is working on replacing this code with the 4f version, so I'm not bothering to fix it. (The beginnings of a real fix are in https://codereview.chromium.org/1767163003, which I do not plan to commit.)

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

Review URL: https://codereview.chromium.org/1824733002
2016-04-07 09:52:19 -07:00
benjaminwagner
70f1a6c64e Add pinned versions of *ToFixed.
BUG=skia:4632
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1707023002

Review URL: https://codereview.chromium.org/1707023002
2016-04-07 09:23:12 -07:00
benjaminwagner
6c71e0a065 Reverse dependency between SkScalar.h and SkFixed.h.
The following are unused in Chromium, Android, Mozilla, and Google3:
 - SkFixedToScalar
 - SkScalarToFixed

The following are additionally unused in Skia:
 - SkStrAppendFixed
 - SkWriteBuffer::writeFixed

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

Review URL: https://codereview.chromium.org/1841123002
2016-04-07 08:49:31 -07:00
benjaminwagner
dfed06f6ff Make SkFixed private.
Removed from Chromium in https://codereview.chromium.org/1698083004 and https://codereview.chromium.org/1752953003.

Removed from Android in 895781.

Removed from Google3 in internal cl/118359061.

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

Review URL: https://codereview.chromium.org/1839653002
2016-03-28 10:32:06 -07:00
mtklein
04cdc4b618 Remove transitional explicit operator bool.
These should no longer be necessary. Android's STL should now
be sane.

TBR=reed
This just removes code.

Review URL: https://codereview.chromium.org/1817153002
2016-03-21 09:35:33 -07:00
bungeman
68c14d9b32 Templatize SkToXXX.
Makes the checked cast in debug more correct, avoiding new
warnings in vs2015.

BUG=skia:4553

Committed: https://skia.googlesource.com/skia/+/0be9e806af72b3e029e691eef5c891c90d3fd320

Review URL: https://codereview.chromium.org/1814153003
2016-03-19 15:06:56 -07:00
bungeman
89edf7a95e Revert of Templatize SkToXXX. (patchset #2 id:20001 of https://codereview.chromium.org/1814153003/ )
Reason for revert:
Chrome does not yet have std::underlying_type.

Original issue's description:
> Templatize SkToXXX.
>
> Makes the checked cast in debug more correct, avoiding new
> warnings in vs2015.
>
> BUG=skia:4553
>
> Committed: https://skia.googlesource.com/skia/+/0be9e806af72b3e029e691eef5c891c90d3fd320

TBR=reed@google.com,mtklein@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:4553

Review URL: https://codereview.chromium.org/1820433002
2016-03-18 11:53:17 -07:00
bungeman
0be9e806af Templatize SkToXXX.
Makes the checked cast in debug more correct, avoiding new
warnings in vs2015.

BUG=skia:4553

Review URL: https://codereview.chromium.org/1814153003
2016-03-18 11:17:56 -07:00
reed
ca2622ba05 return pictures as sk_sp
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1811703002

Review URL: https://codereview.chromium.org/1811703002
2016-03-18 07:25:55 -07:00
mtklein
852f15da7c free -> reset
The C++ standard library uses ".reset()" where we sometimes write ".free()".
We also use ".reset()" quite a lot.  This standardizes on ".reset()".

This is one more step towards dropping SkAutoTDelete in favor of the standard
std::unique_ptr.

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

Committed: https://skia.googlesource.com/skia/+/0e3738db89e86035ed5d4f629bf58b817b1e5274

Review URL: https://codereview.chromium.org/1811723002
2016-03-17 10:51:27 -07:00
bungeman
43812e24cb Revert of free -> reset (patchset #3 id:40001 of https://codereview.chromium.org/1811723002/ )
Reason for revert:
Suspect for Win10 failures.

Original issue's description:
> free -> reset
>
> The C++ standard library uses ".reset()" where we sometimes write ".free()".
> We also use ".reset()" quite a lot.  This standardizes on ".reset()".
>
> This is one more step towards dropping SkAutoTDelete in favor of the standard
> std::unique_ptr.
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1811723002
>
> Committed: https://skia.googlesource.com/skia/+/0e3738db89e86035ed5d4f629bf58b817b1e5274

TBR=reed@google.com,mtklein@google.com,mtklein@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1813843002
2016-03-17 09:53:58 -07:00
mtklein
0e3738db89 free -> reset
The C++ standard library uses ".reset()" where we sometimes write ".free()".
We also use ".reset()" quite a lot.  This standardizes on ".reset()".

This is one more step towards dropping SkAutoTDelete in favor of the standard
std::unique_ptr.

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

Review URL: https://codereview.chromium.org/1811723002
2016-03-17 05:36:18 -07:00
mtklein
cc864c336d Add back SkAutoTDelete::detach() for Android temporarily.
TBR=

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

Review URL: https://codereview.chromium.org/1811483004
2016-03-16 17:33:54 -07: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
mtklein
5f939ab658 Use std::unique_ptr.
TBR=reed@google.com

Committed: https://skia.googlesource.com/skia/+/20c1e3abfc681771f73eb19fde7284196e028940

Committed: https://skia.googlesource.com/skia/+/3dd9ed37c24611af86f0fe374bd3698b63f09450
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1780933003

Committed: https://skia.googlesource.com/skia/+/2691d76a06e1af6282f8b3a3140cc93361be10c4

Review URL: https://codereview.chromium.org/1780933003
2016-03-16 10:28:35 -07:00
mtklein
e7ec417268 Revert of Use std::unique_ptr. (patchset #10 id:170001 of https://codereview.chromium.org/1780933003/ )
Reason for revert:
aww jeez, I dropped ps 8...

Original issue's description:
> Use std::unique_ptr.
>
> TBR=reed@google.com
>
> Committed: https://skia.googlesource.com/skia/+/20c1e3abfc681771f73eb19fde7284196e028940
>
> Committed: https://skia.googlesource.com/skia/+/3dd9ed37c24611af86f0fe374bd3698b63f09450
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1780933003
>
> Committed: https://skia.googlesource.com/skia/+/2691d76a06e1af6282f8b3a3140cc93361be10c4

TBR=bungeman@google.com,mtklein@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1809693002
2016-03-16 10:03:15 -07:00
mtklein
2691d76a06 Use std::unique_ptr.
TBR=reed@google.com

Committed: https://skia.googlesource.com/skia/+/20c1e3abfc681771f73eb19fde7284196e028940

Committed: https://skia.googlesource.com/skia/+/3dd9ed37c24611af86f0fe374bd3698b63f09450
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1780933003

Review URL: https://codereview.chromium.org/1780933003
2016-03-16 08:39:42 -07:00
mtklein
218c846ac0 Revert of Use std::unique_ptr. (patchset #8 id:130001 of https://codereview.chromium.org/1780933003/ )
Reason for revert:
Another Android ambiguity due to implicit bool...

frameworks/base/core/jni/android/graphics/Utils.cpp:110:35: error: call of overloaded 'SkMemoryStream(SkAutoTUnref<SkData>&)' is ambiguous
     return new SkMemoryStream(data);

Original issue's description:
> Use std::unique_ptr.
>
> TBR=reed@google.com
>
> Committed: https://skia.googlesource.com/skia/+/20c1e3abfc681771f73eb19fde7284196e028940
>
> Committed: https://skia.googlesource.com/skia/+/3dd9ed37c24611af86f0fe374bd3698b63f09450

TBR=bungeman@google.com,mtklein@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1785353002
2016-03-11 06:10:30 -08:00
mtklein
3dd9ed37c2 Use std::unique_ptr.
TBR=reed@google.com

Committed: https://skia.googlesource.com/skia/+/20c1e3abfc681771f73eb19fde7284196e028940

Review URL: https://codereview.chromium.org/1780933003
2016-03-11 05:18:48 -08:00
bungeman
dd67e3d1b3 Add SkScalarTruncToScalar and speed up SkScalarFraction.
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1783583003

Review URL: https://codereview.chromium.org/1783583003
2016-03-10 13:39:30 -08:00
mtklein
977c07dad2 Revert of Use std::unique_ptr. (patchset #7 id:120001 of https://codereview.chromium.org/1780933003/ )
Reason for revert:
Now we remember!  The problem was Clank:

https://build.chromium.org/p/tryserver.chromium.android/builders/android_clang_dbg_recipe/builds/34329

Original issue's description:
> Use std::unique_ptr.
>
> TBR=reed@google.com
>
> Committed: https://skia.googlesource.com/skia/+/20c1e3abfc681771f73eb19fde7284196e028940

TBR=bungeman@google.com,mtklein@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1782973002
2016-03-10 11:31:27 -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
mtklein
20c1e3abfc Use std::unique_ptr.
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1780933003
2016-03-10 10:10:03 -08:00
joshualitt
b0666ad3a9 Fix up GrAuditTrail to allow arbitrary reordering
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1765123002

Review URL: https://codereview.chromium.org/1765123002
2016-03-08 10:43:42 -08:00
bungeman
c901c11549 Add element_type, swap, operators, fix reset on sk_sp.
The 'element_type' typedef is to play nice with std::pointer_traits.

The full complement of operators and swap to match unique_ptr so that
sk_sp can be properly compared to nullptr and used with standard
containers.

Update to 'reset' so that calling 'unref' is the last operation.

This also adds tests for these changes, and sets the fPtr to nullptr
in debug for easier bug finding.

Review URL: https://codereview.chromium.org/1773453002
2016-03-08 08:35:23 -08:00
cdalton
28f45b949a Add "sample locations" feature to GrProcessor
Adds a "sample locations" feature to GrProcessor. When enabled, this
allows a processor to know inside the shader where all the samples are
located. Also adds various infastructure to query, cache, and identify
multisample data.

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

Review URL: https://codereview.chromium.org/1717393002
2016-03-07 13:58:26 -08:00
reed
f70b531daa Move annotations to canvas virtual (patchset #8 id:140001 of https://codereview.chromium.org/1744103002/ )"
Need to land chrome change first https://codereview.chromium.org/1766723003/

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

TBR=

Review URL: https://codereview.chromium.org/1758023003
2016-03-04 16:36:20 -08:00
halcanary
91fcb3ed58 SkPDF: PDFDevice use SkTArray<T> rather than SkTDArray<T*>
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1767713002

Review URL: https://codereview.chromium.org/1767713002
2016-03-04 13:53:22 -08:00
halcanary
7b0b2ca435 Make Cmake work with debug build
Before this CL, the following failed to link:

    cd .../skia
    git fetch
    git checkout origin/master
    git clean -ffdx
    SKIA="$PWD"
    cd $(mktemp -d);
    cmake "${SKIA}/cmake" -DCMAKE_BUILD_TYPE=Debug -G Ninja
    ninja
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1757993006

Review URL: https://codereview.chromium.org/1757993006
2016-03-04 08:30:05 -08:00
reed
1610835624 Revert of move annotations to canvas virtual (patchset #8 id:140001 of https://codereview.chromium.org/1744103002/ )
Reason for revert:
need to update unittest in blink:

FAILED: /b/build/goma/gomacc ../../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF obj/third_party/WebKit/Source/core/page/webkit_unit_tests.PrintContextTest.o.d -DV8_DEPRECATION_WARNINGS -DCLD_VERSION=2 -D__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORE=0 -DCHROMIUM_BUILD -DCR_CLANG_REVISION=261368-1 -DCOMPONENT_BUILD -DUSE_LIBJPEG_TURBO=1 -DENABLE_WEBRTC=1 -DENABLE_MEDIA_ROUTER=1 -DENABLE_PEPPER_CDMS -DENABLE_CONFIGURATION_POLICY -DENABLE_NOTIFICATIONS -DENABLE_TOPCHROME_MD=1 -DDCHECK_ALWAYS_ON=1 -DFIELDTRIAL_TESTING_ENABLED -DENABLE_TASK_MANAGER=1 -DENABLE_EXTENSIONS=1 -DENABLE_PDF=1 -DENABLE_PLUGIN_INSTALLATION=1 -DENABLE_PLUGINS=1 -DENABLE_SESSION_SERVICE=1 -DENABLE_THEMES=1 -DENABLE_AUTOFILL_DIALOG=1 -DENABLE_PRINTING=1 -DENABLE_BASIC_PRINTING=1 -DENABLE_PRINT_PREVIEW=1 -DENABLE_SPELLCHECK=1 -DUSE_BROWSER_SPELLCHECKER=1 -DENABLE_CAPTIVE_PORTAL_DETECTION=1 -DENABLE_APP_LIST=1 -DENABLE_SETTINGS_APP=1 -DENABLE_SUPERVISED_USERS=1 -DENABLE_SERVICE_DISCOVERY=1 -DV8_USE_EXTERNAL_STARTUP_DATA -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DBLINK_IMPLEMENTATION=1 -DINSIDE_BLINK -DMOJO_USE_SYSTEM_IMPL -DGTEST_HAS_POSIX_RE=0 -DGTEST_LANG_CXX11=0 -DSKIA_DLL -DGR_GL_IGNORE_ES3_MSAA=0 -DSK_SUPPORT_GPU=1 -DSK_IGNORE_LINEONLY_AA_CONVEX_PATH_OPTS -DU_USING_ICU_NAMESPACE=0 -DU_ENABLE_DYLOAD=0 -DCHROME_PNG_WRITE_SUPPORT -DPNG_USER_CONFIG -DENABLE_LAYOUT_UNIT_IN_INLINE_BOXES=0 -DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1 -DENABLE_INPUT_MULTIPLE_FIELDS_UI=1 -DWTF_USE_ICCJPEG=1 -DWTF_USE_QCMSLIB=1 -DENABLE_OILPAN=1 -DUNIT_TEST -DGTEST_HAS_RTTI=0 -DV8_SHARED -DUSING_V8_SHARED -DUSE_LIBPCI=1 -DUSE_OPENSSL=1 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DWTF_USE_DYNAMIC_ANNOTATIONS=1 -Igen -I../../third_party/WebKit/public/web -I../../third_party/WebKit/Source/web -I../../third_party/WebKit/Source/web/src -I../../third_party/WebKit/public/web/mac -I../.. -I../../skia/config -I../../third_party/WebKit/Source -I../../third_party/khronos -I../../gpu -Igen/angle -I../../third_party/WebKit -I../../skia/ext -I../../third_party/skia/include/core -I../../third_party/skia/include/effects -I../../third_party/skia/include/pdf -I../../third_party/skia/include/gpu -I../../third_party/skia/include/lazy -I../../third_party/skia/include/pathops -I../../third_party/skia/include/pipe -I../../third_party/skia/include/ports -I../../third_party/skia/include/utils -I../../third_party/skia/include/utils/mac -I../../third_party/icu/source/common -I../../third_party/npapi -I../../third_party/npapi/bindings -I../../third_party/libpng -I../../third_party/ots/include -I../../third_party/qcms/src -I../../third_party/iccjpeg -I../../third_party/libjpeg_turbo -I../../third_party/WebKit -I../../third_party/icu/source/i18n -I../../testing/gmock/include -I../../testing/gtest/include -I../../third_party/libwebp -I../../third_party/zlib -I../../v8/include -Igen/blink -isysroot /Applications/Xcode5.1.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -O0 -fvisibility=hidden -Werror -mmacosx-version-min=10.6 -arch x86_64 -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-selector-type-mismatch -Wpartial-availability -Wheader-hygiene -Wno-char-subscripts -Wno-unneeded-internal-declaration -Wno-covered-switch-default -Wstring-conversion -Wno-c++11-narrowing -Wno-deprecated-register -Wno-inconsistent-missing-override -Wno-shift-negative-value -Wexit-time-destructors -std=c++11 -stdlib=libc++ -fno-rtti -fno-exceptions -fvisibility-inlines-hidden -fno-threadsafe-statics -Xclang -load -Xclang /b/build/slave/mac/build/src/third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.dylib -Xclang -add-plugin -Xclang find-bad-constructs -Xclang -plugin-arg-find-bad-constructs -Xclang check-templates -Xclang -plugin-arg-find-bad-constructs -Xclang follow-macro-expansion -fcolor-diagnostics -fno-strict-aliasing -Xclang -load -Xclang /b/build/slave/mac/build/src/third_party/llvm-build/Release+Asserts/lib/libBlinkGCPlugin.dylib -Xclang -add-plugin -Xclang blink-gc-plugin -Xclang -plugin-arg-blink-gc-plugin -Xclang enable-oilpan -Xclang -plugin-arg-blink-gc-plugin -Xclang warn-raw-ptr -fstack-protector-all  -c ../../third_party/WebKit/Source/core/page/PrintContextTest.cpp -o obj/third_party/WebKit/Source/core/page/webkit_unit_tests.PrintContextTest.o
../../third_party/WebKit/Source/core/page/PrintContextTest.cpp:54:20: error: no member named 'getAnnotation' in 'SkPaint'
        if (!paint.getAnnotation())
             ~~~~~ ^

Original issue's description:
> move annotations to canvas virtual
>
> In an effort to do it all at once, this change assumes that its ok to ignore annotations that were previously stored on paints in old SKP files (since this feature is only interesting to PDF printing).
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1744103002
>
> Committed: https://skia.googlesource.com/skia/+/0eda2587cc9233066cb3f3fec08f35c061780f8e

TBR=halcanary@google.com,fmalita@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1761793003
2016-03-03 09:14:36 -08:00
reed
0eda2587cc move annotations to canvas virtual
In an effort to do it all at once, this change assumes that its ok to ignore annotations that were previously stored on paints in old SKP files (since this feature is only interesting to PDF printing).

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

Review URL: https://codereview.chromium.org/1744103002
2016-03-03 08:13:54 -08:00
joshualitt
46b301d222 add /img/n/m endpoint to skiaserve
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1755563003

Review URL: https://codereview.chromium.org/1755563003
2016-03-02 08:32:37 -08:00
joshualitt
f55c364485 Wire up stack traces again
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1749163002

Review URL: https://codereview.chromium.org/1749163002
2016-03-02 08:11:34 -08:00
joshualitt
df3f2b0948 Move some GrAuditTrail fuctions to cpp file
TBR=ethannicholas@google.com
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1753753002

Review URL: https://codereview.chromium.org/1753753002
2016-03-01 07:47:56 -08:00
joshualitt
1d7decffbc SkDebugCanvas ignore batch bounds if they are offscreen
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1754633002

Review URL: https://codereview.chromium.org/1754633002
2016-03-01 07:15:52 -08:00
joshualitt
10d8fc29bc Render batch bounds as stroke rects
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1745063002

Review URL: https://codereview.chromium.org/1745063002
2016-02-29 11:15:06 -08:00
mtklein
15923c9e47 Modernize SkSpinlock.
- Use std::atomic directly.
 - No more need for SkPODSpinlock or SK_DECLARE_STATIC_SPINLOCK.

Now simple code like this works as you'd hope:
    static SkSpinlock gLock;

That is, it starts unlocked and there's no static initializer.

std::atomic_flag would make this terser and standard-guaranteed,
but ATOMIC_FLAG_INIT caused not-yet-implemented errors on MSVC 2013.
The generated code for this approach is identical.

It appears the implicit constructor is constexpr when all the member
initializers are.  I'm hoping this way of producing constexpr constructors
without typing "constexpr" gives us a way to eliminate more SkFoo / SkBaseFoo
distinctions and SK_DECLARE_STATIC_FOO.  This was certainly the easiest.

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

Review URL: https://codereview.chromium.org/1734383002
2016-02-29 10:14:38 -08:00
joshualitt
b95c772d45 Add abilitly to query audit trail for batches by draw op
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1745513002

Committed: https://skia.googlesource.com/skia/+/9b48a6e3f862076018cc7d63b180b6340f4873cd

Review URL: https://codereview.chromium.org/1745513002
2016-02-29 07:44:02 -08:00
joshualitt
08fc80704d Revert of Add abilitly to query audit trail for batches by draw op (patchset #4 id:60001 of https://codereview.chromium.org/1745513002/ )
Reason for revert:
kInvalidID conflicts with an older xCode #define

Original issue's description:
> Add abilitly to query audit trail for batches by draw op
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1745513002
>
> Committed: https://skia.googlesource.com/skia/+/9b48a6e3f862076018cc7d63b180b6340f4873cd

TBR=ethannicholas@google.com,jcgregorio@google.com,joshualitt@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1747893002
2016-02-29 06:32:24 -08:00
joshualitt
9b48a6e3f8 Add abilitly to query audit trail for batches by draw op
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1745513002

Review URL: https://codereview.chromium.org/1745513002
2016-02-29 05:20:38 -08:00
joshualitt
18d6b75829 Add batchlist managment to GrAuditTrail
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1724243004

Review URL: https://codereview.chromium.org/1724243004
2016-02-26 08:07:50 -08:00
caryclark
952538ed50 fix undefined signed shifts
The expression (1 << 31) is technically undefined.

Fixed the undefined shift referenced by this bug and
a few friends.

R=reed@google.com
BUG=skia:2285
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1737363002

Review URL: https://codereview.chromium.org/1737363002
2016-02-26 05:01:42 -08:00
ethannicholas
c85d9fbc0a GrAuditTrail can now be enabled/disabled at runtime
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1712753002

TBR=bsalomon@google.com
Doesn't actually change the public API

Review URL: https://codereview.chromium.org/1712753002
2016-02-18 13:45:40 -08:00
bungeman
a7e9f05119 Move SkTDArray to private.
TBR=reed
Moving to private is good.

Review URL: https://codereview.chromium.org/1707213002
2016-02-18 08:53:33 -08:00
joshualitt
adab5a2a4b fix comma in GrAuditTrail json
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1704133002

Review URL: https://codereview.chromium.org/1704133002
2016-02-18 05:04:39 -08:00
bungeman
bf521ff941 Move SkTArray to include/private.
TBR=reed
Agreed moving to private is good.

Review URL: https://codereview.chromium.org/1702073002
2016-02-17 13:13:44 -08:00
joshualitt
6b3cf73af5 Add batch information to json
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1705093002

Review URL: https://codereview.chromium.org/1705093002
2016-02-17 11:20:26 -08:00
benjaminwagner
f49c75a8f1 Move Google3-specific stack limitation logic to template classes.
Remove #ifdefs in other files.

Reapplies https://codereview.chromium.org/1656143003; removing the implicit constructors for GLPtr and GLPtrAlias resolves the build issue on Android.

Also reverts https://codereview.chromium.org/1663013004

Does not change the public API.

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

Review URL: https://codereview.chromium.org/1666203002
2016-02-05 07:02:38 -08:00
benjaminwagner
67e8bd2072 Revert of Move Google3-specific stack limitation logic to template classes. Remove #ifdefs in other files. (patchset #2 id:50001 of https://codereview.chromium.org/1656143003/ )
Reason for revert:
See https://codereview.chromium.org/1665603002

Original issue's description:
> Move Google3-specific stack limitation logic to template classes. Remove #ifdefs in other files.
>
> Does not change the public API.
>
> TBR=reed
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1656143003
>
> Committed: https://skia.googlesource.com/skia/+/c92159c8250c62cc47b7b63686538d61d54d2835

TBR=mtklein@google.com,reed@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1666503002
2016-02-02 16:01:39 -08:00
benjaminwagner
c92159c825 Move Google3-specific stack limitation logic to template classes. Remove #ifdefs in other files.
Does not change the public API.

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

Review URL: https://codereview.chromium.org/1656143003
2016-02-02 12:48:14 -08:00
mtklein
a766ca87bf de-proc sk_float_rsqrt
This is the first of many little baby steps to have us stop runtime-detecting NEON.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1616013003
CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

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

Review URL: https://codereview.chromium.org/1616013003
2016-01-26 07:40:30 -08:00
bungeman
1fce5584cf Work around vs2013sp2-3 bug in skstd::unique_ptr.
When compiling skstd::unique_ptr::compressed_base with the vc++ in
some intermediate service pack versions of Visual Studio 2013 the
compiler will crash with an internal compiler error. In the interest of
reducing headaches, work around this issue in skstd::unique_ptr until
std::unique_ptr can be used.

BUG=skia:4564

Review URL: https://codereview.chromium.org/1636503002
2016-01-25 13:00:34 -08:00
cjacek
c721196067 Fixed compilation on mingw.
Found and tested in mingw Firefox build. There are two problems:

- GCC doesn't support __vectorcall calling convention, so its usage needs to be #ifdefed
- GetProcAddress returns FARPROC type (a function pointer) and GCC requires an explicit cast to void*

Review URL: https://codereview.chromium.org/1589933002
2016-01-25 07:27:36 -08:00
mtklein
1138be45ea Revert of skstd -> std for unique_ptr (patchset #24 id:460001 of https://codereview.chromium.org/1436033003/ )
Reason for revert:
Still need an answer for SkAdvancedTypefaceMetrics (at least for Google3 iOS build).

Original issue's description:
> skstd -> std for unique_ptr
>
> TBR=reed@google.com
> No public API changes.
>
> BUG=skia:4564
>
> Committed: https://skia.googlesource.com/skia/+/755c553c17b82bb5de3d9cc8d3b2a866ff9e9e50
>
> CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Mac10.9-Clang-x86_64-Release-CMake-Trybot,Build-Ubuntu-GCC-x86_64-Debug-CrOS_Link-Trybot;client.skia:Perf-Mac10.9-Clang-MacMini6.2-CPU-AVX-x86_64-Release-Trybot,Test-iOS-Clang-iPad4-GPU-SGX554-Arm7-Release-Trybot
>
> Committed: https://skia.googlesource.com/skia/+/06189155d987db5c7e69015f6ea87c2168d6a065
>
> Committed: https://skia.googlesource.com/skia/+/70e8dfca4a7f5bce97b8021a6e378c4828b09c8c
>
> Committed: https://skia.googlesource.com/skia/+/dadfc245cc9a0279ff7b73da3344f2ca5d139907
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1436033003
>
> Committed: https://skia.googlesource.com/skia/+/ccf1de0d9aa75f29829f1c4c462214b991fd8c9e

TBR=bungeman@google.com,mtklein@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:4564

Review URL: https://codereview.chromium.org/1626873004
2016-01-24 19:49:24 -08:00
mtklein
ccf1de0d9a skstd -> std for unique_ptr
TBR=reed@google.com
No public API changes.

BUG=skia:4564

Committed: https://skia.googlesource.com/skia/+/755c553c17b82bb5de3d9cc8d3b2a866ff9e9e50

CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Mac10.9-Clang-x86_64-Release-CMake-Trybot,Build-Ubuntu-GCC-x86_64-Debug-CrOS_Link-Trybot;client.skia:Perf-Mac10.9-Clang-MacMini6.2-CPU-AVX-x86_64-Release-Trybot,Test-iOS-Clang-iPad4-GPU-SGX554-Arm7-Release-Trybot

Committed: https://skia.googlesource.com/skia/+/06189155d987db5c7e69015f6ea87c2168d6a065

Committed: https://skia.googlesource.com/skia/+/70e8dfca4a7f5bce97b8021a6e378c4828b09c8c

Committed: https://skia.googlesource.com/skia/+/dadfc245cc9a0279ff7b73da3344f2ca5d139907
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1436033003

Review URL: https://codereview.chromium.org/1436033003
2016-01-24 19:18:54 -08:00
mtklein
ed814f34c7 Revert of de-proc sk_float_rsqrt (patchset #3 id:40001 of https://codereview.chromium.org/1616013003/ )
Reason for revert:
This is somehow blocking the Google3 roll in ways neither Ben nor I understand.  Precautionary revert... will try again Monday.

Original issue's description:
> de-proc sk_float_rsqrt
>
> This is the first of many little baby steps to have us stop runtime-detecting NEON.
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1616013003
> CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot
>
> Committed: https://skia.googlesource.com/skia/+/efcc125acd2d71eb077caf6db65fdd6b9eb1dc0d

TBR=reed@google.com,mtklein@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1629503002
2016-01-22 11:51:40 -08:00
mtklein
efcc125acd de-proc sk_float_rsqrt
This is the first of many little baby steps to have us stop runtime-detecting NEON.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1616013003
CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

Review URL: https://codereview.chromium.org/1616013003
2016-01-22 08:49:26 -08:00
joshualitt
4e8f567fa3 add wait on fence without flush
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1610183002

Review URL: https://codereview.chromium.org/1610183002
2016-01-20 10:54:58 -08:00
joshualitt
11fae87d39 Virtualize Frames in GrAuditTrail
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1581943004

Review URL: https://codereview.chromium.org/1581943004
2016-01-14 10:58:07 -08:00
joshualitt
87a721b246 Convert GrAuditTrail to use scoped frames
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1579193002

Review URL: https://codereview.chromium.org/1579193002
2016-01-12 12:59:28 -08:00
joshualitt
086cee12de Add batch names and bounds to json debug information
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1577093003

Review URL: https://codereview.chromium.org/1577093003
2016-01-12 06:45:24 -08:00
joshualitt
5651ee6376 Change to wire up opnames in SkGpuDevice
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1565113004

Review URL: https://codereview.chromium.org/1565113004
2016-01-11 10:39:11 -08:00
bungeman
0e101667d6 Use ::std for is_empty, is_class, add_xxx_reference, remove decay.
SkTLogic.h contains implemenetations of is_empty, is_class, decay,
decay_t, add_lvalue_reference, add_rvalue_reference, and
add_rvalue_reference_t. The declaration of is_class is only used by
is_empty. The current implementation of is_empty will not work
correctly with 'final'. The current implementation of
add_lvalue_reference does not support clarifications in c++17. No Skia
code is currently using decay, decay_t, add_rvalue_reference, and
add_rvalue_reference_t. In addition, there are no known issues with
any of these in ::std with any supported compiler.

The implementations of is_function and is_convertible are commented to
note why they are still present.

Review URL: https://codereview.chromium.org/1567123006
2016-01-08 11:05:09 -08:00
joshualitt
de8dc7e920 Reland of Make a single GrSingleOwner in GrContext (patchset #1 id:1 of https://codereview.chromium.org/1565303003/ )
Reason for revert:
trying again

Original issue's description:
> Revert of Make a single GrSingleOwner in GrContext (patchset #3 id:40001 of https://codereview.chromium.org/1563703004/ )
>
> Reason for revert:
> breaking asan
>
> Original issue's description:
> > Make a single GrSingleOwner in GrContext
> >
> > TBR=bsalomon@google.com
> > BUG=skia:
> > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1563703004
> >
> > Committed: https://skia.googlesource.com/skia/+/f9bc796e0dbd31674c22b34761913ee6e8fdd66a
>
> TBR=robertphillips@google.com,joshualitt@chromium.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/94da292e39db0d41da08b1d6055ca5e0d6b498cc

TBR=robertphillips@google.com,joshualitt@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1572653002
2016-01-08 10:09:13 -08:00
joshualitt
27a48dc0cd Create stub GrAuditTrail class
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1572553002

Review URL: https://codereview.chromium.org/1572553002
2016-01-08 07:19:47 -08:00
joshualitt
94da292e39 Revert of Make a single GrSingleOwner in GrContext (patchset #3 id:40001 of https://codereview.chromium.org/1563703004/ )
Reason for revert:
breaking asan

Original issue's description:
> Make a single GrSingleOwner in GrContext
>
> TBR=bsalomon@google.com
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1563703004
>
> Committed: https://skia.googlesource.com/skia/+/f9bc796e0dbd31674c22b34761913ee6e8fdd66a

TBR=robertphillips@google.com,joshualitt@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1565303003
2016-01-07 13:22:24 -08:00
bungeman
de029d0e41 More <type_traits> for SkTLogic.h.
SkTLogic.h specifies a number of declarations now found in
<type_traits>. This removes some of these declarations from SkTLogic.h
in favor of the ::std versions. These declarations are fairly safe to
change as the implementations are striaght forward and no known stl
implementations are known to have issues with them.

Review URL: https://codereview.chromium.org/1565283003
2016-01-07 12:39:11 -08:00
joshualitt
f9bc796e0d Make a single GrSingleOwner in GrContext
TBR=bsalomon@google.com
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1563703004

Review URL: https://codereview.chromium.org/1563703004
2016-01-07 11:32:40 -08:00
reed
bfd5f171e6 Revert[2] of "add backdrop option to SaveLayerRec"
Reverted because of picture/serialization failure

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

TBR=mtklein

Review URL: https://codereview.chromium.org/1567063002
2016-01-07 11:28:08 -08:00
reed
0575cb2def Revert of add backdrop option to SaveLayerRec (patchset #14 id:260001 of https://codereview.chromium.org/1523053003/ )
Reason for revert:
serialized != direct, will investigate

Original issue's description:
> add backdrop option to SaveLayerRec
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1523053003
>
> Committed: https://skia.googlesource.com/skia/+/247415969a9a5ed6c83cc09395472416c4b7de7f

TBR=robertphillips@google.com,bsalomon@google.com,mtklein@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1565203002
2016-01-07 08:15:10 -08:00
reed
247415969a add backdrop option to SaveLayerRec
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1523053003

Review URL: https://codereview.chromium.org/1523053003
2016-01-07 07:44:35 -08:00
joshualitt
5b1dec7cde Add additional assert to GrSingleOwner
TBR=bsalomon@google.com
TBR=mtklein@google.com
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1566703003

Review URL: https://codereview.chromium.org/1566703003
2016-01-06 09:25:14 -08:00
bungeman
54e6308219 Add skstd::remove_pointer_t and use it.
This replaces an existing incomplete implementation. This also makes
it easier to update the current use in the future when switching to
<type_traits>.

Review URL: https://codereview.chromium.org/1555153002
2016-01-06 08:30:59 -08:00