Commit Graph

23897 Commits

Author SHA1 Message Date
reed
2d5b714703 pin as texture api
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2241353002

Review-Url: https://codereview.chromium.org/2241353002
2016-08-17 11:12:33 -07:00
bungeman
4f81caf169 Move FamilyClass and Panose enums to enum class.
The IBMFamilyClass and Panose structures are obvious candidates
for simplification now that it is no longer necessary to nest
enums inside structs to avoid name clashes.

Review-Url: https://codereview.chromium.org/2253543004
2016-08-17 10:59:30 -07:00
egdaniel
138c26300f Fix various issues with framebuffer fetch
This CL does two things. First it fixes a bug of ours where when using
a custom fbFetch variable (es 3.0 and higher), we sometimes overwrite
the out color and then attempt to use it as the dst color later. This is
fixed here by using an intermediate variable.

Secondly I've added a workaround to an andreno fbFetch where reading from
the outColor always returns the original dstColor even if we've overwritten
the value.

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

Review-Url: https://codereview.chromium.org/2248403003
2016-08-17 10:59:00 -07:00
bsalomon
e4f2461113 Detemplatize GrGLSLGeometryProcessor::setTransformDataHelper()
Instead take a local matrix parameter.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2250563004

Review-Url: https://codereview.chromium.org/2250563004
2016-08-17 10:30:18 -07:00
mtklein
1da01c123d SkLiteDL: inline empty()
1.85%     1.85%  RenderThread     6458  6475  /system/lib64/libskia.so  SkLiteDL::empty() const

:/

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

Review-Url: https://codereview.chromium.org/2254823002
2016-08-17 10:20:27 -07:00
jvanverth
d7315f9133 Add alternative spot shadow to Android shadow sample
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2246273003

Review-Url: https://codereview.chromium.org/2256713002
2016-08-17 10:06:18 -07:00
csmartdalton
28341fad84 Implement difference clip rects with window rectangles
Plumbs the pipeline for window rectangles and uses them for a very
basic implementation of difference clip rects. This puts a common
Blink pattern on fast path, but we will still eventually need to make
more comprehensive use of window rectangles during clipping.

GTX 960 perf result:
                              gpu                     glinst4                 glinst16
desk_jsfiddlebigcar.skp       0.254 -> 0.177 [70%]    0.279 -> 0.197 [71%]    0.577 -> 0.196 [34%]
keymobi_sfgate_com_.skp       0.697 -> 0.513 [74%]    0.766 -> 0.451 [59%]    0.769 -> 0.597 [78%]
keymobi_blogger.skp           0.406 -> 0.314 [77%]    0.436 -> 0.292 [67%]    0.696 -> 0.319 [46%]
desk_pokemonwiki.skp          0.121 -> 0.098 [81%]     0.13 -> 0.105 [81%]    0.216 -> 0.097 [45%]
desk_wikipedia.skp            0.121 -> 0.098 [81%]     0.13 -> 0.104 [80%]    0.199 -> 0.104 [52%]
keymobi_androidpolice_co...   0.443 -> 0.382 [86%]    0.447 -> 0.398 [89%]    0.444 -> 0.396 [89%]
keymobi_booking_com_sear...   1 .15 ->  1.03 [90%]     1.17 ->  1.06 [91%]     1.17 ->  1.05 [90%]
keymobi_theverge_com.skp      0.417 -> 0.396 [95%]    0.426 -> 0.405 [95%]    0.429 ->   0.4 [93%]

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

Review-Url: https://codereview.chromium.org/2251573002
2016-08-17 10:00:22 -07:00
csmartdalton
8d3f92a92b Make GrReducedClip's gen ID only apply to the element list
Renames fGenID to fElementsGenID and designates this value as
undefined when when the element list is empty.

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

Review-Url: https://codereview.chromium.org/2244223004
2016-08-17 09:39:38 -07:00
robertphillips
d092ffd5a8 Kick the can down the road a bit w.r.t. fuzzer complaint
BUG=635787
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2247033006

