Commit Graph

17807 Commits

Author SHA1 Message Date
reed
4c21dc5ddf add drawImageNine
this also exposes nine-patch drawing directly to devices, and creates a shared iterator for unrolling a nine-patch into single rect->rect draws.

BUG=skia:

Review URL: https://codereview.chromium.org/1211583003
2015-06-25 12:32:03 -07:00
cdalton
b4022965a2 Add loopSKP flag to nanobench
Adds a loopSKP flag that forces SKPBenches to draw with only 1 loop.

BUG=skia:

Review URL: https://codereview.chromium.org/1203193002
2015-06-25 10:51:56 -07:00
mtklein
b0c5071a37 What did we learn today? 255 != 256
vcvt_n_f32_u32 and _u32_f32 work in power-of-2 fixed point, so (...,8)
meant 'please multiply or divide by 256'.  We need to use 255.  :(

BUG=skia:

Review URL: https://codereview.chromium.org/1204363002
2015-06-25 10:26:46 -07:00
mtklein
e9a3e3c17a Convert SkPMFloat to [0,1] range and prune its API.
Now that Sk4px exists, there's a lot less sense in eeking out every
cycle of speed from SkPMFloat: if we need to go _really_ fast, we
should use Sk4px.  SkPMFloat's going to be used for things that are
already slow: large-range intermediates, divides, sqrts, etc.

A [0,1] range is easier to work with, and can even be faster if we
eliminate enough *255 and *1/255 steps.  This is particularly true
on ARM, where NEON can do the *255 and /255 steps for us while
converting float<->int.

We have lots of experimental SkPMFloat <-> SkPMColor APIs that
I'm now removing.  Of the existing APIs, roundClamp() is the sanest,
so I've kept only that, now called round().  The 4-at-a-time APIs
never panned out, so they're gone.

There will be small diffs on:
colormatrix coloremoji colorfilterimagefilter fadefilter imagefilters_xfermodes imagefilterscropexpand imagefiltersgraph tileimagefilter

BUG=skia:

Review URL: https://codereview.chromium.org/1201343004
2015-06-25 08:56:28 -07:00
fmalita
538bacb4bb Revert of Cleanup legacy NVPR-related definitions (patchset #3 id:40001 of https://codereview.chromium.org/1177243004/)
Reason for revert:
Broke the GPU SAN bots: https://build.chromium.org/p/client.skia/builders/Test-Ubuntu-GCC-Golo-GPU-GT610-x86_64-Debug-ASAN/builds/779/steps/dm/logs/stdio

Original issue's description:
> Cleanup legacy NVPR-related definitions
>
> Fixed-function NVPR codepaths were removed a while ago. Only NVPR API
> version 1.3 (PathFragmentInputGen) was left working. Remove
> backwards-compatibility code that was left behind.
>
> Remove some NVPR API function typedefs that were left from initial
> commits.
>
> Remove PathCoords function pointer from GrGLInterface, it has
> never been called and causes problems in the future, since it will
> not be implemented in the Chromium pseudo extension.
>
> Committed: https://skia.googlesource.com/skia/+/fb8d6884e0e01d0c2f8596adf5af1efb0d08de7e

TBR=joshualitt@google.com,cdalton@nvidia.com,bsalomon@google.com,kkinnunen@nvidia.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1206333003
2015-06-25 08:42:24 -07:00
borenet
283714f0de Fix link error when running make tools with skia_shared_lib=1
I'm getting this error, which is fixed by this change:

[75/76] LINK skpdiff
FAILED: c++ -m64 -pie -Wl,-rpath=\$ORIGIN/lib/ -Wl,-rpath-link=lib/ -o skpdiff -Wl,--start-group obj/tools/skpdiff/skpdiff.skpdiff_main.o obj/tools/skpdiff/skpdiff.SkDiffContext.o obj/tools/skpdiff/skpdiff.SkImageDiffer.o obj/tools/skpdiff/skpdiff.SkPMetric.o obj/tools/skpdiff/skpdiff.skpdiff_util.o obj/tools/skpdiff/skpdiff.SkDifferentPixelsMetric_cpu.o obj/gyp/libflags.a obj/gyp/libpicture_utils.a -Wl,--end-group lib/libskia.so -lrt -lz
/usr/bin/ld: obj/tools/skpdiff/skpdiff.SkDiffContext.o: undefined reference to symbol 'pthread_mutexattr_settype@@GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

BUG=skia:

Review URL: https://codereview.chromium.org/1206333002
2015-06-25 08:05:19 -07:00
borenet
93558dc74b Add lua scripts for generating n-grams from SKPs
BUG=skia:3840

Review URL: https://codereview.chromium.org/1204283002
2015-06-25 07:47:41 -07:00
kkinnunen
fb8d6884e0 Cleanup legacy NVPR-related definitions
Fixed-function NVPR codepaths were removed a while ago. Only NVPR API
version 1.3 (PathFragmentInputGen) was left working. Remove
backwards-compatibility code that was left behind.

Remove some NVPR API function typedefs that were left from initial
commits.

Remove PathCoords function pointer from GrGLInterface, it has
never been called and causes problems in the future, since it will
not be implemented in the Chromium pseudo extension.

Review URL: https://codereview.chromium.org/1177243004
2015-06-25 02:06:56 -07:00
mtklein
b5e861185a Implement four more xfermodes with Sk4px.
HardLight, Overlay, Darken, and Lighten are all
~2x faster with SSE, ~25% faster with NEON.

This covers all previously-implemented NEON xfermodes.
3 previous SSE xfermodes remain.  Those need division
and sqrt, so I'm planning on using SkPMFloat for them.
It'll help the readability and NEON speed if I move that
into [0,1] space first.

The main new concept here is c.thenElse(t,e), which behaves like
(c ? t : e) except, of course, both t and e are evaluated.  This allows
us to emulate conditionals with vectors.

This also removes the concept of SkNb.  Instead of a standalone bool
vector, each SkNi or SkNf will just return their own types for
comparisons.  Turns out to be a lot more manageable this way.

BUG=skia:

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

CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Ubuntu-GCC-Arm64-Debug-Android-Trybot

Review URL: https://codereview.chromium.org/1196713004
2015-06-24 15:18:39 -07:00
mtklein
c0bdecb920 Revert of Switch SkJpegCode to libjpeg-turbo (patchset #11 id:540001 of https://codereview.chromium.org/1180983002/)
Reason for revert:
https://uberchromegw.corp.google.com/i/client.skia.compile/builders/Build-Ubuntu-GCC-MipsDSP2-Debug-Android/builds/1136/steps/build%20most/logs/stdio

Original issue's description:
> Add libjpeg-turbo library (depends on yasm)
> Mangle external function names to avoid conflict with libjpeg
> Take advantage of direct color conversion (RGBA, BGRA, 565)
> Prepare to use jpeg_skip_scanlines (when it is upstreamed)
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/b60c3f8291529303299262dba19b1a896060bd2d

TBR=scroggo@google.com,djsollen@google.com,emmaleer@google.com,msarett@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1199253006
2015-06-24 15:14:48 -07:00
msarett
b60c3f8291 Add libjpeg-turbo library (depends on yasm)
Mangle external function names to avoid conflict with libjpeg
Take advantage of direct color conversion (RGBA, BGRA, 565)
Prepare to use jpeg_skip_scanlines (when it is upstreamed)

BUG=skia:

Review URL: https://codereview.chromium.org/1180983002
2015-06-24 15:10:25 -07:00
bsalomon
47c1ccbcd8 Revert of remove workaround for dx9 angle slow rgba pixel ops (patchset #1 id:1 of https://codereview.chromium.org/1207003002/)
Reason for revert:
users are still on dx9 angle :(

Original issue's description:
> remove workaround for dx9 angle slow rgba pixel ops
>
> TBR=robertphillips@google.com
>
> Committed: https://skia.googlesource.com/skia/+/1e1adc33ba1acb9a2ad41c0a5a9b6166ee9d7a2a

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

Review URL: https://codereview.chromium.org/1205183002
2015-06-24 15:04:13 -07:00
mtklein
a981e74097 Add a 64-bit ARM builder to the CQ.
It's possible this rarely breaks, but I do write ARMv8 code frequently
enough that it'll help prevent broken trees.

BUG=skia:

Review URL: https://codereview.chromium.org/1209763003
2015-06-24 14:52:24 -07:00
mtklein
0cc1f0a8d5 Revert of Implement four more xfermodes with Sk4px. (patchset #16 id:290001 of https://codereview.chromium.org/1196713004/)
Reason for revert:
64-bit ARM build failures.

Original issue's description:
> Implement four more xfermodes with Sk4px.
>
> HardLight, Overlay, Darken, and Lighten are all
> ~2x faster with SSE, ~25% faster with NEON.
>
> This covers all previously-implemented NEON xfermodes.
> 3 previous SSE xfermodes remain.  Those need division
> and sqrt, so I'm planning on using SkPMFloat for them.
> It'll help the readability and NEON speed if I move that
> into [0,1] space first.
>
> The main new concept here is c.thenElse(t,e), which behaves like
> (c ? t : e) except, of course, both t and e are evaluated.  This allows
> us to emulate conditionals with vectors.
>
> This also removes the concept of SkNb.  Instead of a standalone bool
> vector, each SkNi or SkNf will just return their own types for
> comparisons.  Turns out to be a lot more manageable this way.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/b9d4163bebab0f5639f9c5928bb5fc15f472dddc

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

Review URL: https://codereview.chromium.org/1205703008
2015-06-24 14:30:43 -07:00
mtklein
b9d4163beb Implement four more xfermodes with Sk4px.
HardLight, Overlay, Darken, and Lighten are all
~2x faster with SSE, ~25% faster with NEON.

This covers all previously-implemented NEON xfermodes.
3 previous SSE xfermodes remain.  Those need division
and sqrt, so I'm planning on using SkPMFloat for them.
It'll help the readability and NEON speed if I move that
into [0,1] space first.

The main new concept here is c.thenElse(t,e), which behaves like
(c ? t : e) except, of course, both t and e are evaluated.  This allows
us to emulate conditionals with vectors.

This also removes the concept of SkNb.  Instead of a standalone bool
vector, each SkNi or SkNf will just return their own types for
comparisons.  Turns out to be a lot more manageable this way.

BUG=skia:

Review URL: https://codereview.chromium.org/1196713004
2015-06-24 14:27:36 -07:00
bsalomon
1e1adc33ba remove workaround for dx9 angle slow rgba pixel ops
TBR=robertphillips@google.com

Review URL: https://codereview.chromium.org/1207003002
2015-06-24 13:22:50 -07:00
bungeman
4760f32f2a Clarify iOS flush-to-zero status.
Modern processors support flush-to-zero and denormalized-are-zero
for floating point operations (with ARM NEON unable to disable them).
However, iOS on ARM is the only current system which defaults
processes to using both all the time. However, this is only iOS on
ARM, iOS on x86 (the simulator) does not. Correctly defining this
allows the math tests to run error free in the simulator.

Review URL: https://codereview.chromium.org/1203533003
2015-06-24 13:08:52 -07:00
herb
0c752f4760 Cleanup: Comment and ordering changes.
This should be a whitespace only change.
BUG=skia:

Review URL: https://codereview.chromium.org/1194423004
2015-06-24 13:06:21 -07:00
jvanverth
98a83a9f06 Add default for GrGLSLCaps::fGLSLGeneration
Review URL: https://codereview.chromium.org/1203153002
2015-06-24 11:07:07 -07:00
reed
71c3c760a8 add SkCanvas::drawAtlas
BUG=skia:

Review URL: https://codereview.chromium.org/1181913003
2015-06-24 10:29:18 -07:00
robertphillips
52d4deb128 Fix debugger compilation
TBR=bsalomon@google.com

Review URL: https://codereview.chromium.org/1205933002
2015-06-24 10:09:57 -07:00
egdaniel
724ae2823e Alter shader code for soft light to avoid driver bug.
On the n5 there seems to be an issue where negating a variable at the start
of an equation doesn't work. Moving the negated variable to a subtract at the
end works around the issue (as would multiplying by -1.0).

The main bug was caused by the -DaCub in the else if block, but I also
adjusted the else block to make sure the same issue doesn't appear there
at some later date.

BUG=chromium:502434

Review URL: https://codereview.chromium.org/1210573002
2015-06-24 08:14:49 -07:00
scroggo
ba9a4aa855 Revert of remove SK_SUPPORT_LEGACY_PATHOP_ENUMS (patchset #1 id:1 of https://codereview.chromium.org/1200323005/)
Reason for revert:
Breaking the Android build.

Original issue's description:
> remove SK_SUPPORT_LEGACY_PATHOP_ENUMS
>
> BUG=skia:
> TBR=
>
> Committed: https://skia.googlesource.com/skia/+/8bcc7a00febd737f7e82513bd5e4a697526626de

TBR=reed@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1203983003
2015-06-24 08:05:52 -07:00
jvanverth
cba99b88fd Move GLSL-specific routines/classes to separate glsl directory
The purpose is to begin separating our GLSL-specific code from
our GL-specific code, so it can be used with the GL45 platform

Review URL: https://codereview.chromium.org/1202293002
2015-06-24 06:59:57 -07:00
robertphillips
1b8e1b5c49 Refactor GrBufferAllocPools to use resource cache
Committed: https://skia.googlesource.com/skia/+/e935f1a0e2351373c33600b8388492ce1218014a

Review URL: https://codereview.chromium.org/1139753002
2015-06-24 06:54:10 -07:00
reed
8bcc7a00fe remove SK_SUPPORT_LEGACY_PATHOP_ENUMS
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1200323005
2015-06-23 22:05:19 -07:00
reed
af4b233d46 remove SK_SUPPORT_LEGACY_FILTERLEVEL_ENUM
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1205803002
2015-06-23 21:47:30 -07:00
reed
56b73fc63f remove (legacy) NewFromData
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1199413003
2015-06-23 21:31:08 -07:00
bsalomon
74f681dce2 Make SkGpuDevice know its alpha type
Make SkImage_Gpu snapshots opaque if surface is opaque.

BUG=skia:3965

Review URL: https://codereview.chromium.org/1205643002
2015-06-23 14:38:48 -07:00
reed
5fbb623099 add more tests
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1201333002
2015-06-23 14:34:58 -07:00
bsalomon
841959122c Make SkNSView's window accept mouseMoved events
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1206563003
2015-06-23 14:03:47 -07:00
bungeman
c53085413e Rename SkFontConfigParser_android SkFontMgr_android_parser.
There are a number of files with 'FontConfig' in their names which
just have to do with font configuration, but nothing to do with
the FontConfig project or even with each other. This clarifies
that these files deal with parsing for the Android font manager.

Review URL: https://codereview.chromium.org/1200103008
2015-06-23 13:25:46 -07:00
cdalton
d416a5b10f Implement SkGLContext swapBuffers with fence syncs
Improves the GPU measuring accuracy of nanobench by using fence syncs.
Fence syncs are very widely supported and available on almost every
platform.

NO_MERGE_BUILDS
BUG=skia:

Review URL: https://codereview.chromium.org/1194783003
2015-06-23 13:23:44 -07:00
robertphillips
b607767703 Revert of Refactor GrBufferAllocPools to use resource cache (patchset #15 id:280001 of https://codereview.chromium.org/1139753002/)
Reason for revert:
Will reland after Chromium branch

Original issue's description:
> Refactor GrBufferAllocPools to use resource cache
>
> Committed: https://skia.googlesource.com/skia/+/e935f1a0e2351373c33600b8388492ce1218014a

TBR=bsalomon@google.com,joshualitt@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1204773003
2015-06-23 12:36:12 -07:00
reed
e582a5a891 remove SK_SUPPORT_LEGACY_OPTIONLESS_GET_PIXELS
BUG=skia:

Review URL: https://codereview.chromium.org/1201233002
2015-06-23 12:10:27 -07:00
halcanary
1c75515a7c Revert of SkPDF: Annotations are clipped by canvas clip stack. (patchset #2 id:20001 of https://codereview.chromium.org/1148263005/)
Reason for revert:
http://crbug.com/503541

Original issue's description:
> SkPDF: Annotations are clipped by canvas clip stack.
>
> Also, remove some SkPDFDevice functions.
>
> Will fix this GM: http://crrev.com/1159273003
>
> BUG=skia:3872
>
> Committed: https://skia.googlesource.com/skia/+/eee0e4e9d343d8b6c5ae2da7f17196f00d8859bc

TBR=tomhudson@google.com,reed@google.com
BUG=skia:3872
BUG=503541

Review URL: https://codereview.chromium.org/1200193003
2015-06-23 10:59:12 -07:00
robertphillips
da57105708 Fix memory leak in simple-offsetimagefilter
Review URL: https://codereview.chromium.org/1203613004
2015-06-23 09:28:52 -07:00
reed
b3fe1b87e0 more tests for offsetimagefilter
BUG=skia:

Review URL: https://codereview.chromium.org/1199933011
2015-06-23 08:29:20 -07:00
robertphillips
e935f1a0e2 Refactor GrBufferAllocPools to use resource cache
Review URL: https://codereview.chromium.org/1139753002
2015-06-23 08:23:08 -07:00
kkinnunen
591a2ca842 Stop using the NVPR glyph loading functionality
Remove the NVPR glyph loading functionality. A bit risky feature.

Review URL: https://codereview.chromium.org/1176113008
2015-06-23 07:27:41 -07:00
bungeman
bd1fb49dd9 Rename SkFontHost_none.cpp to SkFontMgr_empty_factory.
When the current function was added in
https://skia.googlesource.com/skia/+/070da5edcb1c6e9b9507f06a5e2c270e1c1fd796%5E%21/#F3
the SkFontHost was still alive and well. Now that this file no
longer contains any SkFontHost related code, rename the file for
clarity and uniformity.

Review URL: https://codereview.chromium.org/1196313003
2015-06-23 07:18:21 -07:00
joshualitt
6205af0e70 add autotuning to visualbench
BUG=skia:

Review URL: https://codereview.chromium.org/1201003002
2015-06-23 07:10:59 -07:00
robertphillips
5351aad9bc Fix memory leak in SkPictureRecord
Review URL: https://codereview.chromium.org/1197283007
2015-06-23 06:54:56 -07:00
tomhudson
3fef728e16 Fix indirect use of defined() directive
BUG=432391
R=bsalomon,bungeman1

Review URL: https://codereview.chromium.org/876933004
2015-06-23 06:31:32 -07:00
robertphillips
702edbd4bc Propagate SkSurfaceProps to more call sites
Start moving to a world where everyone provides surface properties.

Most notably this exposes a portion of SkSurfaceProps to the C API.

BUG=skia:3934

Review URL: https://codereview.chromium.org/1195003003
2015-06-23 06:26:08 -07:00
borenet
0a9af33a92 Tweak SkiaLab docs
BUG=skia:3850
NOTRY=true
DOCS_PREVIEW= https://skia.org/?cl=1203443003

Review URL: https://codereview.chromium.org/1203443003
2015-06-23 06:05:01 -07:00
reed
477fdd8aa4 add simple test for offsetimagefilter
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1204723002
2015-06-23 06:01:10 -07:00
reed
c210035071 add break statement -- lost during rewrite earlier
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1193333004
2015-06-22 17:03:10 -07:00
reed
871872f3f2 change old picture serialization to really handle images
BUG=skia:3965

Review URL: https://codereview.chromium.org/1199473002
2015-06-22 12:48:26 -07:00
joshualitt
c1f56b5182 fix for calling bindFragDataLocation on OpenGL 2.1
BUG=skia:3966

Review URL: https://codereview.chromium.org/1201623003
2015-06-22 12:31:32 -07:00