Commit Graph

2600 Commits

Author SHA1 Message Date
fmenozzi
7a9f3766aa Update hardstop_gradients GM to include more special cases
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2204873005

Review-Url: https://codereview.chromium.org/2204873005
2016-08-03 07:58:06 -07:00
bungeman
38d909ec28 Move off SK_SUPPORT_LEGACY_DATA_FACTORIES.
This moves Skia code off of SK_SUPPORT_LEGACY_DATA_FACTORIES.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2206633004

Review-Url: https://codereview.chromium.org/2206633004
2016-08-02 14:40:46 -07:00
hstern
02aea1c92c Add Overstroke gm
Already exists as a sampleapp, but sampleapps don't get tested
automatically

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

Review-Url: https://codereview.chromium.org/2161633002
2016-08-02 10:35:57 -07:00
msarett
c573a40ed5 Add drawImageLattice() and drawBitmapLattice() APIs
The specified image/bitmap is divided into rects, which
can be draw stretched, shrunk, or at a fixed size.  Will be
used by Android to draw 9patch (which are acutally N-patch)
images.

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

Review-Url: https://codereview.chromium.org/1992283002
2016-08-02 08:05:56 -07:00
vjiaoblack
53da5ba619 adding new GM to demostrate new shadows
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2118553002

Review-Url: https://codereview.chromium.org/2118553002
2016-08-01 10:02:31 -07:00
fmalita
eae6a91277 SkPaint intercept API for SkTextBlob and horizontal text
Add getPosTextHIntercepts(), getTextBlobIntercepts().

Consolidate the implementation in GetTextIntercepts<> template.

BUG=chormium:581456
R=caryclark@google.com,reed@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2186663004

Review-Url: https://codereview.chromium.org/2186663004
2016-07-28 09:47:24 -07:00
robertphillips
a408c8fb6d Add SkGammaColorFilter
WDYT about this as a means of replacing GrContext::applyGamma with a normal SkCanvas::drawImage?

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

Review-Url: https://codereview.chromium.org/2190573002
2016-07-28 09:20:33 -07:00
dvonbeck
bba4cfebca Added API for Bevel NormalSource.
This CL adds an API  for Bevel normal source and a dummy implementation that returns a normal (0, 0, 1) every time.

This CL's base is the CL for accepting nullptrs: https://codereview.chromium.org/2132113002

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

Review-Url: https://codereview.chromium.org/2080993002
2016-07-28 08:58:19 -07:00
brianosman
3a0dbde1cf Remove SkSurfaceProps gamma-correctness flag entirely.
This is no longer required - gamma-correctness is now just based on the
presence or absence of a color space.

Public API change is just removal of (unused) flag.

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

Review-Url: https://codereview.chromium.org/2188463002
2016-07-26 11:36:05 -07:00
egdaniel
26318c984f Update bleed-downscale GM to use power of 2 texture
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2179303004

Review-Url: https://codereview.chromium.org/2179303004
2016-07-26 08:26:46 -07:00
brianosman
8fe485b793 Just pass the draw context to paint conversion
Concentrate on using draw context functionality to answer gamma and color
related queries in more places.

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

Review-Url: https://codereview.chromium.org/2182603003
2016-07-25 12:31:51 -07:00
reed
2adecda92b add gm to test bleed with downscale
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2182503002

TBR=

Review-Url: https://codereview.chromium.org/2182503002
2016-07-25 08:11:58 -07:00
brianosman
1638c0deea Add destination color space to AsFPArgs. Eliminates last XFORMTODO.
This is going to be needed in many more places as I finish connecting the
dots. Even better - I'd like to switch to a world where SkColorSpace !=
nullptr is the only signal we use for gamma-correct rendering, so I can
eliminate SkSourceGammaTreatment and SkSurfaceProps::isGammaCorrect.

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

Review-Url: https://codereview.chromium.org/2180503002
2016-07-25 05:12:53 -07:00
brianosman
839345d634 Bundle SkShader::asFragmentProcessor arguments in a struct
The signature of this thing keeps changing (and is about to change again).
This just makes maintenance much easier.

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

Review-Url: https://codereview.chromium.org/2175563003
2016-07-22 11:04:53 -07:00
bungeman
5379051ee7 Fix SkScalerContext_FreeType::generateFontMetrics.
SkScalerContext::generateFontMetrics implementations should not attempt
to take into account skew. This implementation should correctly handle
bitmap fonts as well.

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

Review-Url: https://codereview.chromium.org/2165323002
2016-07-21 13:32:09 -07:00
dvonbeck
680e2e9a9e Fixed GM:lightingshader2 size
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2171853002

Review-Url: https://codereview.chromium.org/2171853002
2016-07-21 12:19:54 -07:00
brianosman
dddbe380b0 Adding an SkColorSpace to SkImage_Gpu
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2165703003

Review-Url: https://codereview.chromium.org/2165703003
2016-07-20 13:55:39 -07:00
dvonbeck
c526da94e4 SkLS now accepting nullptr for diffuse shader and normal source, now accurately handling alpha
This CL's base is the CL for taking in a diffuse shader into SkLS on the API side: https://codereview.chromium.org/2064153002

BUG=skia:5502,skia:5517
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2132113002

Review-Url: https://codereview.chromium.org/2132113002
2016-07-20 11:20:30 -07:00
brianosman
54f30c13fc Introduce GrColorSpaceXform, for gamut conversion on textures
GrTextureAccess optionally includes an instance, computed from the src
and dst color spaces. In all common cases (no color space for either src
or dst, or same color space for both), no object is allocated.

This change is orthogonal to my attempts to get color space attached to
render targets - regardless of how we choose to do that, this will give
us the source color space at all points where we are connecting src to
dst.

There are many dangling injection points where I've been inserting
nullptr, but I have a record of all of them. Additionally, there are now
three places (the most common simple paths for bitmap/image rendering)
where things are plumbed enough that I expect to have access to the dst
color space (all marked with XFORMTODO).

