Commit Graph

16726 Commits

Author SHA1 Message Date
kkinnunen
fa77eb1e51 Add image as a draw type that can be filtered
Add image as a draw type that can be filtered.

This is needed when SkImage is added as an object to be drawn so that
the draw is forwarded to SkBaseDevice. This would be used in making
filters use SkImages.

BUG=skia:3388

Review URL: https://codereview.chromium.org/960783003
2015-03-05 00:39:45 -08:00
msarett
c877a71b35 4x library for NEON
CQ_EXTRA_TRYBOTS=client.skia.android:Test-Android-Nexus5-Adreno330-Arm7-Debug-Trybot

BUG=skia:

Review URL: https://codereview.chromium.org/975303003
2015-03-04 15:55:54 -08:00
mtklein
82b33dbcb2 DM: no PDF for Daisy either
BUG=skia:

Review URL: https://codereview.chromium.org/974413002
2015-03-04 13:58:05 -08:00
reed
b7affb56bb udpate dox for colorfilter fragment processor requirements
BUG=skia:
NOTRY=True

Review URL: https://codereview.chromium.org/961933003
2015-03-04 13:30:50 -08:00
caryclark
94b4ee85f2 (starting with mtklein's 966503002 mod to 963593003)
fix casts

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

Review URL: https://codereview.chromium.org/979453004
2015-03-04 12:32:22 -08:00
bsalomon
6ba6fa1526 Improve tracking of bound FBOs in GrGLGpu.
Committed: https://skia.googlesource.com/skia/+/d2ad8eb5801e2c8c0fa544a6a776bb46eedde2a0

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

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

Review URL: https://codereview.chromium.org/949263002
2015-03-04 11:57:37 -08:00
mtklein
84aada88ca DM: run PDF except on Android bots.
While we work out RAM issues on Android, run everywhere else.

BUG=skia:

Review URL: https://codereview.chromium.org/971463004
2015-03-04 11:47:11 -08:00
mtklein
a84cff9b99 Revert of fix casts (patchset #1 id:1 of https://codereview.chromium.org/979453004/)
Reason for revert:
64-bit windows build warnings-as-errors

Original issue's description:
> (starting with mtklein's 966503002 mod to 963593003)
> fix casts
>
> Committed: https://skia.googlesource.com/skia/+/9e73a84deb5e6c201081b1d30175863898543e8d

TBR=caryclark@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/977583007
2015-03-04 11:46:27 -08:00
mtklein
4e644f5d50 Update SkPMFloat API a bit.
Instead of set(SkPMColor), add a constructor SkPMFloat(SkPMColor).
Replace setA(), setR(), etc. with a 4 float constructor.

And, promise to stick to SkPMColor order.

BUG=skia:

Review URL: https://codereview.chromium.org/977773002
2015-03-04 11:25:27 -08:00
caryclark
9e73a84deb (starting with mtklein's 966503002 mod to 963593003)
fix casts

Review URL: https://codereview.chromium.org/979453004
2015-03-04 11:22:05 -08:00
fmalita
85d5eb9294 Pass blob bounds to the looper, if available
R=robertphillips@google.com,reed@google.com

Review URL: https://codereview.chromium.org/979943002
2015-03-04 11:20:12 -08:00
bsalomon
ea8b55db88 simplify logic in SkPerliNoiseShader for GPU when constant color
BUG=skia:3488

Review URL: https://codereview.chromium.org/974183002
2015-03-04 11:03:52 -08:00
hendrikw
876c3132d7 skia: Add tracing for skia's budget
We've run into several places where GPU rasterization slows down a lot,
and in some cases, it's due to use reaching skia's budget.  This shows a
graph of skia's used and free budgeted memory.

Review URL: https://codereview.chromium.org/977143002
2015-03-04 10:33:50 -08:00
mtklein
8c7ba092a6 Add SSSE3 implementation for SkPMFloat, with faster get() and set().
With SSSE3, we can use the Swiss Army Knife byte shuffler pshufb,
a.k.a. _mm_shuffle_epi8(), to jump directly between 32 and 128 bits.

In microbench isolation, this looks like an additional 10-15% speedup:

SkPMFloat_get:   2.35ns -> 1.98ns
SkPMFloat_clamp: 2.35ns -> 2.18ns

Before this CL, get() and clamp() were identical code.  The _get benchmark improves because both set() and get() become faster; the _clamp benchmark shows the improvement from set() getting faster with clamp() staying the same.

BUG=skia:

Review URL: https://codereview.chromium.org/976493002
2015-03-04 10:18:10 -08:00
joshualitt
b8410601e4 Revert of Adding linear interpolation to rgb->yuv conversion (patchset #1 id:1 of https://codereview.chromium.org/973563002/)
Reason for revert:
Speculative revert to see if this unblocks the deps roll

Original issue's description:
> Adding linear interpolation to rgb->yuv conversion
>
> When the UV planes are smaller than the Y plane, doing the upscaling in nearest mode was creating artefacts, so I changed it to use linear interpolation to fix the issue.
>
> BUG=460380
>
> Committed: https://skia.googlesource.com/skia/+/cd9d42c5167a50f1bf20e969343556d61354171b

TBR=bsalomon@google.com,scroggo@google.com,reed@google.com,sugoi@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=460380

Review URL: https://codereview.chromium.org/977133002
2015-03-04 09:56:09 -08:00
reed
01849ac16a disable chatting debugf
BUG=skia:
TBR=bsalomon@google.com

Review URL: https://codereview.chromium.org/974883005
2015-03-04 07:51:37 -08:00
hendrikw
f72558e574 Fix uninitialized variable in GrGpu
Stumbled on this while running a trace.

Review URL: https://codereview.chromium.org/975993002
2015-03-04 06:22:18 -08:00
fmalita
024f996c1d Text blob run paints should be filtered.
We're constructing blob run paints after the canvas draw filter has been
applied.

Instead, we need do defer text blob draw filters until we have access
to the full run paints.

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

Review URL: https://codereview.chromium.org/973973003
2015-03-03 19:08:17 -08:00
sugoi
cd9d42c516 Adding linear interpolation to rgb->yuv conversion
When the UV planes are smaller than the Y plane, doing the upscaling in nearest mode was creating artefacts, so I changed it to use linear interpolation to fix the issue.

BUG=460380

Review URL: https://codereview.chromium.org/973563002
2015-03-03 13:28:30 -08:00
robertphillips
193ea935b0 Split GrTargetCommands into its own files
Review URL: https://codereview.chromium.org/979493002
2015-03-03 12:40:50 -08:00
Eric Boren
030854eb92 Run gyp on Win with --no-parallel -G config=$(BUILDTYPE), fix pylint
The previous change didn't affect Windows...

BUG=skia:3287
R=mtklein@google.com

Review URL: https://codereview.chromium.org/975803002
2015-03-03 13:15:38 -05:00
scroggo
f9b31ebc79 Return to building libpng_static off of Android.
Fixes the fix in https://codereview.chromium.org/971243003/, to
build places that are not Android.

TBR=mtklein@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/973863002
2015-03-03 09:39:58 -08:00
scroggo
3b234f737b Build the Android version of PNG on Android.
Fixes Android build failures.

Android builds a custom version of libpng (instead of the one
determined by skia_libpng_static) which supplies extra needed
functions.

TBR=mtklein@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/971243003
2015-03-03 09:34:58 -08:00
robertphillips
dad7794dcb Split command holding object (GrTargetCommands) out of GrInOrderDrawBuffer
This is still a bit odd in that the IoDB and TargetCommands are annoyingly interwoven. This should improve a bit when batching is everywhere.

Joshua - I think you're lead on this.

Review URL: https://codereview.chromium.org/973853002
2015-03-03 09:28:16 -08:00
halcanary
47ef4d5d93 XPS, DM: add SkDocument::CreateXPS
-   SkDocument::CreateXPS() function added, returns NULL on non-Windows OS.

-   DM: (Windows only) an XPSSink is added, fails on non-Windows OS

-   DM: Common code for PDFSink::draw and XPSSink::draw are factored into
    draw_skdocument static function.

-   SkDocument_XPS (Windows only) implementation of SkDocument via
    SkXPSDevice.

-   SkDocument_XPS_None (non-Windows) returns NULL for
    SkDocument::CreateXPS().

-   gyp/xps.gyp refactored.

-   SkXPSDevice::drawTextOnPath removed (see http://crrev.com/925343003 )

-   SkXPSDevice::drawPath supports conics via SkAutoConicToQuads.

Review URL: https://codereview.chromium.org/963953002
2015-03-03 09:13:09 -08:00
scroggo
f24f2247c2 Add SkCodec, including PNG implementation.
DM:
Add a flag to use SkCodec instead of SkImageDecoder.

SkCodec:
Base class for codecs, allowing creation from an SkStream or an SkData.
An SkCodec, on creation, knows properties of the data like its width and height. Further calls can be used to generate the image.
TODO: Add scanline iterator

SkPngCodec:
New decoder for png. Wraps libpng. The code has been repurposed from SkImageDecoder_libpng.
TODO: Handle other destination colortypes
TODO: Substitute the transpose color
TODO: Allow silencing warnings
TODO: Use RGB instead of filler?
TODO: sRGB

SkSwizzler:
Simplified version of SkScaledSampler. Unlike the sampler, this object does no sampling.
TODO: Implement other swizzles.

Requires a gclient sync to pull down libpng.

BUG=skia:3257

Committed: https://skia.googlesource.com/skia/+/ca358852b4fed656d11107b2aaf28318a4518b49
(and then reverted)

Review URL: https://codereview.chromium.org/930283002
2015-03-03 08:59:20 -08:00
mtklein
0aebf5d0d3 Test and fix SkPMFloat rounding.
SSE rounds for free (that was a happy accident: they also have a truncating version).
NEON does not, nor obviously the portable code, so they add 0.5 before truncating.

NOPRESUBMIT=true

BUG=skia:

Review URL: https://codereview.chromium.org/974643002
2015-03-03 08:57:07 -08:00
halcanary
c2574f3657 Revert of XPS, DM: add SkDocument::CreateXPS (patchset #8 id:310001 of https://codereview.chromium.org/963953002/)
Reason for revert:
breaking iOS build.

Original issue's description:
> XPS, DM: add SkDocument::CreateXPS
>
> -   SkDocument::CreateXPS() function added, returns NULL on non-Windows OS.
>
> -   DM: (Windows only) an XPSSink is added, fails on non-Windows OS
>
> -   DM: Common code for PDFSink::draw and XPSSink::draw are factored into
>     draw_skdocument static function.
>
> -   SkDocument_XPS (Windows only) implementation of SkDocument via
>     SkXPSDevice.
>
> -   SkDocument_XPS_None (non-Windows) returns NULL for
>     SkDocument::CreateXPS().
>
> -   gyp/xps.gyp refactored.
>
> -   SkXPSDevice::drawTextOnPath removed (see http://crrev.com/925343003 )
>
> -   SkXPSDevice::drawPath supports conics via SkAutoConicToQuads.
>
> NOPRESUBMIT=true
>
> Committed: https://skia.googlesource.com/skia/+/00d39bcbfc8394a9b48b86b04ab06ec19091fa43

TBR=reed@google.com,bungeman@google.com,mtklein@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/978443002
2015-03-03 08:34:14 -08:00
halcanary
00d39bcbfc XPS, DM: add SkDocument::CreateXPS
-   SkDocument::CreateXPS() function added, returns NULL on non-Windows OS.

-   DM: (Windows only) an XPSSink is added, fails on non-Windows OS

-   DM: Common code for PDFSink::draw and XPSSink::draw are factored into
    draw_skdocument static function.

-   SkDocument_XPS (Windows only) implementation of SkDocument via
    SkXPSDevice.

-   SkDocument_XPS_None (non-Windows) returns NULL for
    SkDocument::CreateXPS().

-   gyp/xps.gyp refactored.

-   SkXPSDevice::drawTextOnPath removed (see http://crrev.com/925343003 )

-   SkXPSDevice::drawPath supports conics via SkAutoConicToQuads.

NOPRESUBMIT=true

Review URL: https://codereview.chromium.org/963953002
2015-03-03 08:26:00 -08:00
mtklein
60ff4582ae Trim the fat off SkPMFloat bench.
This bench was ~75% overhead, ~25% good bench.  It is now just about the
opposite: about 30% of the runtime is loop and random number overhead, and
about 70% of the time is spent doing SkPMColor <-> SkPMFloat work.

BUG=skia:

NOPRESUBMIT=true

Review URL: https://codereview.chromium.org/968133005
2015-03-03 08:03:27 -08:00
mtklein
60d2a32b2d Make SkPMFloats store floats in [0,255] instead of [0,1].
This pushes the cost of the *255 and *1/255 conversions onto only those code
paths that need it.  We're not doing it any more efficiently than can be done
with Sk4f.

In microbenchmark isolation, this is about a 15% speedup.

BUG=skia:
NOPRESUBMIT=true

Review URL: https://codereview.chromium.org/973603002
2015-03-03 07:46:15 -08:00
reed
cff10b21a9 change colorfilter to return an array of frag processors
BUG=skia:

Review URL: https://codereview.chromium.org/973593002
2015-03-03 06:41:45 -08:00
borenet
3ebb16df93 Run gyp with --no-parallel -G config=$(BUILDTYPE)
BUG=skia:3287

Review URL: https://codereview.chromium.org/972943003
2015-03-03 06:05:56 -08:00
mtklein
7ab4277185 Don't guarantee any particular color order for SkPMFloat. Hide fColor.
Also add a little note that get() may incidentally clamp.

BUG=skia:

Review URL: https://codereview.chromium.org/973553004
2015-03-02 14:07:14 -08:00
reed
8a8d841d48 add virtuals to optimize composing colorfilters
BUG=skia:

Review URL: https://codereview.chromium.org/968993004
2015-03-02 13:46:03 -08:00
bungeman
aae309111b Draw glyphs on Mac without font transform.
The transform on the font is increasingly going untested on Mac.
As a result, only use the transform on the context when possible.
This fixes color emoji on OSX10.2.

Review URL: https://codereview.chromium.org/975493002
2015-03-02 13:43:27 -08:00
caryclark
b421650e13 add double precision convex test
BUG=389050

Review URL: https://codereview.chromium.org/975523002
2015-03-02 13:02:34 -08:00
scroggo
ee1a726aed Revert of Add SkCodec, including PNG implementation. (patchset #24 id:460001 of https://codereview.chromium.org/930283002/)
Reason for revert:
Breaking windows bots all over the place :(

Original issue's description:
> Add SkCodec, including PNG implementation.
>
> DM:
> Add a flag to use SkCodec instead of SkImageDecoder.
>
> SkCodec:
> Base class for codecs, allowing creation from an SkStream or an SkData.
> An SkCodec, on creation, knows properties of the data like its width and height. Further calls can be used to generate the image.
> TODO: Add scanline iterator
>
> SkPngCodec:
> New decoder for png. Wraps libpng. The code has been repurposed from SkImageDecoder_libpng.
> TODO: Handle other destination colortypes
> TODO: Substitute the transpose color
> TODO: Allow silencing warnings
> TODO: Use RGB instead of filler?
> TODO: sRGB
>
> SkSwizzler:
> Simplified version of SkScaledSampler. Unlike the sampler, this object does no sampling.
> TODO: Implement other swizzles.
>
> BUG=skia:3257
>
> Committed: https://skia.googlesource.com/skia/+/ca358852b4fed656d11107b2aaf28318a4518b49

TBR=reed@google.com,djsollen@google.com,msarett@google.com,mtklein@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:3257

Review URL: https://codereview.chromium.org/972743003
2015-03-02 12:31:12 -08:00
scroggo
ca358852b4 Add SkCodec, including PNG implementation.
DM:
Add a flag to use SkCodec instead of SkImageDecoder.

SkCodec:
Base class for codecs, allowing creation from an SkStream or an SkData.
An SkCodec, on creation, knows properties of the data like its width and height. Further calls can be used to generate the image.
TODO: Add scanline iterator

SkPngCodec:
New decoder for png. Wraps libpng. The code has been repurposed from SkImageDecoder_libpng.
TODO: Handle other destination colortypes
TODO: Substitute the transpose color
TODO: Allow silencing warnings
TODO: Use RGB instead of filler?
TODO: sRGB

SkSwizzler:
Simplified version of SkScaledSampler. Unlike the sampler, this object does no sampling.
TODO: Implement other swizzles.

BUG=skia:3257

Review URL: https://codereview.chromium.org/930283002
2015-03-02 12:23:48 -08:00
joshualitt
d0f5457c5e valgrind fix
TBR=
BUG=skia:

Review URL: https://codereview.chromium.org/968873006
2015-03-02 12:00:52 -08:00
hcm
281bf5249c Add testing section of docs. Consolidated trybot/buildbot section
BUG=skia:

Preview link: http://skiadocs.com:8000/dev/testing/?cl=954523004

Review URL: https://codereview.chromium.org/954523004
2015-03-02 11:25:25 -08:00
joshualitt
cc1ac86275 small bug fix for batch asserts
BUG=skia:

Review URL: https://codereview.chromium.org/969043002
2015-03-02 11:23:07 -08:00
robertphillips
8f9e81684f Minor cleanup of GrInOrderDrawBuffer
Review URL: https://codereview.chromium.org/969813003
2015-03-02 10:12:17 -08:00
caryclark
5ccef57790 treat backwards quads as not convex
If a quad, cubic, or conic goes back on itself, assume it's not convex.
In a future CL, we could check to see if the curve is linear so that
linear curves are treated the same as lines.

BUG=skia:3469

Review URL: https://codereview.chromium.org/971773002
2015-03-02 10:07:56 -08:00
mtklein
341c808070 Revert of DM: run pdf config on the bots. (patchset #1 id:1 of https://codereview.chromium.org/968953002/)
Reason for revert:
Will try this again after investigating OOMs on Xoom, N5 (i.e. the bots that actually run non-GPU work like PDF).

Original issue's description:
> DM: run pdf config on the bots.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/b12f88152c87e006d04fade4f106669cd9e44677

TBR=stephana@google.com,halcanary@google.com,mtklein@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/959123003
2015-03-02 09:51:44 -08:00
senorblanco
a2b6d28755 Fix for out-of-bounds intersection (found by fuzzer).
Sometimes, the intersection returned by check_intersection() is
out-of-bounds for both edges (above both tops or below both bottoms)
due to floating-point inaccuracy. This causes split_edge() to create a
tiny negative-length edge on one side (which would then assert).
Although we could safely remove this assert and allow the negative
length edge to be removed, it's faster/safer to simply avoid its
creation in the first place by adjusting one edge to the other edge's
endpoint.

Added a new unit test to exercise this case.

Review URL: https://codereview.chromium.org/968993002
2015-03-02 09:34:13 -08:00
bungeman
b3310c2221 Set the ttcIndex on Mac onOpenStream.
Since on Mac onOpenStream always creates a new stream of a
non-collection font, be sure the out ttcIndex is always set to 0.

Review URL: https://codereview.chromium.org/975473002
2015-03-02 09:05:37 -08:00
mtklein
b12f88152c DM: run pdf config on the bots.
BUG=skia:

Review URL: https://codereview.chromium.org/968953002
2015-03-02 08:32:15 -08:00
huangs
9345eef3a0 [Skia] Add SK_API to SkParse.
For https://codereview.chromium.org/924063003/ , we would like to use the
SkParse::FindColor().  Adding SK_API to SkParse is necessary for component
build to work.

BUG=skia:

Review URL: https://codereview.chromium.org/971623003
2015-03-02 07:51:17 -08:00
robertphillips
7f966f4cf8 Increase GrInOrderDrawBuffer's encapsulation of trace markers
Greg - I think this is mainly you
Joshua - I did make a small batching change in onDrawBatch

Review URL: https://codereview.chromium.org/963183002
2015-03-02 06:40:12 -08:00