Review-Url: https://codereview.chromium.org/2247033006
2016-08-17 09:28:59 -07:00
bsalomon
e553b64bca Fix tile bitmap code in SkGpuDevice to compute correct local coords.
This fixes a bug when using an alpha bitmap/image with a SkShader where the SkShader's GrFragmentProcessor would receive incorrect coordinates.

BUG=skia:5643

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

Review-Url: https://codereview.chromium.org/2249163004
2016-08-17 09:02:09 -07:00
bsalomon
31df31c12f Minor cleanup of GP classes in GrOvalRenderer
Move GLSL nested classes to private and remove unnecessary public getters.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2253903002

Review-Url: https://codereview.chromium.org/2253903002
2016-08-17 09:00:24 -07:00
msarett
549ca329cf Modify SkPngCodec to recognize 565 images from the sBIT chunk
Conveniently, SkPngImageEncoder already writes the sBIT chunk
appropriately.

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

Review-Url: https://codereview.chromium.org/2212563003
2016-08-17 08:54:08 -07:00
fmalita
d24ee1419f [SVGDom] Add <line> support
R=robertphillips@google.com,stephana@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2244223005

Review-Url: https://codereview.chromium.org/2244223005
2016-08-17 08:38:15 -07:00
robertphillips
4c56b9fa71 Cast for fuzzer complaint
Given the cast in the following else block, this isn't the first time we've encountered this.

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

Review-Url: https://codereview.chromium.org/2258463002
2016-08-17 08:02:51 -07:00
jvanverth
6c177a1a49 Add alternative ambient shadow method to Android shadow sample
TBR=bsalomon@google.com
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2249973003

Review-Url: https://codereview.chromium.org/2249973003
2016-08-17 07:59:41 -07:00
halcanary
86b6eabeae SkPDF: pull out SkPDFMakeCIDGlyphWidthsArray.cpp
Extract from inside SkPDFFont.cpp
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2251803002

Review-Url: https://codereview.chromium.org/2251803002
2016-08-17 07:57:27 -07:00
rmistry
93f366d675 Add gerrit config lines to cq.cfg
Needed for the CQ to see Gerrit. Eg:
https://cs.chromium.org/chromium/tools/depot_tools/infra/config/cq.cfg?q=cq.cfg&sq=package:chromium&dr=C&l=9

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

Review-Url: https://codereview.chromium.org/2251643005
2016-08-17 07:51:57 -07:00
reed
ff863bc550 move private test for sect_with_horizontal into unittests
BUG=638575
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2250353004

Review-Url: https://codereview.chromium.org/2250353004
2016-08-17 07:37:57 -07:00
egdaniel
bf63e616a6 Add mssa configs for vulkan, and simple bug fix
BUG=skia:5127
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2251473002

Review-Url: https://codereview.chromium.org/2251473002
2016-08-17 06:26:16 -07:00
caryclark
8ccc075a90 fix fuzz
TBR=reed@google.com
BUG=638496
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2250413002

Review-Url: https://codereview.chromium.org/2250413002
2016-08-17 06:14:06 -07:00
mtklein
422310ddbe GN: make current_cpu work
Then we can use it to remind ourselves that SSE and AVX are x86-only.

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

Review-Url: https://codereview.chromium.org/2247413003
2016-08-16 18:28:43 -07:00
mtklein
6480619f9f SkLiteDL: thread the original canvas matrix through for SetMatrix::Draw().
The SkLiteDL is recorded in some identity space (imagine, SkMatrix::I()),
but played back in a different one (here named SkMatrix original).  Any
calls to setMatrix() need to be made relative to this new space.

All other ops already operate in relative coordinates.

This should let us not fiddle with setMatrix().

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