In addition to getting the dst color space, I need to inject shader code
and uniform uploading for appendTextureLookup and friends.

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

Review-Url: https://codereview.chromium.org/2154753003
2016-07-18 10:53:52 -07:00
halcanary
39f988eb41 SkPDF: Always give a default advance for glyphs.
Prior to this we assumed the default default was 0.  It is
actually 1000, according to the spec.

fixes BUG=skia:5321
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2146403005

Review-Url: https://codereview.chromium.org/2146403005
2016-07-15 12:54:30 -07:00
mtklein
6e21efd842 Probably no need for GM self-tests now that GM doesn't exist.
This is... belated.

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

Review-Url: https://codereview.chromium.org/2154603002
2016-07-14 19:39:38 -07:00
bsalomon
7cf36ccb44 Stop testing texture-backed bitmaps in drawbitmaprect GM
BUG=skia:5531
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2148793003

Review-Url: https://codereview.chromium.org/2148793003
2016-07-14 09:33:42 -07:00
bsalomon
614d8f9a3c Remove GrWrapTextureInBitmap from public API
BUG=skia:5531
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2147053002

Review-Url: https://codereview.chromium.org/2147053002
2016-07-13 15:42:40 -07:00
bsalomon
a2e0837c33 Stop testing texture-backed bitmaps in bleed GMs
BUG=skia:5531

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

Review-Url: https://codereview.chromium.org/2141973004
2016-07-13 14:50:17 -07:00
bungeman
f382b48687 Disable aliased font test on iOS.
See if not requesting aliased text fixes iOS.

BUG=skia:5530

TBR=mtklein

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

Review-Url: https://codereview.chromium.org/2150483003
2016-07-13 14:00:39 -07:00
csmartdalton
97f6cd5d0f Pre-crop filled rects to avoid scissor
Updates GrDrawContext to crop filled rects to the clip bounds before
creating batches for them. Also adds clipping logic to ignore scissor
when the draw falls completely inside. These two changes combined
reduce API traffic and improve batching.

In the future this can and should be improved by switching to floating
point clip boundaries, thus allowing us to throw out non pixel aligned
rectangle clips as well.

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

Committed: https://skia.googlesource.com/skia/+/7969838702135b9f127bd738728da61bc49b050a
Committed: https://skia.googlesource.com/skia/+/86de59f4a99b5f54be0483c60ff0335be55b2bdf
Review-Url: https://codereview.chromium.org/2132073002
2016-07-13 13:37:08 -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
bungeman
82945560e6 Disable embedded bitmap test on iOS.
The TypefaceRenderingGM crashes on iOS when drawing an embedded
bitmap when requesting aliased rendering. The crash looks like

