Commit Graph

1590 Commits

Author SHA1 Message Date
msarett
a714bc3929 Fix various SkColorSpace bugs
(1) Fixes serialization/deserialization of wacky SkColorSpaces
(2) Fix gamma equals checking

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

Review-Url: https://codereview.chromium.org/2194903002
2016-07-29 08:58:33 -07:00
csmartdalton
e0d362929d Add test configs for instanced rendering
Adds the following configs and enables them on select bots:

  glinst, glinst4, glinstdit4, glinst16, glinstdit16,
  esinst, esinst4, esinstdit4

Makes general changes to GrContextOptions, GrCaps, etc. to facilitate
this.

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

Review-Url: https://codereview.chromium.org/2182783004
2016-07-29 08:14:20 -07:00
msarett
50ce1f28ff Add color space xform support to SkJpegCodec (includes F16!)
Also changes SkColorXform to support:
RGBA->RGBA
RGBA->BGRA

Instead of:
RGBA->SkPMColor

TBR=reed@google.com
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2174493002
CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

Committed: https://skia.googlesource.com/skia/+/73d55332e2846dd05e9efdaa2f017bcc3872884b
Review-Url: https://codereview.chromium.org/2174493002
2016-07-29 06:23:33 -07:00
msarett
39979d8c6b Revert of Add color space xform support to SkJpegCodec (includes F16!) (patchset #9 id:260001 of https://codereview.chromium.org/2174493002/ )
Reason for revert:
Breaking MSAN

Original issue's description:
> Add color space xform support to SkJpegCodec (includes F16!)
>
> Also changes SkColorXform to support:
> RGBA->RGBA
> RGBA->BGRA
>
> Instead of:
> RGBA->SkPMColor
>
> TBR=reed@google.com
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2174493002
> CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot
>
> Committed: https://skia.googlesource.com/skia/+/73d55332e2846dd05e9efdaa2f017bcc3872884b

TBR=mtklein@google.com,reed@google.com,herb@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/2195523002
2016-07-28 17:11:18 -07:00
msarett
73d55332e2 Add color space xform support to SkJpegCodec (includes F16!)
Also changes SkColorXform to support:
RGBA->RGBA
RGBA->BGRA

Instead of:
RGBA->SkPMColor

TBR=reed@google.com
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2174493002
CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

Review-Url: https://codereview.chromium.org/2174493002
2016-07-28 15:06:16 -07:00
fmenozzi
17e829794d Add HardStopGradientBench_ScaleNumHardStops.cpp
Rename HardStopGradientBench.cpp to HardStopGradientBench_ScaleNumColors.cpp

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

Review-Url: https://codereview.chromium.org/2178913003
2016-07-28 10:59:49 -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
brianosman
efded51cd8 Always supply a color space (sRGB for now) with F16
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2177193004

Review-Url: https://codereview.chromium.org/2177193004
2016-07-26 08:11:50 -07:00
msarett
530c844d25 Remove unnecessary getColorSpace() API from SkCodec
Not needed since now we can get it from the SkImageInfo.

TBR=reed@google.com
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2170793004

Review-Url: https://codereview.chromium.org/2170793004
2016-07-21 11:57:49 -07:00
mtklein
0c902473d6 Correct sRGB <-> linear everywhere.
This trims the SkPM4fPriv methods down to just foolproof methods.
(Anything trying to build these itself is probably wrong.)

Things like Sk4f srgb_to_linear(Sk4f) can't really exist anymore,
at least not efficiently, so this refactor is somewhat more invasive
than you might think.  Generally this means things using to_4f() are
also making a misstep... that's gone too.

It also does not make sense to try to play games with linear floats
with 255 bias any more.  That hack can't work with real sRGB coding.

Rather than update them, I've removed a couple of L32 xfermode fast
paths.  I'd even rather drop it entirely...

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

Review-Url: https://codereview.chromium.org/2163683002
2016-07-20 18:10:07 -07:00
mtklein
566ea9b9fc Tune linear->sRGB constants to round-trip all bytes.
I basically just ran a big 5-deep for-loop over the five constants here.
This is the first set of coefficients I found that round trips all bytes.
I suspect there are many such sets.

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

Review-Url: https://codereview.chromium.org/2162063003
2016-07-20 12:10:11 -07:00
msarett
575b2a3bb9 Fix master-skia build
TBR=djsollen@google.com
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2159223003

Review-Url: https://codereview.chromium.org/2159223003
2016-07-19 13:00:35 -07:00
msarett
6bdbf4412b Improve naive SkColorXform to half floats
This should give us a good baseline to explore using SkRasterPipeline.

A particular colorxform to half float drops from 425us to 282us on my desktop.

Color Xform to Half Float (HP z620)
Original                              425us
Trans16 (not 32)                      355us
Vector Trans16                        378us
Trans16 + Keep Halfs in Vector        335us
Vector Trans16 + Keep Halfs in Vector 282us
Final                                 282us

Color Xform to Half Float (Nexus 5X)
Original                              556us
Final                                 472us

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

Review-Url: https://codereview.chromium.org/2159993003
2016-07-19 09:07:55 -07:00
msarett
9ce3a543c9 Add capability for SkColorXform to output half floats
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2147763002
CQ_INCLUDE_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot;master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

Review-Url: https://codereview.chromium.org/2147763002
2016-07-15 13:54:38 -07:00
halcanary
eb92cb3e84 SkPdf: smaller color serialization
SkPDFUtils now has a special function (SkPDFUtils::AppendColorComponent)
just for writing out (color/255) as a decimal with three digits of
precision.

SkPDFUnion now has a type to represent a color component.  It holds a
utint_8, but calls into AppendColorComponent to serialize.

Added a unit test that tests all possible input values.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2151863003

Review-Url: https://codereview.chromium.org/2151863003
2016-07-15 13:41:28 -07:00
mtklein
036e1831e0 Add a bench to measure the best way to pack from int to uint16_t with SSE.
I measured relative runtimes on my laptop:

   pack_int_uint16_t_ss…
   1036  …e41 1x  …se3 1.01x  …e2_b 3.01x  …e2_a 3.02x

I've run into Clang problems with the actual _mm_packus_epi32 instruction, I think,
so I'm going to exercise a little cowardice and leave that option disabled for now.

The ssse3 version probably looks a little faster than it will be in practice.
We'll usually need to load its mask, which here is hoisted out of the bench loop.

The two sse2 variants are close enough in speed that I'm tie breaking them on other
concerns: the <<16, >>16 version doesn't need any scratch registers or to load any
constants, so it wins.

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

Review-Url: https://codereview.chromium.org/2150343002
2016-07-15 07:45:53 -07:00
mtklein
05c73b7ed5 Remove bulk float <-> half routines. These are dead code.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2152583002

Review-Url: https://codereview.chromium.org/2152583002
2016-07-13 13:30:49 -07:00
robertphillips
dda54455a2 Remove GrLayerHoister
This relies on https://codereview.chromium.org/1944013002/ (Add legacy flag to allow Skia to remove Ganesh layer hoister) landing first so as to not break the DEPS roll.

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

Review-Url: https://codereview.chromium.org/1950523002
2016-07-13 13:27:16 -07:00
mtklein
0358a6ac00 Update SkOpts namespaces.
If we make sure all SkOpts functions are static, we can give the namespaces any
name we like.  This lets us drop the sk_ prefix and give a real indication of
the default SIMD instruction set rather than just saying sk_default.

Both of these changes help debugger, profiler, and crash report readability.
Perhaps more importantly, keeping these functions static helps prevent
accidentally linking in unused versions of functions, as you see here with
sk_avx::srcover_srgb_srgb().

This requires we update SkBlend_opts tests and benches to call SkOpts functions
through SkOpts rather than declaring the methods externally.  In practice this
drops testing of the SSE2 version on machines with SSE4.  If we still really
need to test/bench the compile time best SIMD level version of this method
against the runtime detected best, we can include SkBlend_opts.h into the tests
or benches directly, similar to what we do for the trivial, brute-force, or best
non-SIMD versions.

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

Review-Url: https://codereview.chromium.org/2145833002
2016-07-13 08:02:20 -07:00
mtklein
281b33fdd9 SkRasterPipeline preliminaries
Re-uploading to see if I can get a CL number < 2^31.
    patch from issue 2147533002 at patchset 240001 (http://crrev.com/2147533002#ps240001)

Already reviewed at the other crrev link.
TBR=

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

Review-Url: https://codereview.chromium.org/2144573004
2016-07-12 15:01:26 -07:00
bungeman
7438bfc080 Factor code to rotate a canvas about a point.
SkMatrix::scale and ::rotate take a point around which to scale or rotate.
Canvas lacks these helpers, so the code to rotate a canvas around a
point has been duplicated many times. Factor all of these
implementations into SkCanvas::rotate.

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

Review-Url: https://codereview.chromium.org/2142033002
2016-07-12 15:01:19 -07:00
herb
2edf0c6a71 Remove bloat from SkBlend_opts.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2130183003
CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

Review-Url: https://codereview.chromium.org/2130183003
2016-07-12 15:00:46 -07:00
fmenozzi
54d500f90c Add benchmarks for 3 and 4 colors (most common)
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2143653002

Review-Url: https://codereview.chromium.org/2143653002
2016-07-12 14:45:32 -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
tomhudson
63d14413be Remove obsolete bench analysis scripts
R=bungeman@google.com
BUG=skia:5459
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2125953002

Review-Url: https://codereview.chromium.org/2125953002
2016-07-11 10:26:56 -07:00
fmenozzi
d6767aa2d5 Add HardStopGradientBench.cpp
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2131643002

Committed: https://skia.googlesource.com/skia/+/d0d652e0e0cb4bcecb7ccac9f4f4831fcaccdc45
Review-Url: https://codereview.chromium.org/2131643002
2016-07-11 09:56:31 -07:00
fmenozzi
ffa185d3cf Revert of Add HardStopGradientBench.cpp (patchset #3 id:40001 of https://codereview.chromium.org/2131643002/ )
Reason for revert:
Segfaulting on HardStopGradientBench; didn't allocate enough stack memory for color/position arrays.

Original issue's description:
> Add HardStopGradientBench.cpp
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2131643002
>
> Committed: https://skia.googlesource.com/skia/+/d0d652e0e0cb4bcecb7ccac9f4f4831fcaccdc45

TBR=bsalomon@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/2140603003
2016-07-11 09:30:25 -07:00
fmenozzi
d0d652e0e0 Add HardStopGradientBench.cpp
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2131643002

Review-Url: https://codereview.chromium.org/2131643002
2016-07-11 08:31:23 -07:00
reed
6092b6e0e5 Revert of change mapRectScaleTranslate to pass args/ret by value (patchset #1 id:1 of https://codereview.chromium.org/2137853002/ )
Reason for revert:
Triggered a compiler bug on Android?

FAILED: /usr/bin/ccache /b/work/skia/platform_tools/android/bin/../toolchains/arm-r11c-14/bin/arm-linux-androideabi-g++ -MMD -MF obj/src/core/core.SkMatrix.o.d -DSK_INTERNAL -DSK_GAMMA_APPLY_TO_A8 -DQT_NO_KEYWORDS -DSK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0 -DSK_SUPPORT_GPU=1 -DSK_FORCE_DISTANCE_FIELD_TEXT=0 -DSK_HAS_GIF_LIBRARY -DSK_HAS_JPEG_LIBRARY -DSK_HAS_PNG_LIBRARY -DSK_HAS_WEBP_LIBRARY -DSK_TEST_QCMS -DSK_IS_BOT -DSK_CODEC_DECODES_RAW -DSK_ARM_HAS_NEON -DSK_BUILD_FOR_ANDROID -DSK_GAMMA_EXPONENT=1.4 -DSK_GAMMA_CONTRAST=0.0 -DSKIA_DLL -DSKIA_IMPLEMENTATION=1 -DSK_SUPPORT_LEGACY_CLIPTOLAYERFLAG -DNDEBUG -I../../../include/c -I../../../include/config -I../../../include/core -I../../../include/pathops -I../../../include/ports -I../../../include/private -I../../../include/utils -I../../../include/images -I../../../src/core -I../../../src/sfnt -I../../../src/image -I../../../src/opts -I../../../src/utils -I../../../include/gpu -I../../../src/gpu -I../../../platform_tools/android/third_party/cpufeatures -fPIC -g -fno-exceptions -fstrict-aliasing -Wall -Wextra -Winit-self -Wpointer-arith -Wsign-compare -Wvla -Wno-unused-parameter -Werror -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=softfp -fuse-ld=gold -O2 -std=c++11 -fno-rtti -fno-threadsafe-statics -Wnon-virtual-dtor  -c ../../../src/core/SkMatrix.cpp -o obj/src/core/core.SkMatrix.o
../../../src/core/SkMatrix.cpp: In member function 'SkRect SkMatrix::mapRectScaleTranslate(SkRect) const':
../../../src/core/SkMatrix.cpp:1120:1: error: unrecognizable insn:
 }
 ^
(insn 32 31 33 2 (set (reg:V4SF 115 [ D.83077 ])
        (unspec:V4SF [
                (mem/c:V4SF (reg/f:SI 104 virtual-incoming-args) [0 MEM[(const __builtin_neon_sf[4] *)&src]+0 S16 A32])
            ] UNSPEC_VLD1)) /b/work/skia/platform_tools/android/toolchains/arm-r11c-14/lib/gcc/arm-linux-androideabi/4.9/include/arm_neon.h:8693 -1
     (nil))
../../../src/core/SkMatrix.cpp:1120:1: internal compiler error: in extract_insn, at recog.c:2202
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://source.android.com/source/report-bugs.html> for instructions.

Original issue's description:
> change mapRectScaleTranslate to pass args/ret by value
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2137853002
>
> TBR=mtklein
>
> Committed: https://skia.googlesource.com/skia/+/14dce6ed5934d7a6e1fac79f8e76e12f5670aae2

TBR=msarett@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/2139523002
2016-07-10 11:45:35 -07:00
reed
14dce6ed59 change mapRectScaleTranslate to pass args/ret by value
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2137853002

TBR=mtklein

Review-Url: https://codereview.chromium.org/2137853002
2016-07-10 11:35:03 -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
reed
47df89ebfd speed up maprect for scale+trans case
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2111703002

Review-Url: https://codereview.chromium.org/2111703002
2016-06-30 06:38:54 -07:00
halcanary
ee41b7556d SkPDF: alloc less memory for strings
before:
        micros   	bench
        250.98  	WritePDFText	nonrendering
    after:
        micros   	bench
        107.10  	WritePDFText	nonrendering

Also, be slightly more space-efficient in encoding strings.

Also, add a bench.

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

Review-Url: https://codereview.chromium.org/2099463002
2016-06-23 14:08:11 -07:00
reed
dabe5d3780 update callers to not use SkColorProfileType
Requires https://codereview.chromium.org/2087833002/ to land first.

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

Review-Url: https://codereview.chromium.org/2086583002
2016-06-21 10:28:14 -07:00
msarett
db197a54b5 Fix Mac clang linker
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2077353006

Review-Url: https://codereview.chromium.org/2077353006
2016-06-21 09:44:29 -07:00
msarett
67cb666481 Add --simpleCodec to nanobench flags to run a smaller set of benchmarks
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2084683002

Review-Url: https://codereview.chromium.org/2084683002
2016-06-21 08:49:26 -07:00
liyuqian
a27f669f46 Benchmark rotated rect with AA/noAA
Using this benchmark, we verify that AA is about 4x slower than noAA in
path_fill_big_rotated_rect. This is what I aim to improve in the next
CL.

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

Review-Url: https://codereview.chromium.org/2087453003
2016-06-20 14:05:27 -07:00
brianosman
1a48e13303 Respect color type and gamma settings in nanobench GPU configs
We were ignoring the requested properties in things like gpuf16 and
gpusrgb.

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

Review-Url: https://codereview.chromium.org/2075133003
2016-06-20 09:41:41 -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
msarett
d2809573de Support sRGB dsts in opt code
201295.jpg on HP z620 (300x280)

QCMS Xform                    0.418 ms
Skia NEW Xform                0.378 ms

Vs QCMS                       1.11x

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

Review-Url: https://codereview.chromium.org/2078623002
2016-06-20 06:07:45 -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
brianosman
b109b8c5ec Lots of progress on switching to SkColorSpace rather than SkColorProfileType
Fixed a bunch of code in Ganesh, as well as usage of SkColorProfileType in most of our tools (DM, SampleApp, Viewer, nanobench, skiaserve, HelloWorld).

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

Committed: https://skia.googlesource.com/skia/+/6a61a875467646f8dbc37cfecf49e12d1f475170
Review-Url: https://codereview.chromium.org/2069173002
2016-06-16 13:03:24 -07:00
brianosman
ab8241880d Revert of Lots of progress switching to SkColorSpace rather than SkColorProfileType (patchset #10 id:180001 of https://codereview.chromium.org/2069173002/ )
Reason for revert:
Mac crashes in GrUploadPixmapToTexture

Original issue's description:
> Lots of progress on switching to SkColorSpace rather than SkColorProfileType
>
> Fixed a bunch of code in Ganesh, as well as usage of SkColorProfileType in most of our tools (DM, SampleApp, Viewer, nanobench, skiaserve, HelloWorld).
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2069173002
>
> Committed: https://skia.googlesource.com/skia/+/6a61a875467646f8dbc37cfecf49e12d1f475170

TBR=reed@google.com,herb@google.com,msarett@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/2072813002
2016-06-16 11:41:44 -07:00
brianosman
6a61a87546 Lots of progress on switching to SkColorSpace rather than SkColorProfileType
Fixed a bunch of code in Ganesh, as well as usage of SkColorProfileType in most of our tools (DM, SampleApp, Viewer, nanobench, skiaserve, HelloWorld).

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

Review-Url: https://codereview.chromium.org/2069173002
2016-06-16 11:10:04 -07:00
msarett
dea0340cad Implement fast, correct gamma conversion for color xforms
201295.jpg on HP z620
(300x280, most common form of sRGB profile)

QCMS Xform                    0.495 ms
Skia Old Xform                0.235 ms
Skia NEW Xform                0.423 ms

Vs Old Code                   0.56x
Vs QCMS                       1.17x

So to summarize, we are now much slower than before,
but still a bit faster than QCMS.  And now we are also
far more accurate than QCMS :).

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

Review-Url: https://codereview.chromium.org/2060823003
2016-06-16 10:50:55 -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
msarett
a9e878c836 Optimize color xforms with 2.2 gammas for SSE2
Because we recognize commonly used gamma tables and
parameters as 2.2f, about 98% of jpegs with color profiles
will pass through this xform (assuming the dst is also
2.2f).  Sample size is 10,322 jpegs.

I won't go crazy with performance numbers because this is
a work in progress, particularly in terms of correctness.

201295.jpg on HP z620
(300x280, most common form of sRGB profile)

Decode Time + QCMS Xform      1.28 ms
QCMS Xform Only               0.495 ms
Decode Time + Skia Opt Xform  1.01 ms
Skia Opt Xform Only           0.235 ms

Decode Time + Xform Speed-up  1.27x
Xform Only Speed-up           2.11x

FWIW, Skia xform time before these optimizations was
41.1 ms.  But we expected that code to be slow.

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

Review-Url: https://codereview.chromium.org/2046013002
2016-06-08 14:43:53 -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
msarett
469f1c503d Use SK_TEST_QCMS to mark qcms test code
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2031053005

Review-Url: https://codereview.chromium.org/2031053005
2016-06-06 08:20:38 -07:00
msarett
2cee902847 Add color correction benchmark - with comparison to qcms
--colorImages is empty by default so this won't affect the runtime of
the bots.  To run locally, use --colorImages <path> and
--benchType skcolorcodec.

Two takeaways so far:
Color correction is (currently) slower than jpeg decodes.
Our reference solution is slower than qcms.

TBR=reed@google.com
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2035793002

Review-Url: https://codereview.chromium.org/2035793002
2016-06-03 08:25:22 -07:00
brianosman
2122c55084 Fix incorrect parameter in new benchmark.
An old value for one of the dimensions slipped in with the original CL.

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

Review-Url: https://codereview.chromium.org/2033713003
2016-06-02 06:50:40 -07:00
brianosman
f7cfa920f4 Release surface between runs to avoid seg fault
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2032693002

Review-Url: https://codereview.chromium.org/2032693002
2016-06-01 13:49:27 -07:00
brianosman
fc29906826 New benchmark to measure GPU mip-mapping performance
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2030673002

Review-Url: https://codereview.chromium.org/2030673002
2016-06-01 12:40:15 -07:00
sdefresne
e3fa811657 [GN] Add support for disabling opts via SK_BUILD_NO_OPTS define.
When targetting iOS and using gyp to generate the build files, it is not
possible to select files to build depending on the architecture. Due to
that, the skia code was disabling all optimisation when SK_BUILD_FOR_IOS
was defined.

Since it is possible to select the correct optimised version when using
gn, this pessimisation is hurting the build. Introduce a new define to
disable the optimisation SK_BUILD_NO_OPTS. It will be used by Chromium
when building skia for iOS with gyp but not gn.

Define SK_BUILD_NO_OPTS along-side SK_BUILD_FOR_IOS for all files that
look like build configuration (Xcode projects, gyp configuration files,
public.bzl) in order to avoid introducing breakage on those builds.

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

Review-Url: https://codereview.chromium.org/2002423002
2016-06-01 07:08:56 -07:00
mboc
ee6a9919a3 SkTypeface::MakeFromName to take SkFontStyle.
SkTypeface::MakeFromName currently takes SkTypeface::Style,
which is quite limited. This starts the transition to this
function taking SkFontStyle instead.

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

TBR=reed
He said it sounded like a good idea.

Review-Url: https://codereview.chromium.org/1818043002
2016-05-31 11:42:37 -07:00
herb
ca1ec03c5c Move forceSRGB to SkCommonFlags.
This fixes a duplicate symbol problem with the iOS build.

Add common forceSRGB flag.

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

Review-Url: https://codereview.chromium.org/2019073002
2016-05-27 10:57:58 -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
reed
b8486f5092 add --forceSRGB option to nanobench, to get all src images to be SRGB
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2008333002

Review-Url: https://codereview.chromium.org/2008333002
2016-05-26 14:06:43 -07:00
robertphillips
87f15c8ff1 Retract GrRenderTarget from GrTestTarget
Split out of: https://codereview.chromium.org/1988923002/ (Declassify GrClipMaskManager and Remove GrRenderTarget and GrDrawTarget from GrPipelineBuilder)

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

Review-Url: https://codereview.chromium.org/2004433002
2016-05-20 11:14:33 -07:00
bsalomon
809f258670 Make LinearSrcOverBench not crash in constructor when resource path is missing
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=1998113003

Review-Url: https://codereview.chromium.org/1998113003
2016-05-20 08:54:23 -07:00
msarett
d1227a7417 Delete SkBitmapRegionCanvas
This was an approach we considered for implementing Android's
BitmapRegionDecoder.

It was useful for testing and comparison, but now is no longer worth
maintaining and testing.

The approach to subset/scaled decodes (clipped decode, then scale)
may be worth reconsidering at some point.

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

Review-Url: https://codereview.chromium.org/1990543002
2016-05-18 06:23:57 -07:00
herb
cc49e5950d Add tests and benches to support the sRGB blitter for SkOpts
1,370.85 LinearSrcOvericonstrip.pngVSkOptsSSE41
 2,359.69 LinearSrcOvericonstrip.pngVSkOptsDefault
 1,828.72 LinearSrcOvericonstrip.pngVSkOptsNonSimdCore
 3,277.40 LinearSrcOvericonstrip.pngVSkOptsTrivial
 9,862.34 LinearSrcOvericonstrip.pngVSkOptsBruteForce

   633.55 LinearSrcOvermandrill_512.pngVSkOptsSSE41
   684.29 LinearSrcOvermandrill_512.pngVSkOptsDefault
 1,201.88 LinearSrcOvermandrill_512.pngVSkOptsNonSimdCore
 2,382.63 LinearSrcOvermandrill_512.pngVSkOptsTrivial
10,888.74 LinearSrcOvermandrill_512.pngVSkOptsBruteForce

   209.14 LinearSrcOverplane.pngVSkOptsSSE41
   562.24 LinearSrcOverplane.pngVSkOptsDefault
   272.64 LinearSrcOverplane.pngVSkOptsNonSimdCore
   436.46 LinearSrcOverplane.pngVSkOptsTrivial
 1,327.23 LinearSrcOverplane.pngVSkOptsBruteForce

   318.01 LinearSrcOverbaby_tux.pngVSkOptsSSE41
   529.05 LinearSrcOverbaby_tux.pngVSkOptsDefault
   441.33 LinearSrcOverbaby_tux.pngVSkOptsNonSimdCore
   720.50 LinearSrcOverbaby_tux.pngVSkOptsTrivial
 2,191.10 LinearSrcOverbaby_tux.pngVSkOptsBruteForce

   479.68 LinearSrcOveryellow_rose.pngVSkOptsSSE41
 1,095.03 LinearSrcOveryellow_rose.pngVSkOptsDefault
   668.60 LinearSrcOveryellow_rose.pngVSkOptsNonSimdCore
 1,257.19 LinearSrcOveryellow_rose.pngVSkOptsTrivial
 4,970.25 LinearSrcOveryellow_rose.pngVSkOptsBruteForce

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

Committed: https://skia.googlesource.com/skia/+/554784cd85029c05d9ed04b1aeb71520d196153a

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

Review-Url: https://codereview.chromium.org/1939513002
2016-05-17 09:57:34 -07:00
reed
4933d0baad Revert of Add specialized sRGB blitter for SkOpts (patchset #21 id:400001 of https://codereview.chromium.org/1939513002/ )
Reason for revert:
broke some debug bots:

Running LinearSrcOvericonstrip.pngVSkOptsSSE41	nonrendering
../../../bench/SkBlend_optsBench.cpp:118: fatal error: ""fPixmap.colorType() == kRGBA_8888_SkColorType""

Original issue's description:
> Add tests and benches to support the sRGB blitter for SkOpts
>
>  1,370.85 LinearSrcOvericonstrip.pngVSkOptsSSE41
>  2,359.69 LinearSrcOvericonstrip.pngVSkOptsDefault
>  1,828.72 LinearSrcOvericonstrip.pngVSkOptsNonSimdCore
>  3,277.40 LinearSrcOvericonstrip.pngVSkOptsTrivial
>  9,862.34 LinearSrcOvericonstrip.pngVSkOptsBruteForce
>
>    633.55 LinearSrcOvermandrill_512.pngVSkOptsSSE41
>    684.29 LinearSrcOvermandrill_512.pngVSkOptsDefault
>  1,201.88 LinearSrcOvermandrill_512.pngVSkOptsNonSimdCore
>  2,382.63 LinearSrcOvermandrill_512.pngVSkOptsTrivial
> 10,888.74 LinearSrcOvermandrill_512.pngVSkOptsBruteForce
>
>    209.14 LinearSrcOverplane.pngVSkOptsSSE41
>    562.24 LinearSrcOverplane.pngVSkOptsDefault
>    272.64 LinearSrcOverplane.pngVSkOptsNonSimdCore
>    436.46 LinearSrcOverplane.pngVSkOptsTrivial
>  1,327.23 LinearSrcOverplane.pngVSkOptsBruteForce
>
>    318.01 LinearSrcOverbaby_tux.pngVSkOptsSSE41
>    529.05 LinearSrcOverbaby_tux.pngVSkOptsDefault
>    441.33 LinearSrcOverbaby_tux.pngVSkOptsNonSimdCore
>    720.50 LinearSrcOverbaby_tux.pngVSkOptsTrivial
>  2,191.10 LinearSrcOverbaby_tux.pngVSkOptsBruteForce
>
>    479.68 LinearSrcOveryellow_rose.pngVSkOptsSSE41
>  1,095.03 LinearSrcOveryellow_rose.pngVSkOptsDefault
>    668.60 LinearSrcOveryellow_rose.pngVSkOptsNonSimdCore
>  1,257.19 LinearSrcOveryellow_rose.pngVSkOptsTrivial
>  4,970.25 LinearSrcOveryellow_rose.pngVSkOptsBruteForce
>
>
>
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1939513002
> CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot
>
> Committed: https://skia.googlesource.com/skia/+/554784cd85029c05d9ed04b1aeb71520d196153a
>
> Committed: https://skia.googlesource.com/skia/+/bc927548db17accec2195af6e15053f7918bb3f5

TBR=mtklein@google.com,fmalita@chromium.org,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/1986763002
2016-05-17 03:07:01 -07:00
herb
bc927548db Add tests and benches to support the sRGB blitter for SkOpts
1,370.85 LinearSrcOvericonstrip.pngVSkOptsSSE41
 2,359.69 LinearSrcOvericonstrip.pngVSkOptsDefault
 1,828.72 LinearSrcOvericonstrip.pngVSkOptsNonSimdCore
 3,277.40 LinearSrcOvericonstrip.pngVSkOptsTrivial
 9,862.34 LinearSrcOvericonstrip.pngVSkOptsBruteForce

   633.55 LinearSrcOvermandrill_512.pngVSkOptsSSE41
   684.29 LinearSrcOvermandrill_512.pngVSkOptsDefault
 1,201.88 LinearSrcOvermandrill_512.pngVSkOptsNonSimdCore
 2,382.63 LinearSrcOvermandrill_512.pngVSkOptsTrivial
10,888.74 LinearSrcOvermandrill_512.pngVSkOptsBruteForce

   209.14 LinearSrcOverplane.pngVSkOptsSSE41
   562.24 LinearSrcOverplane.pngVSkOptsDefault
   272.64 LinearSrcOverplane.pngVSkOptsNonSimdCore
   436.46 LinearSrcOverplane.pngVSkOptsTrivial
 1,327.23 LinearSrcOverplane.pngVSkOptsBruteForce

   318.01 LinearSrcOverbaby_tux.pngVSkOptsSSE41
   529.05 LinearSrcOverbaby_tux.pngVSkOptsDefault
   441.33 LinearSrcOverbaby_tux.pngVSkOptsNonSimdCore
   720.50 LinearSrcOverbaby_tux.pngVSkOptsTrivial
 2,191.10 LinearSrcOverbaby_tux.pngVSkOptsBruteForce

   479.68 LinearSrcOveryellow_rose.pngVSkOptsSSE41
 1,095.03 LinearSrcOveryellow_rose.pngVSkOptsDefault
   668.60 LinearSrcOveryellow_rose.pngVSkOptsNonSimdCore
 1,257.19 LinearSrcOveryellow_rose.pngVSkOptsTrivial
 4,970.25 LinearSrcOveryellow_rose.pngVSkOptsBruteForce

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

Committed: https://skia.googlesource.com/skia/+/554784cd85029c05d9ed04b1aeb71520d196153a

Review-Url: https://codereview.chromium.org/1939513002
2016-05-16 14:27:51 -07:00
bsalomon
d584d46c99 Run GM benchs in bench mode
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1978253002

Review-Url: https://codereview.chromium.org/1978253002
2016-05-16 09:09:18 -07:00
herb
670f01f2fc This has all the different source types in and working. There are many SkDiffs, but they seem to be due to better resolution.
This seems to fix all the bugs involved with make all the images produced by the codec to default to sRGB.

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

Review-Url: https://codereview.chromium.org/1967283002
2016-05-13 10:04:46 -07:00
robertphillips
9837740dd5 Simplify GrSWMaskHelper
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1974943002

Review-Url: https://codereview.chromium.org/1974943002
2016-05-13 05:47:23 -07:00
bungeman
13b9c95295 Move SkTypeface to sk_sp.
Committed: https://skia.googlesource.com/skia/+/6296da736fbf40aae881650c239420f64e576c3f
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1933393002

Review-Url: https://codereview.chromium.org/1933393002
2016-05-12 10:09:31 -07:00
scroggo
9a9a7b29e5 Revert of Move SkTypeface to sk_sp. (patchset #5 id:80001 of https://codereview.chromium.org/1933393002/ )
Reason for revert:
fontmgr_iterAndroid failing to draw emoji. E.g. https://gold.skia.org/search2?blame=6296da736fbf40aae881650c239420f64e576c3f&unt=true&head=true&query=source_type%3Dgm

Original issue's description:
> Move SkTypeface to sk_sp.
>
> Committed: https://skia.googlesource.com/skia/+/6296da736fbf40aae881650c239420f64e576c3f

TBR=reed@google.com,fmalita@chromium.org,tomhudson@google.com,bungeman@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/1974783002
2016-05-12 06:22:30 -07:00
bungeman
6296da736f Move SkTypeface to sk_sp.
Review-Url: https://codereview.chromium.org/1933393002
2016-05-11 12:38:18 -07:00
bsalomon
c8699321b9 Nanobench running on Vulkan
This lets nanobench run but the timings are inaccurate because of missing
implementations of synchronization functions in VkTestContext.

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

Review-Url: https://codereview.chromium.org/1965273004
2016-05-11 11:55:36 -07:00
brianosman
393c2ff0d2 Reset context after doing non-Skia GL rendering.
Fixes nanobench crash in GLInstancedArraysBench

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

Review-Url: https://codereview.chromium.org/1969623003
2016-05-11 08:49:59 -07:00
scroggo
fbb3102d0e Revert "Add tests and benches to support the sRGB blitter for SkOpts"
This reverts commit 554784cd85 and
1956b4ae1c

Reason for revert - ASAN failures, e.g. from https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-MSAN/builds/2233/steps/perf_skia%20on%20Ubuntu/logs/stdio :

  Uninitialized value was created by a heap allocation
    0 0x7f69aa96f799 in operator new[](unsigned long) /b/work/skia/third_party/externals/llvm/out/../projects/compiler-rt/lib/msan/msan_new_delete.cc:37
    1 0x7f69aaa315c1 in SkAutoTArray<unsigned int>::reset(int) /b/work/skia/out/Build-Ubuntu-GCC-x86_64-Debug-MSAN/Debug/../../../include/private/../private/SkTemplates.h:137:22
    2 0x7f69aaa34ee9 in LinearSrcOverBench<SrcOverVSkOptsSSE41>::LinearSrcOverBench(char const*) /b/work/skia/out/Build-Ubuntu-GCC-x86_64-Debug-MSAN/Debug/../../../bench/SkBlend_optsBench.cpp:108:9
    3 0x7f69aaa30cf2 in $_24::operator()(void*) const /b/work/skia/out/Build-Ubuntu-GCC-x86_64-Debug-MSAN/Debug/../../../bench/SkBlend_optsBench.cpp:167:1
    4 0x7f69aaa30c87 in $_24::__invoke(void*) /b/work/skia/out/Build-Ubuntu-GCC-x86_64-Debug-MSAN/Debug/../../../bench/SkBlend_optsBench.cpp:167:1
    5 0x7f69aaa68856 in BenchmarkStream::rawNext() /b/work/skia/out/Build-Ubuntu-GCC-x86_64-Debug-MSAN/Debug/../../../bench/nanobench.cpp:653:32
    6 0x7f69aaa61467 in BenchmarkStream::next() /b/work/skia/out/Build-Ubuntu-GCC-x86_64-Debug-MSAN/Debug/../../../bench/nanobench.cpp:642:25
    7 0x7f69aaa5b703 in nanobench_main() /b/work/skia/out/Build-Ubuntu-GCC-x86_64-Debug-MSAN/Debug/../../../bench/nanobench.cpp:1119:27
    8 0x7f69aaa5e10d in main /b/work/skia/out/Build-Ubuntu-GCC-x86_64-Debug-MSAN/Debug/../../../bench/nanobench.cpp:1290:12
    9 0x7f69a8c95ec4 in __libc_start_main /build/buildd/eglibc-2.19/csu/libc-start.c:287

TBR=herb@google.com

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

Review-Url: https://codereview.chromium.org/1969803002
2016-05-11 06:40:32 -07:00
bsalomon
8b7451aaf6 Turn ContextInfos returned by GrContextFactory into structs.
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1966013002

Review-Url: https://codereview.chromium.org/1966013002
2016-05-11 06:33:06 -07:00
herb
1956b4ae1c Use proper color type for assert.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1967803002

Review-Url: https://codereview.chromium.org/1967803002
2016-05-10 14:53:34 -07:00
herb
554784cd85 Add tests and benches to support the sRGB blitter for SkOpts
1,370.85 LinearSrcOvericonstrip.pngVSkOptsSSE41
 2,359.69 LinearSrcOvericonstrip.pngVSkOptsDefault
 1,828.72 LinearSrcOvericonstrip.pngVSkOptsNonSimdCore
 3,277.40 LinearSrcOvericonstrip.pngVSkOptsTrivial
 9,862.34 LinearSrcOvericonstrip.pngVSkOptsBruteForce

   633.55 LinearSrcOvermandrill_512.pngVSkOptsSSE41
   684.29 LinearSrcOvermandrill_512.pngVSkOptsDefault
 1,201.88 LinearSrcOvermandrill_512.pngVSkOptsNonSimdCore
 2,382.63 LinearSrcOvermandrill_512.pngVSkOptsTrivial
10,888.74 LinearSrcOvermandrill_512.pngVSkOptsBruteForce

   209.14 LinearSrcOverplane.pngVSkOptsSSE41
   562.24 LinearSrcOverplane.pngVSkOptsDefault
   272.64 LinearSrcOverplane.pngVSkOptsNonSimdCore
   436.46 LinearSrcOverplane.pngVSkOptsTrivial
 1,327.23 LinearSrcOverplane.pngVSkOptsBruteForce

   318.01 LinearSrcOverbaby_tux.pngVSkOptsSSE41
   529.05 LinearSrcOverbaby_tux.pngVSkOptsDefault
   441.33 LinearSrcOverbaby_tux.pngVSkOptsNonSimdCore
   720.50 LinearSrcOverbaby_tux.pngVSkOptsTrivial
 2,191.10 LinearSrcOverbaby_tux.pngVSkOptsBruteForce

   479.68 LinearSrcOveryellow_rose.pngVSkOptsSSE41
 1,095.03 LinearSrcOveryellow_rose.pngVSkOptsDefault
   668.60 LinearSrcOveryellow_rose.pngVSkOptsNonSimdCore
 1,257.19 LinearSrcOveryellow_rose.pngVSkOptsTrivial
 4,970.25 LinearSrcOveryellow_rose.pngVSkOptsBruteForce

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

Review-Url: https://codereview.chromium.org/1939513002
2016-05-10 13:33:47 -07:00
reed
6c0f5d91e2 Revert of Modify LineBench for drawing straight line (patchset #3 id:40001 of https://codereview.chromium.org/1936153002/ )
Reason for revert:
         for (int i = 0; i < loops; i++) {
 54             canvas->drawPoints(SkCanvas::kLines_PointMode, PTS, fPts, paint);	 68             canvas->drawLine(fStartPts[i].x(), fStartPts[i].y(), fEndPts[i].x(), fEndPts[i].y(), pai
    nt);

This change means we index arbitrarily far into fStartPts (if loops gets big enough).

Original issue's description:
> Modify LineBench for drawing
>
> Currently we only have benchmark for lines that contains randomly generated
> points. This CL modifies the benchmark which adds cases of drawing straight
> lines. Also, this CL changes the call from drawPoints() to drawLines()
> which measures the performance of line drawing.
>
> BUG=skia:5243
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1936153002
>
> Committed: https://skia.googlesource.com/skia/+/6b27a5e7292d9a18e376f0c229ec62f7b801305a

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

Review-Url: https://codereview.chromium.org/1952063005
2016-05-05 14:02:36 -07:00
xidachen
6b27a5e729 Modify LineBench for drawing
Currently we only have benchmark for lines that contains randomly generated
points. This CL modifies the benchmark which adds cases of drawing straight
lines. Also, this CL changes the call from drawPoints() to drawLines()
which measures the performance of line drawing.

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

Review-Url: https://codereview.chromium.org/1936153002
2016-05-05 13:24:04 -07:00
msarett
69deca8d1e Add ColorCodecSrc for testing/comparison on color corrected decodes
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1933753002

Review-Url: https://codereview.chromium.org/1933753002
2016-04-29 09:38:40 -07:00
reed
1e7f5e708e remove 'deprecated' region from SkDraw
Most call-sites that used it just took its bounds, so it was trivial to convert them
to get the bounds of the RasterClip. Two clients wanted the actual region:
1. layeriter for android
2. pdf

Android already only has BW clips, so should be safe.
PDF now overrides its clip methods to ensure that all clips are BW.

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

Review URL: https://codereview.chromium.org/1925693002
2016-04-27 07:49:17 -07:00
halcanary
4b6566644f SkDocument/PDF: new API
has a pdf/a switch.
sets metadata in factory.

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

Review URL: https://codereview.chromium.org/1916093002
2016-04-27 07:45:18 -07:00
halcanary
1e9030472e SkMD5: .update() -> .write()
Review URL: https://codereview.chromium.org/1913173003
2016-04-25 10:29:36 -07:00
halcanary
488165e689 SkPDF: PDF/A runtime switch
TODO: remove gyp variable and modify API  in SkDocument.h

SkMD5 now moved into core as pdf depends on it now.

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

Committed: https://skia.googlesource.com/skia/+/570f18b43417d73c3fbd113cc0b4258e08b14c82

Review URL: https://codereview.chromium.org/1891873002
2016-04-22 06:10:21 -07:00
kkinnunen
2e6055b3ea Refactor to separate backend object lifecycle and GpuResource budget decision
Refactor GrGpuResource to contain two different pieces of state:
 a) instance is budgeted or not budgeted
 b) instance references wrapped backend objects or not

The "object lifecycle" was also attached to backend object
handles (ids), which made the code a bit unclear. Backend objects
would be associated with GrGpuResource::LifeCycle, even though
GrGpuResource::LifeCycle refers to the GpuResource, and individual
backend objects in one GpuResource might be governed with different
"lifecycle".

Mark the budgeted/not budgeted with SkBudgeted::kYes, SkBudgeted::kNo.
This was previously GrGpuResource::kCached_LifeCycle,
GrGpuResource::kUncached_LifeCycle.

Mark the "references wrapped object" with boolean. This was previously
GrGpuResource::kBorrowed_LifeCycle,
GrGpuResource::kAdopted_LifeCycle for GrGpuResource.

Associate the backend object ownership status with
GrBackendObjectOwnership for the backend object handles.

The resource type leaf constuctors, such has GrGLTexture or
GrGLTextureRenderTarget take "budgeted" parameter. This parameter
is passed to GrGpuResource::registerWithCache().

The resource type intermediary constructors, such as GrGLTexture
constructors for class GrGLTextureRenderTarget do not take "budgeted"
parameters, intermediary construtors do not call registerWithCache.

Removes the need for tagging GrGpuResource -derived subclass
constructors with "Derived" parameter.

Makes instances that wrap backend objects be registered with
a new function GrGpuResource::registerWithCacheWrapped().

Removes "budgeted" parameter from classes such as StencilAttahment, as
they are always cached and never wrap any external backend objects.

Removes the use of concept "external" from the member function names.
The API refers to the objects as "wrapped", so make all related
functions use the term consistently.

No change in functionality. Resources referencing wrapped objects are
always inserted to the cache with budget decision kNo.

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

Review URL: https://codereview.chromium.org/1862043002
2016-04-22 01:48:29 -07:00
robertphillips
5e3815b4d0 Rein in the use of SkDevice.h
Nothing interesting.

TBR=reed@google.com

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

Review URL: https://codereview.chromium.org/1904673003
2016-04-20 05:29:51 -07:00
msarett
b92dc7ac0b Add bench for image encodes
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1890643003

Review URL: https://codereview.chromium.org/1890643003
2016-04-18 12:37:46 -07:00
halcanary
2299ffaaa1 Revert of SkPDF: PDF/A runtime switch (patchset #1 id:100001 of https://codereview.chromium.org/1891873002/ )
Reason for revert:
breaking something.

Original issue's description:
> SkPDF: PDF/A runtime switch
>
> TODO: remove gyp variable and modify API  in SkDocument.h
>
> BUG=skia:3110
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1891873002
>
> Committed: https://skia.googlesource.com/skia/+/570f18b43417d73c3fbd113cc0b4258e08b14c82

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

Review URL: https://codereview.chromium.org/1892203002
2016-04-15 12:30:21 -07:00
halcanary
570f18b434 SkPDF: PDF/A runtime switch
TODO: remove gyp variable and modify API  in SkDocument.h

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

Review URL: https://codereview.chromium.org/1891873002
2016-04-15 11:59:31 -07:00
robertphillips
534c270465 Update TileImageFilter to sk_sp
TBR=reed@google.com

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

Review URL: https://codereview.chromium.org/1882113002
2016-04-15 07:57:40 -07:00
robertphillips
bfe11fc9a6 Update DisplacementMapEffect to sk_sp
TBR=reed@google.com

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

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

Review URL: https://codereview.chromium.org/1877783003
2016-04-15 07:17:36 -07:00
robertphillips
47db5fe443 Revert of Update DisplacementMapEffect to sk_sp (patchset #3 id:40001 of https://codereview.chromium.org/1877783003/ )
Reason for revert:
unexpected image diffs in imagefilterscropexpand GM

Original issue's description:
> Update DisplacementMapEffect to sk_sp
>
> TBR=reed@google.com
>
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1877783003
>
> Committed: https://skia.googlesource.com/skia/+/a53011ef44705a091a8e24f7ea289a3f9ad759f2

TBR=fmalita@chromium.org,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/1884253004
2016-04-15 05:09:32 -07:00
robertphillips
a53011ef44 Update DisplacementMapEffect to sk_sp
TBR=reed@google.com

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

Review URL: https://codereview.chromium.org/1877783003
2016-04-15 04:37:07 -07:00
reed
3dc6aac5da remove U16 support, just support F16
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1889753002

Review URL: https://codereview.chromium.org/1889753002
2016-04-14 09:02:14 -07:00
mtklein
20efb41dbb distinguish distinct matrixconvolution benchmarks
Today they all show as "matrixconvolution", and we probably only log one.

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

Review URL: https://codereview.chromium.org/1886523002
2016-04-12 15:52:52 -07:00
halcanary
cbc060a700 SkWStream::writeText inlined.
Motivation: This function is used throughout SkPDF.

Note that the compiler can usually inline the result of strlen() for literal strings.

Before:
    out/Release/nanobench -m WStreamWriteText -q
        Timer overhead: 24.2ns
        ! -> high variance, ? -> moderate variance
            micros   	bench
              6.10  	WStreamWriteText	nonrendering

After:
    out/Release/nanobench -m WStreamWriteText -q
        Timer overhead: 23.9ns
        ! -> high variance, ? -> moderate variance
            micros   	bench
              2.51  	WStreamWriteText	nonrendering

PDF runtime change: -0.8% ±0.04%.

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

Review URL: https://codereview.chromium.org/1844343004
2016-04-11 19:41:48 -07:00
robertphillips
12fa47d33f Update LightingImageFilter to sk_sp
TBR=reed@google.com

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

Review URL: https://codereview.chromium.org/1869763002
2016-04-08 16:28:09 -07:00
senorblanco
7adf9c1dd2 Add some benches for SkArithmeticMode.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1868333002

Review URL: https://codereview.chromium.org/1868333002
2016-04-08 14:29:47 -07:00
herb
42da45d399 Fix context size for benchmakr.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1871173002

Review URL: https://codereview.chromium.org/1871173002
2016-04-08 14:24:37 -07:00