Commit Graph

23657 Commits

Author SHA1 Message Date
brianosman
69c166d2ce Add alphaType() to SkImage
Keep isOpaque as a convenience method -- many places really only need to
know that for optimization purposes (SrcOver -> Src, etc...).

In all the places where we pull data back out or convert to another
object and need to supply an SkImageInfo, we can avoid losing information
about premulness.

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

Review-Url: https://codereview.chromium.org/2250663002
2016-08-17 14:01:05 -07:00
anmittal
a7eaf2e7e8 Fix BUILD.gn for arch other then x86 and x64
opts_gypi should only be defined for x86 and x64 else we get unused
variable error

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

Review-Url: https://codereview.chromium.org/2248323002
2016-08-17 13:57:26 -07:00
bsalomon
c3953afe5a Fix computation of clipped src rect when tiling bitmaps in SkGpuDevice
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2252913004

Review-Url: https://codereview.chromium.org/2252913004
2016-08-17 13:56:57 -07:00
csmartdalton
52d721580e Reduce window rectangles cap to 8
Lowers the cap to 8 and adds a warning message if this value is ever
exceeded. The largest (only) implementation currently supports 8, so
there isn't yet reason to go higher.

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

Review-Url: https://codereview.chromium.org/2254013002
2016-08-17 13:52:15 -07:00
herb
1ae57b37bd Eagerly update the unichar to glyphID mapping.
In addition, some small cleanups.

BUG=chromium:635005
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2249063005

Review-Url: https://codereview.chromium.org/2249063005
2016-08-17 13:51:54 -07:00
reed
0e7bddfb34 fix no-gpu build
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2253073003

TBR=robertphilips
NOTREECHECKS=true

Review-Url: https://codereview.chromium.org/2253073003
2016-08-17 13:24:05 -07:00
egdaniel
bd4121ab24 Fix fb variable name in GLSL
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2252143002

NOTREECHECKS=True

Review-Url: https://codereview.chromium.org/2252143002
2016-08-17 12:55:30 -07:00
mtklein
91cd2803e7 SkLiteDL: a little spring cleaning
- kill off optimizeFor() now that we know it's broken and have a better way;
  - simplify makeThreadsafe() a bit: we're not calling it anyway.

This sort of earns me back some crazy code currency,
which I am going to try to spend making reset() faster.

If anything, this appears to make makeThreadsafe() _faster_.

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

Review-Url: https://codereview.chromium.org/2254913002
2016-08-17 11:39:48 -07:00
bsalomon
6cb807bf99 Simplify adding attributes to GrGeometryProcessor
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2248323003

Review-Url: https://codereview.chromium.org/2248323003
2016-08-17 11:33:39 -07:00
fmalita
9da5dbdda3 Fix SampleAndroidShadows warnings
R=jvanverth@google.com,robertphillips@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2255863002
NOTRY=true

Review-Url: https://codereview.chromium.org/2255863002
2016-08-17 11:33:29 -07:00
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