libTrueTypeScaler.dylib`<redacted> + 80
stop reason = EXC_BAD_ACCESS (code=EXC_ARM_DA_ALIGN, address=...)
->  0x330b19d0 <+80>: strd   r2, r3, [r5, #36]
    0x330b19d4 <+84>: movs   r3, #0x0
    0x330b19d6 <+86>: add    r2, sp, #0x28
    0x330b19d8 <+88>: ldr    r0, [r4, #0x4]

Disable testing embedded bitmaps on iOS for now.

BUG=skia:5530

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

Review-Url: https://codereview.chromium.org/2140383004
2016-07-13 10:57:24 -07:00
msarett
ba3880fa6d Revert of Pre-crop filled rects to avoid scissor (patchset #6 id:100001 of https://codereview.chromium.org/2132073002/ )
Reason for revert:
I think this is still causing a test failure on Chrome windows bots.

https://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_rel_ng/builds/243928/steps/cc_unittests%20%28with%20patch%29%20on%20Windows-7-SP1/logs/stdio

Original issue's description:
> Pre-crop filled rects to avoid scissor
>
> Updates GrDrawContext to crop filled rects to the clip bounds before
> creating batches for them. Also adds clipping logic to ignore scissor
> when the draw falls completely inside. These two changes combined
> reduce API traffic and improve batching.
>
> In the future this can and should be improved by switching to floating
> point clip boundaries, thus allowing us to throw out non pixel aligned
> rectangle clips as well.
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2132073002
>
> Committed: https://skia.googlesource.com/skia/+/7969838702135b9f127bd738728da61bc49b050a
> Committed: https://skia.googlesource.com/skia/+/86de59f4a99b5f54be0483c60ff0335be55b2bdf

TBR=bsalomon@google.com,robertphillips@google.com,csmartdalton@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/2140253004
2016-07-12 18:48:21 -07:00
reed
7c70d7cfa2 center glyphs for text-on-path-via-rsxform
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2137083005

Review-Url: https://codereview.chromium.org/2137083005
2016-07-12 15:06:33 -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
csmartdalton
86de59f4a9 Pre-crop filled rects to avoid scissor
Updates GrDrawContext to crop filled rects to the clip bounds before
creating batches for them. Also adds clipping logic to ignore scissor
when the draw falls completely inside. These two changes combined
reduce API traffic and improve batching.

In the future this can and should be improved by switching to floating
point clip boundaries, thus allowing us to throw out non pixel aligned
rectangle clips as well.

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

Committed: https://skia.googlesource.com/skia/+/7969838702135b9f127bd738728da61bc49b050a
Review-Url: https://codereview.chromium.org/2132073002
2016-07-12 14:45:23 -07:00
bungeman
5dba301e91 Use hintgasp font when testing rendering.
The hintgasp font was added specifically for the typefacerendering gm.
However, this gm didn't actually use the font, so now use it. In
addition this adds embedded bitmap strikes to the hintgasp font and the
gm is updated to test these as well.

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

NOTREECHECKS=true
Test only change, does not affect users.

Review-Url: https://codereview.chromium.org/2140863002
2016-07-12 06:55:25 -07:00
msarett
aeadcdfbf2 Revert of Pre-crop filled rects to avoid scissor (patchset #6 id:100001 of https://codereview.chromium.org/2132073002/ )
Reason for revert:
I believe that this is breaking the roll.

https://codereview.chromium.org/2141923002

https://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/258434/steps/cc_unittests%20%28with%20patch%29%20on%20Mac-10.9/logs/stdio

Original issue's description:
> Pre-crop filled rects to avoid scissor
>
> Updates GrDrawContext to crop filled rects to the clip bounds before
> creating batches for them. Also adds clipping logic to ignore scissor
> when the draw falls completely inside. These two changes combined
> reduce API traffic and improve batching.
>
> In the future this can and should be improved by switching to floating
> point clip boundaries, thus allowing us to throw out non pixel aligned
> rectangle clips as well.
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2132073002
>
> Committed: https://skia.googlesource.com/skia/+/7969838702135b9f127bd738728da61bc49b050a

TBR=bsalomon@google.com,robertphillips@google.com,csmartdalton@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/2145573002
2016-07-12 05:40:39 -07:00
csmartdalton
7969838702 Pre-crop filled rects to avoid scissor
Updates GrDrawContext to crop filled rects to the clip bounds before
creating batches for them. Also adds clipping logic to ignore scissor
when the draw falls completely inside. These two changes combined
reduce API traffic and improve batching.

In the future this can and should be improved by switching to floating
point clip boundaries, thus allowing us to throw out non pixel aligned
rectangle clips as well.

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

Review-Url: https://codereview.chromium.org/2132073002
2016-07-11 14:34:12 -07:00
dvonbeck
6af677ff8f Changed SkLightingShader API to take in a shader as color source
This CL's base is the CL for the same modification, but in the implementation side: https://codereview.chromium.org/2062703003/

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

Review-Url: https://codereview.chromium.org/2064153002
2016-07-10 18:38:34 -07:00
reed
dde2b1f1a8 update path->rsxform to correctly interp dy
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2131043002

TBR=

Review-Url: https://codereview.chromium.org/2131043002
2016-07-08 03:31:09 -07:00
reed
45561a0b15 drawTextRSXform
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2130643004

Review-Url: https://codereview.chromium.org/2130643004
2016-07-07 12:47:17 -07:00
dvonbeck
5b794fad18 API change to allow for NormalSource selection at the user level.
This CL's base is the CL for CPU handling: https://codereview.chromium.org/2050773002/

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

Review-Url: https://codereview.chromium.org/2063793002
2016-07-06 13:58:36 -07:00
bungeman
61457a6b80 Add gm for various font rendering combinations.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2080453002

Review-Url: https://codereview.chromium.org/2080453002
2016-07-06 11:55:05 -07:00
bsalomon
a7d85ba138 Add gm that tests shaded stroked rectangles.
Fix GPU handling of previously untested cases.

Move rect->path fallback from SkGpuDevice to GrDrawContext.

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

Review-Url: https://codereview.chromium.org/2125663003
2016-07-06 11:54:59 -07:00
bsalomon
9c67381dbc Enlarge strokerect GM size to reveal hidden content
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2126723002

Review-Url: https://codereview.chromium.org/2126723002
2016-07-06 06:30:36 -07:00
reed
81700f69b0 remove DownSample imagefilter
was just created early on as a test filter

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

TBR=

Review-Url: https://codereview.chromium.org/2094083002
2016-06-25 14:30:44 -07:00
brianosman
e074d1fa6a Change SkColor4f to RGBA channel order
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2093763003

Review-Url: https://codereview.chromium.org/2093763003
2016-06-24 06:31:47 -07:00
robertphillips
28a838e532 Move GrPipelineBuilder out of gms & reduce use of GrPipelineBuilder.h
Just another step in reining in the GrPLB

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

Review-Url: https://codereview.chromium.org/2086293006
2016-06-23 14:07:00 -07:00
brianosman
42a41499de Change loop bounds to be correct (and much less confusing)
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2095693002

Review-Url: https://codereview.chromium.org/2095693002
2016-06-23 11:40:14 -07:00
fmenozzi
17b64b2fd4 Add GM for hard stop gradients
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2087273002

Review-Url: https://codereview.chromium.org/2087273002
2016-06-22 13:39:25 -07:00
brianosman
6efeda4838 Revert of Store mipmap levels in deferred texture image (patchset #15 id:280001 of https://codereview.chromium.org/2034933003/ )
Reason for revert:
Crashes on a few different bots (including ASAN). Examples:

https://build.chromium.org/p/client.skia.android/builders/Test-Android-GCC-Nexus7-GPU-Tegra3-Arm7-Release/builds/6324
https://build.chromium.org/p/client.skia/builders/Test-iOS-Clang-iPad4-GPU-SGX554-Arm7-Debug/builds/5400
https://build.chromium.org/p/client.skia/builders/Test-Ubuntu-GCC-Golo-GPU-GT610-x86_64-Debug-ASAN/builds/3539

Original issue's description:
> Store mipmap levels in deferred texture image
>
> 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
> R=bsalomon@google.com
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2034933003
>
> Committed: https://skia.googlesource.com/skia/+/b3105190a6e02d37f1d7f07a3a8bdd368ec7f157

TBR=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/2083393002
2016-06-22 07:10:06 -07:00
fmenozzi
b105cff6e2 Remove bubbles GM
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2087263002

Review-Url: https://codereview.chromium.org/2087263002
2016-06-22 06:36:26 -07:00
cblume
b3105190a6 Store mipmap levels in deferred texture image
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
R=bsalomon@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2034933003

Review-Url: https://codereview.chromium.org/2034933003
2016-06-21 13:43:13 -07:00
brianosman
79b15f60f4 Add new GM that exercises Gray 8 mipmapping and sRGB-ness
This demonstrates the bug that was fixed by:
  https://codereview.chromium.org/2088883002/

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

Review-Url: https://codereview.chromium.org/2087933002
2016-06-21 13:40:12 -07:00
brianosman
473466c017 Reorder colorspaces in GM to match previous behavior
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2088493002

Review-Url: https://codereview.chromium.org/2088493002
2016-06-20 14:43:00 -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
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
msarett
c4ce6b5924 Differentiate between sRGBGamma and 2Dot2Gamma
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2067833003

Review-Url: https://codereview.chromium.org/2067833003
2016-06-16 07:37:41 -07:00
bsalomon
f130b8299b Actually fix leak in deferred_texture_image_data
TBR=egdaniel@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2068863003

Review-Url: https://codereview.chromium.org/2068863003
2016-06-15 09:00:21 -07:00
bsalomon
85730abbf8 Fix leak of GrContextThreadSafeProxy in deferred_texture_image_data
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2069443004

Review-Url: https://codereview.chromium.org/2069443004
2016-06-14 14:44:28 -07:00
msarett
be36d59e66 Fix SkImage::asLegacyBitmap() to respect color space info
BUG=skia:5428
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2061783002

Review-Url: https://codereview.chromium.org/2061783002
2016-06-13 11:25:03 -07:00
ericrk
b4da01d8f7 Add prescale option to deferred params
Currently, Skia always uploads GPU textures at full resolution. This
change allows us to pass a pre-scale mip level to the
deferred texture image logic, which causes us to pre-scale the image
to the given mip level, and upload that mip level instead of the full
image.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2007113008

Review-Url: https://codereview.chromium.org/2007113008
2016-06-13 11:18:14 -07:00
reed
3cc37d3db3 tweak mipmap_srgb gm to use integer coordinates
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2061553002

TBR=

Review-Url: https://codereview.chromium.org/2061553002
2016-06-11 04:48:12 -07:00
reed
8151103535 fix non-square stroke rects (non-aa)
fiddle showing bug: https://fiddle.skia.org/c/a21ecf5e33da84f52eba26e8c2f3d280

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

Review-Url: https://codereview.chromium.org/2060543002
2016-06-10 13:21:07 -07:00
bsalomon
687d9d2ecc Extend inverse_paths GM to test dashing
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2057213002

Review-Url: https://codereview.chromium.org/2057213002
2016-06-10 12:09:59 -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
jbauman
b445a57e6c Add NV12 texture conversion support.
If textures 1 and 2 passed into MakeFromYUVTexturesCopy are the same,
then treat the input as NV12 and sample from the g component of texture
2.

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

Review-Url: https://codereview.chromium.org/2016593002
2016-06-09 13:24:48 -07:00
mtklein
2843c42e59 Revert of Disable tail calls inside Simple GM functions. (patchset #1 id:1 of https://codereview.chromium.org/2050473006/ )
Reason for revert:
Appears to have broken Test-Ubuntu-GCC-GCE-CPU-AVX2-x86-Debug

Original issue's description:
> Disable tail calls inside Simple GM functions.
>
> I haven't found any way to turn off the particular optimization (-foptimize-sibling-calls)
> per-function, but I can control optimization settings coarsely:
>
>    - on GCC, we can pick a particular -O level, so I've picked -O1 which does not
>      enable -foptimize-sibling-calls
>    - on Clang, we can only disable all optimization for a function
>    - have no idea about MSVC
>
> This should make sure the simple GM functions, e.g. all_bitmap_configs_GM(),
> show up on stack traces when we crash.
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2050473006
>
> Committed: https://skia.googlesource.com/skia/+/eee3ced68f787aadc47fa274ca8e13b354ec920a

TBR=reed@google.com,mtklein@chromium.org
BUG=skia:

CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86-Debug-Trybot

Review-Url: https://codereview.chromium.org/2051193002
2016-06-09 12:20:25 -07:00
mtklein
eee3ced68f Disable tail calls inside Simple GM functions.
I haven't found any way to turn off the particular optimization (-foptimize-sibling-calls)
per-function, but I can control optimization settings coarsely:

   - on GCC, we can pick a particular -O level, so I've picked -O1 which does not
     enable -foptimize-sibling-calls
   - on Clang, we can only disable all optimization for a function
   - have no idea about MSVC

This should make sure the simple GM functions, e.g. all_bitmap_configs_GM(),
show up on stack traces when we crash.

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

Review-Url: https://codereview.chromium.org/2050473006
2016-06-09 10:30:04 -07:00
bungeman
06ca8ec87c sk_sp for Ganesh.
Convert use of GrFragmentProcessor, GrGeometryProcessor, and
GrXPFactory to sk_sp. This clarifies ownership and should
reduce reference count churn by moving ownership.

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

Review-Url: https://codereview.chromium.org/2041113004
2016-06-09 08:01:03 -07:00
csmartdalton
ecbc12b1c1 Replace targetHasUnifiedMultisampling in GrPB constructor
Replaces targetHasUnifiedMultisampling with a simpler "useHWAA". Now
the code that creates a pipeline builder needs to decide on its own
whether it should enable multisampling, rather than relying on the
builder to try and guess.

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

Review-Url: https://codereview.chromium.org/2041283002
2016-06-08 10:08:43 -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
brianosman
982eb7f377 Add new SkSourceGammaTreatment enum, used in situations like mipmap construction, where we need to know if we should respect (vs. ignore) the gamma encoding of sRGB tagged images. Plumb that extensively.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2037413002

Review-Url: https://codereview.chromium.org/2037413002
2016-06-06 13:10:58 -07:00
scroggo
d8d6855345 Revert of Make SkPngCodec decode progressively. (patchset #26 id:520001 of https://codereview.chromium.org/1997703003/ )
Reason for revert:
Still causing problems in Google3, e.g.

https://test.corp.google.com/ui#cl=124138817&flags=CAMQBQ==&id=OCL:124138817:BASE:124139560:1465227435491:219ffbdb&t=//third_party/skia/HEAD:dm

Original issue's description:
> Make SkPngCodec decode progressively.
>
> This is a step towards using SkCodec in Chromium, where progressive
> decoding is necessary.
>
> Switch from using png_read_row (which expects all the data to be
> available) to png_process_data, which uses callbacks when rows are
> available.
>
> Create a new API for SkCodec, which supports progressive decoding and
> scanline decoding. Future changes will switch the other clients off of
> startScanlineDecode and get/skip-Scanlines to the new API.
>
> Remove SkCodec::kNone_ScanlineOrder, which was only used for interlaced
> PNG images. In the new API, interlaced PNG fits kTopDown. Also remove
> updateCurrScanline(), which was only used by the old implementation for
> interlaced PNG.
>
> DMSrcSink:
> - In CodecSrc::kScanline_Mode, use the new method for scanline decoding
> for the supported formats (just PNG and PNG-in-ICO for now).
>
> fuzz.cpp:
> - Remove reference to kNone_ScanlineOrder
>
> SkCodec:
> - Add new APIs:
>     - startIncrementalDecode
>     - incrementalDecode
> - Remove kNone_SkScanlineOrder and updateCurrScanline()
>
> SkPngCodec:
> - Implement new APIs
> - Switch from sk_read_fn/png_read_row etc to png_process_data
> - Expand AutoCleanPng's role to decode the header and create the
>   SkPngCodec
> - Make the interlaced PNG decoder report how many lines were
>   initialized during an incomplete decode
> - Make initializeSwizzler return a bool instead of an SkCodec::Result
>   (It only returned kSuccess or kInvalidInput anyway)
>
> SkIcoCodec:
> - Implement the new APIs; supported for PNG in ICO
>
> SkSampledCodec:
> - Call the new method for decoding scanlines, and fall back to the old
>   method if the new version is unimplemented
> - Remove references to kNone_SkScanlineOrder
>
> tests/CodecPartial:
> - Add a test which decodes part of an image, then finishes the decode,
>   and compares it to the straightforward method
>
> tests/CodecTest:
> - Add a test which decodes all scanlines using the new method
> - Repurpose the Codec_stripes test to decode using the new method in
>   sections rather than all at once
> - In the method check(), add a parameter for whether the image supports
>   the new method of scanline decoding, and be explicit about whether an
>   image supports incomplete
> - Test incomplete PNG decodes. We should have been doing it anyway for
>   non-interlaced (except for an image that is too small - one row), but
>   the new method supports interlaced incomplete as well
> - Make test_invalid_parameters test the new method
> - Add a test to ensure that it's safe to fall back to scanline decoding without
>   rewinding
>
> BUG=skia:4211
>
> The new version was generally faster than the old version (but not significantly so).
>
> Some raw performance differences can be found at https://docs.google.com/a/google.com/spreadsheets/d/1Gis3aRCEa72qBNDRMgGDg3jD-pMgO-FXldlNF9ejo4o/
>
> Design doc can be found at https://docs.google.com/a/google.com/document/d/11Mn8-ePDKwVEMCjs3nWwSjxcSpJ_Cu8DF57KNtUmgLM/
>
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1997703003
>
> Committed: https://skia.googlesource.com/skia/+/a4b09a117d4d1ba5dda372e6a2323e653766539e
>
> Committed: https://skia.googlesource.com/skia/+/30e78c9737ff4861dc4e3fa1e4cd010680ed6965
>
> Committed: https://skia.googlesource.com/skia/+/6fb2391b2cc83ee2160b4e994faa8128975acc1f

TBR=reed@google.com,msarett@google.com,scroggo@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=skia:4211
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2044573002

Review-Url: https://codereview.chromium.org/2044573002
2016-06-06 11:26:17 -07:00
robertphillips
55fdcccf01 Remove GrRenderTarget from GrPipelineBuilder
This used to be "Declassify GrClipMaskManager and Remove GrRenderTarget and GrDrawTarget from GrPipelineBuilder"

but has been split into:
https://codereview.chromium.org/1993263002/ (Make GrAppliedClip friendless)
https://codereview.chromium.org/1997773002/ (Retract GrRenderTarget from GLProgramsTest)
https://codereview.chromium.org/1993403002/ (GrSWMaskHelper and GrSoftwarePathRenderer only need the textureProvider (not GrContext))
https://codereview.chromium.org/2004433002/ (Retract GrRenderTarget from GrTestTarget)
https://codereview.chromium.org/2015333002/ (Change parameters to GrPipelineBuilder's ctor)
https://codereview.chromium.org/2035823002/ (Make GrClipMaskManager stateless and push GrPipelineBuilder construction downstack)

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

Review-Url: https://codereview.chromium.org/1988923002
2016-06-06 06:16:21 -07:00
csmartdalton
87fee2380c Don't use complex blend mode for shapes gm
The darken blend mode introduced barriers on most platforms, which
interfered with batching.

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

Review-Url: https://codereview.chromium.org/2031113003
2016-06-03 11:56:51 -07:00
robertphillips
adf5afa628 Add SampleApp slide with animating lightmapped objects & transparency
This is pulled out of the drawLitAtlas CL (may it someday land). It does nicely demonstrate animating normal mapped objects and normal maps combined with partially transparent diffuse textures.

It is a crude Asteroids game.

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

TBR=reed@google.com

Review-Url: https://codereview.chromium.org/2026393005
2016-06-03 10:12:08 -07:00
herb
5823846397 Add gm for displaying different variants of 8888 bitmaps and fix a small rejection case for sprite blitters.
BUG=skia:5378
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2036493004

Review-Url: https://codereview.chromium.org/2036493004
2016-06-03 09:44:53 -07:00
scroggo
6fb2391b2c Make SkPngCodec decode progressively.
This is a step towards using SkCodec in Chromium, where progressive
decoding is necessary.

Switch from using png_read_row (which expects all the data to be
available) to png_process_data, which uses callbacks when rows are
available.

Create a new API for SkCodec, which supports progressive decoding and
scanline decoding. Future changes will switch the other clients off of
startScanlineDecode and get/skip-Scanlines to the new API.

Remove SkCodec::kNone_ScanlineOrder, which was only used for interlaced
PNG images. In the new API, interlaced PNG fits kTopDown. Also remove
updateCurrScanline(), which was only used by the old implementation for
interlaced PNG.

DMSrcSink:
- In CodecSrc::kScanline_Mode, use the new method for scanline decoding
for the supported formats (just PNG and PNG-in-ICO for now).

fuzz.cpp:
- Remove reference to kNone_ScanlineOrder

SkCodec:
- Add new APIs:
    - startIncrementalDecode
    - incrementalDecode
- Remove kNone_SkScanlineOrder and updateCurrScanline()

SkPngCodec:
- Implement new APIs
- Switch from sk_read_fn/png_read_row etc to png_process_data
- Expand AutoCleanPng's role to decode the header and create the
  SkPngCodec
- Make the interlaced PNG decoder report how many lines were
  initialized during an incomplete decode
- Make initializeSwizzler return a bool instead of an SkCodec::Result
  (It only returned kSuccess or kInvalidInput anyway)

SkIcoCodec:
- Implement the new APIs; supported for PNG in ICO

SkSampledCodec:
- Call the new method for decoding scanlines, and fall back to the old
  method if the new version is unimplemented
- Remove references to kNone_SkScanlineOrder

tests/CodecPartial:
- Add a test which decodes part of an image, then finishes the decode,
  and compares it to the straightforward method

tests/CodecTest:
- Add a test which decodes all scanlines using the new method
- Repurpose the Codec_stripes test to decode using the new method in
  sections rather than all at once
- In the method check(), add a parameter for whether the image supports
  the new method of scanline decoding, and be explicit about whether an
  image supports incomplete
- Test incomplete PNG decodes. We should have been doing it anyway for
  non-interlaced (except for an image that is too small - one row), but
  the new method supports interlaced incomplete as well
- Make test_invalid_parameters test the new method
- Add a test to ensure that it's safe to fall back to scanline decoding without
  rewinding

BUG=skia:4211

The new version was generally faster than the old version (but not significantly so).

Some raw performance differences can be found at https://docs.google.com/a/google.com/spreadsheets/d/1Gis3aRCEa72qBNDRMgGDg3jD-pMgO-FXldlNF9ejo4o/

Design doc can be found at https://docs.google.com/a/google.com/document/d/11Mn8-ePDKwVEMCjs3nWwSjxcSpJ_Cu8DF57KNtUmgLM/

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

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

Committed: https://skia.googlesource.com/skia/+/30e78c9737ff4861dc4e3fa1e4cd010680ed6965

Review-Url: https://codereview.chromium.org/1997703003
2016-06-02 14:16:43 -07:00
senorblanco
531237ef3a Tessellator: stop copying vertices into Polys and Monotones.
The vertices which are produced by stage 5 of the
tesselator are copied into the Polys and MonotonePolys it
produces. This is necessary because each vertex may have an
arbitrary valence, since it may participate in an arbitrary
number of Polys, so we can't use the vertex's prev/next
pointers to represent all the Monotones of which this
vertex may be a member.

However, each Edge can only be a member of two Polys (one
on each side of the edge). So by adding two prev/next
pointer pairs to each Edge, we can represent each Monotone
as a list of edges instead. Then we no longer need to copy
the vertices.

One wrinkle is that the ear-clipping stage (6) of the
tessellator does require prev/next pointers, in order to
remove vertices as their ears are clipped. So we convert
the edge list into a vertex list during Monotone::emit(),
using the prev/next pointers temporarily for that monotone.

This change improves performance by 7-20% on a non-caching
version of the tessellator, and reduces memory use.

Other notes:

1) Polys are initially constructed empty (no edges), but
with the top vertex, which is needed for splitting
Polys. Edges are added to Polys only after their bottom
vertex is seen.

2) MonotonePolys are always constructed with one edge, so
we always know their handedness (left/right).
MonotonePoly::addEdge() no longer detects when a monotone
is "done" (edge of opposite handedness); this is handled
by Poly::addEdge(), so MonotonePoly::addEdge() has no
return value.

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

Review-Url: https://codereview.chromium.org/2029243002
2016-06-02 11:36:48 -07:00
brianosman
33f6b3f6ee Manually generated sRGB mipmaps, with successively smaller draws.
Dirty GL-generated mipmaps whenever an sRGB texture is used with a new
value for TEXTURE_SRGB_DECODE. Add a new test rectangle to the gamma GM
that tests that textures are correctly converted to linear before
filtering when generating mipmaps.

Added a new unit test that alternates how a texture is interpreted (sRGB
or not), to verify that we rebuild mipmaps when needed, and that we get
the correct results out in both modes.

This test originally failed on four of our bots producing incorrect mips
in three different ways. I'm not real surprised, but it looks like
we can't rely on glGenerateMipmap to do the right thing, in conjunction
with TEXTURE_SRGB_DECODE.

Instead, actually create mip-chains using a series of draw calls.
(My first attempt used glBlitFramebuffer, and that still had bugs on
several bots). This approach appears to work correctly on any device
that fully supports sRGB.

Because the mipmap draws are fairly destructive to state, I had to
hoist them out of bindTexture. That means adding a second pass over
the texture accesses in the processor, at the very beginning of flush.

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

Review-Url: https://codereview.chromium.org/2007973002
2016-06-02 05:49:21 -07:00
scroggo
26694c32d2 Revert of Make SkPngCodec decode progressively. (patchset #24 id:480001 of https://codereview.chromium.org/1997703003/ )
Reason for revert:
Still breaking Google3 e.g.:

https://sponge.corp.google.com/target?id=9261d31b-34fc-4f0f-981e-f92f7c5cea2c&target=//third_party/skia/HEAD:dm#shard=1|run=1|attempt=1|page=-1

https://test.corp.google.com/ui#cl=123773095&flags=CAMQBQ==&id=OCL:123773095:BASE:123773415:1464804876959:b0ea9b1c&t=//third_party/skia/HEAD:dm

Original issue's description:
> Make SkPngCodec decode progressively.
>
> This is a step towards using SkCodec in Chromium, where progressive
> decoding is necessary.
>
> Switch from using png_read_row (which expects all the data to be
> available) to png_process_data, which uses callbacks when rows are
> available.
>
> Create a new API for SkCodec, which supports progressive decoding and
> scanline decoding. Future changes will switch the other clients off of
> startScanlineDecode and get/skip-Scanlines to the new API.
>
> Remove SkCodec::kNone_ScanlineOrder, which was only used for interlaced
> PNG images. In the new API, interlaced PNG fits kTopDown. Also remove
> updateCurrScanline(), which was only used by the old implementation for
> interlaced PNG.
>
> DMSrcSink:
> - In CodecSrc::kScanline_Mode, use the new method for scanline decoding
> for the supported formats (just PNG and PNG-in-ICO for now).
>
> fuzz.cpp:
> - Remove reference to kNone_ScanlineOrder
>
> SkCodec:
> - Add new APIs:
>     - startIncrementalDecode
>     - incrementalDecode
> - Remove kNone_SkScanlineOrder and updateCurrScanline()
>
> SkPngCodec:
> - Implement new APIs
> - Switch from sk_read_fn/png_read_row etc to png_process_data
> - Expand AutoCleanPng's role to decode the header and create the
>   SkPngCodec
> - Make the interlaced PNG decoder report how many lines were
>   initialized during an incomplete decode
> - Make initializeSwizzler return a bool instead of an SkCodec::Result
>   (It only returned kSuccess or kInvalidInput anyway)
>
> SkIcoCodec:
> - Implement the new APIs; supported for PNG in ICO
>
> SkSampledCodec:
> - Call the new method for decoding scanlines, and fall back to the old
>   method if the new version is unimplemented
> - Remove references to kNone_SkScanlineOrder
>
> tests/CodecPartial:
> - Add a test which decodes part of an image, then finishes the decode,
>   and compares it to the straightforward method
>
> tests/CodecTest:
> - Add a test which decodes all scanlines using the new method
> - Repurpose the Codec_stripes test to decode using the new method in
>   sections rather than all at once
> - In the method check(), add a parameter for whether the image supports
>   the new method of scanline decoding, and be explicit about whether an
>   image supports incomplete
> - Test incomplete PNG decodes. We should have been doing it anyway for
>   non-interlaced (except for an image that is too small - one row), but
>   the new method supports interlaced incomplete as well
> - Make test_invalid_parameters test the new method
> - Add a test to ensure that it's safe to fall back to scanline decoding without
>   rewinding
>
> BUG=skia:4211
>
> The new version was generally faster than the old version (but not significantly so).
>
> Some raw performance differences can be found at https://docs.google.com/a/google.com/spreadsheets/d/1Gis3aRCEa72qBNDRMgGDg3jD-pMgO-FXldlNF9ejo4o/
>
> Design doc can be found at https://docs.google.com/a/google.com/document/d/11Mn8-ePDKwVEMCjs3nWwSjxcSpJ_Cu8DF57KNtUmgLM/
>
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1997703003
>
> Committed: https://skia.googlesource.com/skia/+/a4b09a117d4d1ba5dda372e6a2323e653766539e
>
> Committed: https://skia.googlesource.com/skia/+/30e78c9737ff4861dc4e3fa1e4cd010680ed6965

TBR=reed@google.com,msarett@google.com,scroggo@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:4211

Review-Url: https://codereview.chromium.org/2026383002
2016-06-01 12:08:23 -07:00
scroggo
30e78c9737 Make SkPngCodec decode progressively.
This is a step towards using SkCodec in Chromium, where progressive
decoding is necessary.

Switch from using png_read_row (which expects all the data to be
available) to png_process_data, which uses callbacks when rows are
available.

Create a new API for SkCodec, which supports progressive decoding and
scanline decoding. Future changes will switch the other clients off of
startScanlineDecode and get/skip-Scanlines to the new API.

Remove SkCodec::kNone_ScanlineOrder, which was only used for interlaced
PNG images. In the new API, interlaced PNG fits kTopDown. Also remove
updateCurrScanline(), which was only used by the old implementation for
interlaced PNG.

DMSrcSink:
- In CodecSrc::kScanline_Mode, use the new method for scanline decoding
for the supported formats (just PNG and PNG-in-ICO for now).

fuzz.cpp:
- Remove reference to kNone_ScanlineOrder

SkCodec:
- Add new APIs:
    - startIncrementalDecode
    - incrementalDecode
- Remove kNone_SkScanlineOrder and updateCurrScanline()

SkPngCodec:
- Implement new APIs
- Switch from sk_read_fn/png_read_row etc to png_process_data
- Expand AutoCleanPng's role to decode the header and create the
  SkPngCodec
- Make the interlaced PNG decoder report how many lines were
  initialized during an incomplete decode
- Make initializeSwizzler return a bool instead of an SkCodec::Result
  (It only returned kSuccess or kInvalidInput anyway)

SkIcoCodec:
- Implement the new APIs; supported for PNG in ICO

SkSampledCodec:
- Call the new method for decoding scanlines, and fall back to the old
  method if the new version is unimplemented
- Remove references to kNone_SkScanlineOrder

tests/CodecPartial:
- Add a test which decodes part of an image, then finishes the decode,
  and compares it to the straightforward method

tests/CodecTest:
- Add a test which decodes all scanlines using the new method
- Repurpose the Codec_stripes test to decode using the new method in
  sections rather than all at once
- In the method check(), add a parameter for whether the image supports
  the new method of scanline decoding, and be explicit about whether an
  image supports incomplete
- Test incomplete PNG decodes. We should have been doing it anyway for
  non-interlaced (except for an image that is too small - one row), but
  the new method supports interlaced incomplete as well
- Make test_invalid_parameters test the new method
- Add a test to ensure that it's safe to fall back to scanline decoding without
  rewinding

BUG=skia:4211

The new version was generally faster than the old version (but not significantly so).

Some raw performance differences can be found at https://docs.google.com/a/google.com/spreadsheets/d/1Gis3aRCEa72qBNDRMgGDg3jD-pMgO-FXldlNF9ejo4o/

Design doc can be found at https://docs.google.com/a/google.com/document/d/11Mn8-ePDKwVEMCjs3nWwSjxcSpJ_Cu8DF57KNtUmgLM/

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

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

Review-Url: https://codereview.chromium.org/1997703003
2016-06-01 07:31:28 -07:00
caryclark
ba150cc283 always compute a cubic tangent
If the inflection of a cubic is also the cusp, the tangent
is degenerate at that t when computed directly. Rather than
giving up, subdivide the curve there and use the computed
control points to compute the tangent.

This strategy also removes the error paths where the tangent
formerly could not be computed.

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

Review-Url: https://codereview.chromium.org/2020293002
2016-06-01 04:42:02 -07:00
robertphillips
71e0552793 Make use of new SkLights class
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2026763002

Review-Url: https://codereview.chromium.org/2026763002
2016-05-31 12:08:25 -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
robertphillips
0ee622021c Add new GM to exercise stroked line special case
This is a companion to: https://codereview.chromium.org/2023693002/ (Handle stroked single line special case in Ganesh)

The idea is to land this CL first so any regressions are visible.

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

Review-Url: https://codereview.chromium.org/2019193002
2016-05-31 06:59:18 -07:00
robertphillips
40ff8ed522 Change parameters to GrPipelineBuilder's ctor
This is just plumbing prep to remove the GrRenderTarget from the GrPipelineBuilder.

Split out of: https://codereview.chromium.org/1988923002/ (Declassify GrClipMaskManager and Remove GrRenderTarget and GrDrawTarget from GrPipelineBuilder)

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

Review-Url: https://codereview.chromium.org/2015333002
2016-05-28 08:51:06 -07:00
fmenozzi
c75d6a8e43 Add bubbles GM for drawing/blending 50 circles.
Positions, radii, and colors are determined pseudo-randomly.

R=tomhudson@google.com
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2004173002

Review-Url: https://codereview.chromium.org/2004173002
2016-05-23 13:54:22 -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
senorblanco
56f7dfebac Adjust size of imagemakewithfilter GM.
TBR=reed@google.com
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=2003453003

Review-Url: https://codereview.chromium.org/2003453003
2016-05-20 07:59:09 -07:00
senorblanco
5878dbdf1b Image filters: implement SkImage::makeWithFilter().
This API provides a way to directly filter a subregion of an SkImage
(usually texture-backed), and returns an SkImage which may include
extra padding, along with a size to indicate the active region.

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

Review-Url: https://codereview.chromium.org/1964043002
2016-05-19 14:50:29 -07:00
senorblanco
3949971e8d Image filters: fix filtering of transparent black in CFIF.
SkColorFilterImageFilter has a codepath to filter transparent black
regions outside of the input image. However, it was treating the
exterior as opaque black, rather than trasparent black.

Note: the results of imagefiltercropexpand GM will change, as it
was tweaked a bit to show this bug.

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

Review-Url: https://codereview.chromium.org/1978363002
2016-05-18 07:00:08 -07:00
msarett
bb9f77437d Prepare SkColorSpace to be a public API
Moves implementation details into SkColorSpacePriv.h

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

Review-Url: https://codereview.chromium.org/1985903002
2016-05-17 09:31:20 -07:00
bsalomon
2996553ba2 Make blurcircles2 run as a benchmark.
In bench mode it does not draw the comparison paths (or line separators). It also randomly perturbs the blur and circle radii to avoid trivially hitting the same cache entries and each repetition.

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

Review-Url: https://codereview.chromium.org/1985713002
2016-05-16 09:36:44 -07:00
bsalomon
c67bb575d0 Add blurcircles2 GM
In GM mode this draws an array of circles with different radii and different blur radii. Below each circle an almost-circle path is drawn with the same blur filter for comparison.

In Sample mode this draws a single circle and almost-circle with animating radius and blur radius.

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

Review-Url: https://codereview.chromium.org/1974353003
2016-05-13 13:48:48 -07:00
egdaniel
b2df0c2702 Refactor Vulkan image, texture, RTs so that create and getter handles match.
This allows allows us to track and notify clients when either side changes
and image layout.

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

Review-Url: https://codereview.chromium.org/1974983002
2016-05-13 11:30:37 -07:00
cdalton
846c051a48 Convert GrClip to an abstract base class
Converts GrClip to an abstract base class and adds a "GrFixedClip"
implementation. GrFixedClip denotes a clip implemented with fixed-
function hardware. GrFixedClip allows us to remove the stateful
"fClipMode" member from GrClipMaskManager, and in the future will
be able to nicely encapsulate window rectangles.

After this change GrClipMaskManager is just a wrapper around
GrDrawTarget. We may want to consider removing it altogether.

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

Review-Url: https://codereview.chromium.org/1971343002
2016-05-13 10:25:00 -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
scroggo
e6f0d6e5fe GMs: fail gracefully for null surface
A couple more instances where MakeRenderTarget returns nullptr
due to --preAbandonGpuContext.

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

Review-Url: https://codereview.chromium.org/1976163002
2016-05-13 07:25:44 -07:00
cdalton
862cff30ea Remove clip from GrPipelineBuilder
This eliminates a copy and will allow us to make the GrClip class
virutal.

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

Review-Url: https://codereview.chromium.org/1966903004
2016-05-12 15:09:48 -07:00
robertphillips
3806b8fb7f Fix bug & add code to catch ImageFilter clearing bugs
Follow on to https://codereview.chromium.org/1969193002/ (SkPictureImageFilter - clear local canvas before use)

BUG=610667

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

Review-Url: https://codereview.chromium.org/1972213002
2016-05-12 10:46:40 -07:00