Review-Url: https://codereview.chromium.org/2247353003
2016-08-16 17:18:27 -07:00
robertphillips
287e7cb936 Revert of Start using vertex attributes for nine-patch blurred rrect draws (patchset #8 id:140001 of https://codereview.chromium.org/2245653002/ )
Reason for revert:
??

Original issue's description:
> Start using vertex attributes for nine-patch blurred rrect draws
>
> Calved off:
> https://codereview.chromium.org/2243133002/ (Pull handling of blurred circles out of GrRRectBlurEffect::Make)
> https://codereview.chromium.org/2249463002/ (Update blurred rrect mask filter creation method to also handle caching)
> https://codereview.chromium.org/2248533002/ (Update ComputeBlurredRRectParams to compute all the parameters needed for occluded blurred rrect ninepatch draws)
>
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2245653002
>
> Committed: https://skia.googlesource.com/skia/+/087905a730241939da320092543c19dc06d5a7b4

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

Review-Url: https://codereview.chromium.org/2250543004
2016-08-16 15:49:20 -07:00
fmalita
dc4c2a9fb7 [SVGDom] Add <circle>, <ellipse> support
R=robertphillips@google.com,stephana@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2249033003

Review-Url: https://codereview.chromium.org/2249033003
2016-08-16 15:38:51 -07:00
msarett
36931c2b47 Add test for platform encoders, turn off platform encoders by default
Clients that like WIC and CG can still use them.  And we can be
confident about that, since we now test WIC and CG.

Let Skia always use our own encoders by default, so we can do cool,
custom things on all platforms.

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

Review-Url: https://codereview.chromium.org/2250683003
2016-08-16 15:11:24 -07:00
hstern
db085ab30f Fix bug in cubic derivative coefficient with missing parens
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2242603002

Review-Url: https://codereview.chromium.org/2242603002
2016-08-16 15:10:34 -07:00
robertphillips
087905a730 Start using vertex attributes for nine-patch blurred rrect draws
Calved off:
https://codereview.chromium.org/2243133002/ (Pull handling of blurred circles out of GrRRectBlurEffect::Make)
https://codereview.chromium.org/2249463002/ (Update blurred rrect mask filter creation method to also handle caching)
https://codereview.chromium.org/2248533002/ (Update ComputeBlurredRRectParams to compute all the parameters needed for occluded blurred rrect ninepatch draws)

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

Review-Url: https://codereview.chromium.org/2245653002
2016-08-16 14:50:19 -07:00
fmalita
179d88522c Only test SVG DM sources against direct raster/gpu sinks.
There isn't much value in testing against indirect or vector sinks.

R=mtklein@google.com,robertphillips@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2252443002

Review-Url: https://codereview.chromium.org/2252443002
2016-08-16 14:23:29 -07:00
bungeman
8fd23a86d0 Remove SkPreprocessorSeq.h and SkTypedEnum.h.
These were added to allow the use of typed enums before typed enums were
available on all platforms. Now that typed enums are available, just use
them directly.

Review-Url: https://codereview.chromium.org/2254513002
2016-08-16 12:27:49 -07:00
halcanary
6c80a9d4b0 SkPDF: Font names need escaping
NOTRY=true

Review-Url: https://codereview.chromium.org/2250763002
2016-08-16 11:54:58 -07:00
halcanary
28c6d83c98 SkPDF: eliminate SkPDFCIDfont class
get_glyph_widths() and set_glyph_widths() combined.

set_glyph_widths() now takes a SkPDFGlyphSet*.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2244173005

Review-Url: https://codereview.chromium.org/2244173005
2016-08-16 10:29:38 -07:00
caryclark
a1b42d91a5 fix fuzz bug
TBR=reed@google.com
BUG=637968, 638002
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2250573003

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

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

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

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

Review-Url: https://codereview.chromium.org/2246903002
2016-08-16 09:36:23 -07:00
mtklein
883c8efae7 SkLiteDL: remove freelisting, add reset() and SKLITEDL_PAGE knob.
We think Android can cache these better than a global freelist allows.
This removes the freelisting but adds reset() to allow reuse.

I took the opportunity to abstract 4096 as a define SKLITEDL_PAGE.

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

Review-Url: https://codereview.chromium.org/2248693004
2016-08-16 09:36:18 -07:00
mtklein
8079ba688c GN: add extra_cflags et al.
Adding flags to the end of cc or cxx is pretty useful, but these always end up
on the command line before the GN generated flags, thus setting defaults that
GN will override.

For full flexibility we want to be able to add flags after the flags GN has
added, so that custom flags can override _it_.

I've updated the Fast bots with an example here: if we said cc="clang -O3 ...",
that '-O3' would be overriden later by the default Release-mode '-Os'.  By
putting it in extra_cflags, we get the last word: our '-O3' overrides the
default '-Os'.

Another good use case is a hypothetical Actually-Shippable-Release mode.  Our
Release mode bundles in tons of debug symbols via '-g'.  libskia.a is about 10x
larger than it needs to be when built that way, but it helps us debug the bot
failures immensely.  To build a libskia.{a,so} that you'd really ship, you can
now set extra_cflags="-g0" to override '-g'.  You could set '-march' flags there
too, '-fomit-frame-pointer', etc.

There are lots of flags that won't matter where they end up in the command line.
To keep everything simple I've put them in extra_cflags with the rest.  This means
the only time we change 'cc' or 'cxx' in our recipes is to prefix 'ccache'.

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

Review-Url: https://codereview.chromium.org/2241263003
2016-08-16 09:31:16 -07:00
msarett
168820625c Add onDrawBitmapLattice(), avoid unnecessary bitmap->image copy
out/Release/nanobench --match Lattice --config gpu --ms 3000
3.42ms -> 17.2us

For reference, a loop over drawBitmapRects (which is what
Android currently does) is about 13us.

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

Review-Url: https://codereview.chromium.org/2205273003
2016-08-16 09:31:08 -07:00
robertphillips
c4d2f90731 Update ComputeBlurredRRectParams to compute all the parameters needed for occluded blurred rrect ninepatch draws
This is split out of: https://codereview.chromium.org/2245653002/ (Start using vertex attributes for nine-patch blurred rrect draws)

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

Review-Url: https://codereview.chromium.org/2248533002
2016-08-16 09:30:03 -07:00
mtklein
2f4114a246 32-bit fast hash, tidy up murmur3 a bit
Nothing too surprising in the new 32-bit x86 hash.  It's about half speed of the 64-bit variant, just as you'd expect.

Using unaligned_load like the others makes the may_alias parts of murmur3 moot.  I've updated some of the terms in the murmur hash to read consistently with the others.

The existing hashes are the same speed and produce the same hashes.  In case this is not obvious, all three hash functions produce different hashes.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2251773002
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/2251773002
2016-08-16 09:29:57 -07:00
bsalomon
af68fa11ed Improvements for circluar blurs in GPU backend.
Use half plane approximation for small blur of a large circle. This reduces
the number of textures used and also avoids numerical issues with large
circle radii.

Make GrCircleGradientEffect use fixed sized textures.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2242973002

Review-Url: https://codereview.chromium.org/2242973002
2016-08-16 09:24:57 -07:00
fmenozzi
af23ee538b Reducing number of calls to GLSL mix() from two to one reduces frame render time by 21%
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2247113003

Review-Url: https://codereview.chromium.org/2247113003
2016-08-16 09:24:52 -07:00
brianosman
80e96088bc Remove isOpaque from SkSpecialImage, just use alpha type
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2246193002

Review-Url: https://codereview.chromium.org/2246193002
2016-08-16 07:09:47 -07:00
fmalita
b5b6de9b94 Disable Nebraska-StateSeal.svg on Win8 bots
Temporary suppression, pending bug fix.

BUG=skia:5636
R=robertphillips@google.com,senorblanco@chromium.org
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2249763002

Review-Url: https://codereview.chromium.org/2249763002
2016-08-16 07:08:48 -07:00
reed
c687448806 simplify GrTextureAdjuster given there is only one subclass
Intended as a pre-cl for https://codereview.chromium.org/2241353002#

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

Review-Url: https://codereview.chromium.org/2242373002
2016-08-16 06:39:39 -07:00
vjiaoblack
d707f2d1cf Moved "drawShadowedPicture" call outside of if cases in onDrawContent.
Bug description:
If you updated the view without changing frames (such as moving around the
cursor with 'z' (pixel zoom) on) the window would turn gray.

This was because I left the drawShadowedPicture call inside of the "if-updated"
case inside of SampleShadowing's onDrawContent handler.

If nothing changed and onDrawContent is called, we still need to update the
given canvas's fLights (there is no guarantee of whether the canvas (or its
fLights) has been updated or not), and then draw the shadowed picture.

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

