Commit Graph

23545 Commits

Author SHA1 Message Date
rmistry
d1cfb5bebe Add "svg" asset
BUG=skia:5628
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2235763002

Review-Url: https://codereview.chromium.org/2235763002
2016-08-10 07:23:51 -07:00
robertphillips
94b5c5a411 Create blurred RRect mask on GPU (rather than uploading it)
This CL doesn't try to resolve any of the larger issues. It just moves the computation of the blurred RRect to the gpu and sets up to start using vertex attributes for a nine patch draw (i.e., returning the texture coordinates)

All blurred rrects using the "analytic" path will change slightly with this CL.

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

Committed: https://skia.googlesource.com/skia/+/75ccdc77a70ec2083141bf9ba98eb2f01ece2479
Review-Url: https://codereview.chromium.org/2222083004
2016-08-10 07:14:55 -07:00
halcanary
c5769b2e49 Revert of Change mapRectScaleTranslate to pass args/ret by value (patchset #2 id:20001 of https://codereview.chromium.org/2138943002/ )
Reason for revert:
Build-Ubuntu-GCC-Arm7-Release-Android fails.

Original issue's description:
> Change mapRectScaleTranslate to pass args/ret by value
>
> This reverts commit 6092b6e0e5.
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2138943002
>
> Committed: https://skia.googlesource.com/skia/+/1bd13ca922d6448d595064faee486eaf3fa56e56

TBR=mtklein@google.com,msarett@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/2234843002
2016-08-10 07:13:21 -07:00
rmistry
d8a620b173 SVG tool that downloads SVGs from a txt file into a specified dir
BUG=skia:5628
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2234823002

Review-Url: https://codereview.chromium.org/2234823002
2016-08-10 07:00:43 -07:00
reed
d5b88a3dc5 remove support for serializing bitmaps in old format
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2230973002

Review-Url: https://codereview.chromium.org/2230973002
2016-08-10 06:37:43 -07:00
reed
1bd13ca922 Change mapRectScaleTranslate to pass args/ret by value
This reverts commit 6092b6e0e5.

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

Review-Url: https://codereview.chromium.org/2138943002
2016-08-10 06:17:54 -07:00
robertphillips
69cfa9c28d Revert of Create blurred RRect mask on GPU (rather than uploading it) (patchset #4 id:60001 of https://codereview.chromium.org/2222083004/ )
Reason for revert:
Erg - dumb bug

Original issue's description:
> Create blurred RRect mask on GPU (rather than uploading it)
>
> This CL doesn't try to resolve any of the larger issues. It just moves the computation of the blurred RRect to the gpu and sets up to start using vertex attributes for a nine patch draw (i.e., returning the texture coordinates)
>
> All blurred rrects using the "analytic" path will change slightly with this CL.
>
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2222083004
>
> Committed: https://skia.googlesource.com/skia/+/75ccdc77a70ec2083141bf9ba98eb2f01ece2479

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/2236493002
2016-08-10 06:15:33 -07:00
fmalita
c52310402c Prevent degenerate linear gradient instantiation
If the point distance exceeds SkScalar, nasty things tend to happen.

R=reed@google.com
BUG=636194
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2234663002

Review-Url: https://codereview.chromium.org/2234663002
2016-08-10 05:45:50 -07:00
robertphillips
75ccdc77a7 Create blurred RRect mask on GPU (rather than uploading it)
This CL doesn't try to resolve any of the larger issues. It just moves the computation of the blurred RRect to the gpu and sets up to start using vertex attributes for a nine patch draw (i.e., returning the texture coordinates)

All blurred rrects using the "analytic" path will change slightly with this CL.

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

Review-Url: https://codereview.chromium.org/2222083004
2016-08-10 05:33:12 -07:00
halcanary
d0c38315e8 SkPDF: bikeshed: use auto less
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2234623002

Review-Url: https://codereview.chromium.org/2234623002
2016-08-09 20:04:01 -07:00
halcanary
e9d55c57a6 Revert of Store mipmap levels in deferred texture image (patchset #11 id:200001 of https://codereview.chromium.org/2115023002/ )
Reason for revert:
speculative revert: android dm crashes

Original issue's description:
> Store mipmap levels in deferred texture image
>
> This is a follow-up to https://codereview.chromium.org/2034933003/ which
> was reverted due to a memory leak.
>
> When creating the deferred texture image, detect if using medium / high
> quality. If so, generate and store mipmaps in the deferred texture
> image.
>
> When creating a texture from that be sure to read it back out.
>
> BUG=578304
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2115023002
>
> Committed: https://skia.googlesource.com/skia/+/d6113140f7ae8996f679ac6698a60fb8c1386da3

TBR=brianosman@google.com,bsalomon@google.com,ericrk@chromium.org,cblume@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=578304

Review-Url: https://codereview.chromium.org/2227323002
2016-08-09 17:46:25 -07:00
mtklein
cd8864111d constexpr infinity
~/skia (inf) $ nm /tmp/rel/obj/src/core/libskia.SkLiteDL.o | grep GLOBAL__sub
<nothing>

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

Review-Url: https://codereview.chromium.org/2228203002
2016-08-09 16:37:47 -07:00
mtklein
b20283357a allocate memory manually in SkLiteDL
Instead of growing at SkTDArray's chosen rate (+4, then *1.25),
grow in additive 4K pages.  This is my attempt to make realloc()
have the best chance of not copying and to keep fragmentation down.
Because we use a freelist the rate we grow doesn't affect performance
too much.

I'm not getting very reliable numbers, but this looks maybe 5-10% faster
for recording, mainly I think from inlining the allocation fast path into
push().

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

Review-Url: https://codereview.chromium.org/2231553002
2016-08-09 15:13:18 -07:00
mtklein
baeec6d25e SkLiteDL: add some missing std::move()
This cuts a ref+unref roundtrip on all draw{Bitmap,Image}

I set this up originally and just... forgot.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2234483002

Review-Url: https://codereview.chromium.org/2234483002
2016-08-09 15:09:39 -07:00
brianosman
5702c861c4 Restore scratch texture reuse on Adreno.
New testing shows that it's a win on our slowest SKPs, and pretty much a
wash on faster tests (mixed results). However, it also saves us ~3 ms on
the hwui bitmap upload jank test.

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

Review-Url: https://codereview.chromium.org/2227983003
2016-08-09 14:02:13 -07:00
rmistry
5eab99183c Move ct_skps recipe from tools repo to Skia repo.
Also move the isolate file and script from Chromium repo to the Skia repo.

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

Review-Url: https://codereview.chromium.org/2221413002
2016-08-09 13:46:48 -07:00
cblume
d6113140f7 Store mipmap levels in deferred texture image
This is a follow-up to https://codereview.chromium.org/2034933003/ which
was reverted due to a memory leak.

When creating the deferred texture image, detect if using medium / high
quality. If so, generate and store mipmaps in the deferred texture
image.

When creating a texture from that be sure to read it back out.

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

Review-Url: https://codereview.chromium.org/2115023002
2016-08-09 13:45:56 -07:00
halcanary
8eccc308c8 SkPDF: SkPDFFont organization changes.
SkPDFFont:
  - SkPDFType1Font::populate() encode advances correctly.
  - break out logically independent code into new files:
    * SkPDFConvertType1FontStream
    * SkPDFMakeToUnicodeCmap
    SkPDFFont.cpp is now 380 lines smaller.
    Expose `SkPDFAppendCmapSections()` for testing.

SkPDFFontImpl.h
  - Fold into SkPDFFont.

SkPDFConvertType1FontStream:
  - Now assume given a SkStreamAsset

SkPDFFont:
  - AdvanceMetric now hidden in a anonymous namespace.

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

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

Review-Url: https://codereview.chromium.org/2221163002
2016-08-09 13:04:34 -07:00
csmartdalton
9bc1187249 Include EXT_window_rectangles API
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2221393004

Review-Url: https://codereview.chromium.org/2221393004
2016-08-09 12:42:47 -07:00
mtklein
b47cd4b3d6 Use SkNVRefCnt for a couple common types.
These types are ref-counted, but don't otherwise need a vtable.
This makes them good candidates for SkNVRefCnt.

Destruction can be a little more direct, and if nothing else,
sizeof(T) will get a little smaller by dropping the vptr.

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

Review-Url: https://codereview.chromium.org/2232433002
2016-08-09 12:20:04 -07:00
mtklein
c0fc9d6356 SkLiteDL: tiny perf tweak
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2229003003

Review-Url: https://codereview.chromium.org/2229003003
2016-08-09 11:44:12 -07:00
rmistry
3df72283ee Use slave_build instead of checkout in run/api.py
BUG=skia:5620
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2221423002

Review-Url: https://codereview.chromium.org/2221423002
2016-08-09 11:15:57 -07:00
jvanverth
a489e3f1fb Add RasterWindowContext_mac
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2228883003

Review-Url: https://codereview.chromium.org/2228883003
2016-08-09 10:53:11 -07:00
mtklein
2ee6982d95 Sample app uses Ganesh before calling SkGraphics::Init().
This causes inconsistent hashing.  Before Init(), we use portable Murmur3,
after a faster SSE4.2-based hash.

To fix, call SkGraphics::Init() first.

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

Review-Url: https://codereview.chromium.org/2229853002
2016-08-09 10:13:28 -07:00
hstern
23d9776024 Move seg_to to a new header, define SkSegType enum there
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2221203002

Review-Url: https://codereview.chromium.org/2221203002
2016-08-09 09:38:30 -07:00
vjiaoblack
904527d165 moved code into onDrawShadowedPic, only renders into shadow maps if needed
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2220633002

Review-Url: https://codereview.chromium.org/2220633002
2016-08-09 09:32:09 -07:00
hstern
bb9b2247a2 Rework Overstroke GM to show differences between expected and actual
Draw the perpendiculars of the curve with the stroke width. See Cary's
SampleQuadStroker.cpp for what we are attempting to mimic.

BUG=589769,skia:5405,skia:5406
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2218773003

Review-Url: https://codereview.chromium.org/2218773003
2016-08-09 08:53:30 -07:00
fmenozzi
55d318d35f Refactor various gradient effect classes
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2221133002

Review-Url: https://codereview.chromium.org/2221133002
2016-08-09 08:05:58 -07:00
mtklein
0c753e5c26 Purge the SkLiteDL freelist when PurgeAllCaches() is called.
Seems like the polite thing to do.

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

Review-Url: https://codereview.chromium.org/2228953002
2016-08-09 07:40:23 -07:00
mtklein
8369e32a05 SkLiteRecorder: don't tell SkCanvas about clips
If no one reads our clip, and we don't expect quickReject() to help,
we can probably get away without maintaining a proper clip stack.

This puts us at about 0.6-0.7x of previous record cost.

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

Review-Url: https://codereview.chromium.org/2227833004
2016-08-09 07:19:02 -07:00
caryclark
d5b9173fe8 add flaky test option
One fuzzer generated pathops test
fails everywhere except for one
builder. Add a flaky state to the
pathops test framework to handle
this until I can investigate
further.

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

Review-Url: https://codereview.chromium.org/2221153005
2016-08-09 05:04:29 -07:00
martina.kollarova
fc3ea41ceb Check more GLES versions when creating context
Unifies the context creation for GL and GLES into a single loop.

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

Review-Url: https://codereview.chromium.org/2201033003
2016-08-09 01:41:55 -07:00
caryclark
643ede6921 template intersection fuzz fixes
Plumb in the ability to ignore asserts for out of range input
deeper into the template intersection code.

Exit gracefully when error conditions are found.

TBR=reed@google.com
BUG=632607,632628,633063,633065,634251,633608
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2224823004

Review-Url: https://codereview.chromium.org/2224823004
2016-08-08 14:27:45 -07:00
fmalita
61f36b3708 [SVGDom] Improve whitespace handling in style parsing
Handle whitespace-padded style names/values.

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

Review-Url: https://codereview.chromium.org/2225623002
2016-08-08 13:58:50 -07:00
lsalzman
0adbd3e0a6 make SpecialLineRec::addSegment assert more permissive to accomodate rounding error
Because the driving code that calls SpecialLineRec::addSegment uses double precision,
when converted back to single precision this may round such that d0 and d1 are the same.
This causes the assert to trigger. The simplest thing to do here is to modify the assert
to not be so picky and allow the rare/occasional equality.

Downstream Firefox bug report: https://bugzilla.mozilla.org/show_bug.cgi?id=1290628

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

Review-Url: https://codereview.chromium.org/2209303004
2016-08-08 13:40:27 -07:00
fmalita
c97796b47b [SVGDom] Improved transform parsing
Update 'transform' attribute parsing to a more robust, SkSVGAttributeParser-based implementation.

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

Review-Url: https://codereview.chromium.org/2220933003
2016-08-08 12:58:57 -07:00
mtklein
9dcdc352c1 add missing include
CQ_INCLUDE_TRYBOTS=master.client.skia:Perf-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-MSAN-Trybot

Review-Url: https://codereview.chromium.org/2226783002
2016-08-08 12:54:08 -07:00
hstern
0446a3c8e2 Add initial CurveMeasure code
- This code is entirely private and is not being used by anything.

- In a future CL we will write a class that uses CurveMeasure to compute dash points. In order to determine whether CurveMeasure or PathMeasure should be faster, we need the dash info (the sum of the on/off intervals and how many there are)

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

Review-Url: https://codereview.chromium.org/2187083002
2016-08-08 12:28:13 -07:00
mtklein
765b6e6548 SkLiteDL: control reuse by a single parameter
This simply caps the number of times a display list can be reused.
As this number goes up, the average amount of memory we cache goes up
and the expected number of mallocs per SkLiteDL::New() goes down.

This strategy does not need a hard-coded cap on how many display lists
to cache, or how big they can grow.

TBR=herb@google.com

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

Review-Url: https://codereview.chromium.org/2226813002
2016-08-08 12:23:02 -07:00
dvonbeck
84bca78ab4 Split distance vector into direction and magnitude components
The vector was split because the vector's users need it split, and we were creating it from the split components in the first place, so it made sense to skip that step.

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

Review-Url: https://codereview.chromium.org/2223053002
2016-08-08 11:47:12 -07:00
fmalita
397a517d1a [SVGDom] Add viewBox support
The main feature is <svg> viewBox and proper viewport support, but the CL
touches a few other things:

* refactor SkSVGRenderContext to auto-restore canvas state, and split the
  presentation bits into a separate CoW SkSVGPresentationContext

* introduce SkSVGNode::onPrepareToRender(), as a way for nodes to push their
  custom state before the actual onRender() call (instead of relying on
  non-virtual SkSVGNode to know about all possible state bits)

* add a "Type" suffix to SVG types, to disambiguate (e.g. SkSVGRectType vs.
  SkSVGRect)

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

Review-Url: https://codereview.chromium.org/2222793002
2016-08-08 11:38:55 -07:00
dvonbeck
f621ff49a2 Fixed comment about SkLightingShader::Context memory handling
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2225093002

Review-Url: https://codereview.chromium.org/2225093002
2016-08-08 11:25:13 -07:00
halcanary
eba373ef0a SkTypeface_win_dw.cpp remove unused fn
TBR=bungeman@google.com
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2226653003

Review-Url: https://codereview.chromium.org/2226653003
2016-08-08 11:09:33 -07:00
csmartdalton
77f2fae49e Encapsulate GrReducedClip result in class members
Updates GrReducedClip to store its result in class members instead of
various pointer arguments. This helps clean up calling code and will
make it easier to reduce the clip higher in the stack.

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

Review-Url: https://codereview.chromium.org/2222873002
2016-08-08 09:55:06 -07:00
robertphillips
0652baa23e Revert of Cleanup use of legacy SkSurface creation methods a bit (patchset #2 id:20001 of https://codereview.chromium.org/2223023002/ )
Reason for revert:
webkit_headless!

Original issue's description:
> Cleanup use of legacy SkSurface creation methods a bit
>
> This:
>    removes the SK_SUPPORT_LEGACY_NEW_SURFACE_API flag from the bzl build
>    cleans up some remaining uses of the old API
>
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2223023002
>
> Committed: https://skia.googlesource.com/skia/+/f21cd16228c20927fa4e9b937d6951471cfaa37a

TBR=benjaminwagner@google.com,egdaniel@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/2220933004
2016-08-08 09:17:20 -07:00
halcanary
8b1d32c8d0 SkPDF/SkAdvancedTypefaceMetrics: simplify ATM, PDF takes over
No public API changes.
TBR=reed@google.com

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

Review-Url: https://codereview.chromium.org/2222523003
2016-08-08 09:09:59 -07:00
mtklein
4e97607d9a Use sse4.2 CRC32 instructions to hash when available.
About 9x faster than Murmur3 for long inputs.

Most of this is a mechanical change from SkChecksum::Murmur3(...) to SkOpts::hash(...).

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2208903002
CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot;master.client.skia.compile:Build-Ubuntu-GCC-x86_64-Release-CMake-Trybot,Build-Mac-Clang-x86_64-Release-CMake-Trybot

Review-Url: https://codereview.chromium.org/2208903002
2016-08-08 09:06:28 -07:00
reed
9a5a201472 use onPeekBitmap instead of asLegacyBitmap
Since we know we are raster-backed at this point, it is fine, plus it avoids the copy-mutable logic in asLegacyBitmap, which is not needed here (and is slower if our bitmap was built with kNever_SkCopyPixelsMode).

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

Review-Url: https://codereview.chromium.org/2223653002
2016-08-08 09:00:29 -07:00
msarett
b9a10d8c75 Fix alpha bug in SkColorXform
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2221933002

Review-Url: https://codereview.chromium.org/2221933002
2016-08-08 08:13:09 -07:00
bungeman
f95388da1a Remove SK_SUPPORT_LEGACY_DATA_FACTORIES.
The code protected by this flag is no longer used. Remove the flag and
code. This also removes SK_SUPPORT_LEGACY_TYPEFACE_PTR from Android, as
it is no longer needed.

TBR=reed
Only removes already guarded API.

Review-Url: https://codereview.chromium.org/2223933002
2016-08-08 08:09:10 -07:00