Review-Url: https://codereview.chromium.org/2245923002
2016-08-16 05:38:45 -07:00
msarett
c5064d9c3d Revert of Add regression test (patchset #2 id:20001 of https://codereview.chromium.org/2243143002/ )
Reason for revert:
Nexus 9 and Nexus Player failures.

Original issue's description:
> Add regression test
>
> Original bug fix was in:
> https://codereview.chromium.org/2230163002
>
> BUG:636268
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2243143002
>
> Committed: https://skia.googlesource.com/skia/+/bcae9d3d15d34a59d279c34e187e6101975500c0

TBR=reed@google.com,gogil@stealien.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/2243403003
2016-08-16 04:54:19 -07:00
msarett
36c38cbb29 Fix WIC encoder to support kJPEG_Type
(1) Add support for kJPEG to WIC
(2) Add encoding test.
(3) Turn on WIC jpeg encoder on Windows and CG jpeg
    encoder on Mac.

A follow-up may make Skia's encoders the default on all
platforms.  But, in order to do that, I think we need
to write better encoding unit tests for CG and WIC.

BUG=skia:3969
BUG=skia:5632
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2245453002

Committed: https://skia.googlesource.com/skia/+/b3a7ef1fc0adc24859d2498aee54d3ec2cbcac3a
Review-Url: https://codereview.chromium.org/2245453002
2016-08-15 18:52:17 -07:00
halcanary
4ed2f01cf6 SkPDF: unify drawText and drawPosText
Motivation: a later CL will add drawTextBlob() (after
https://crrev.com/2084533004 lands).  This CL is designed
with that change in mind.  Also fewer redundant lines of
code.

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

Committed: https://skia.googlesource.com/skia/+/6059dc32fe36358175cb81541c91e74a2a7e771a
Review-Url: https://codereview.chromium.org/2241683005
2016-08-15 18:40:07 -07:00
robertphillips
5ba165ee9c Revert of SkPDF: unify drawText and drawPosText (patchset #2 id:40001 of https://codereview.chromium.org/2241683005/ )
Reason for revert:
I believe this is breaking the Google3 roll

Original issue's description:
> SkPDF: unify drawText and drawPosText
>
> Motivation: a later CL will add drawTextBlob() (after
> https://crrev.com/2084533004 lands).  This CL is designed
> with that change in mind.  Also fewer redundant lines of
> code.
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2241683005
>
> Committed: https://skia.googlesource.com/skia/+/6059dc32fe36358175cb81541c91e74a2a7e771a

TBR=bungeman@google.com,halcanary@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/2248923002
2016-08-15 15:36:58 -07:00
hstern
e6f8ff0013 Defined SkDEBUGFAILF on Release builds
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2244253003

Review-Url: https://codereview.chromium.org/2244253003
2016-08-15 15:26:31 -07:00
bsalomon
7f0d9f3920 Attempt to throw away rrect clips of rrects.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2241273003

Review-Url: https://codereview.chromium.org/2241273003
2016-08-15 14:49:10 -07:00