Commit Graph

2390 Commits

Author SHA1 Message Date
reed
59dc0d22f5 change SkImage_Gpu to handle all filters (w/ and w/o gpu support
The result is that the set of "generic" imagefilters (e.g. SkColorFilterImageFilter) that use drawing commands to return their results will now stay in the same domain as their src (i.e. gpu-src --> gpu-dst).

ApplyFilterGM exercises this, and now asserts this same-domain invariant.

BUG=skia:4467

Review URL: https://codereview.chromium.org/1401053003
2015-10-19 08:24:21 -07:00
senorblanco
b9519f86bb Image Filters: refactor all CPU input processing into a filterInput helper function.
No change in behaviour; this is a straight refactoring.

BUG=skia:3194

Review URL: https://codereview.chromium.org/1404743005
2015-10-15 12:15:13 -07:00
bsalomon
5f5527fb46 Remove params from Cacherator_GrTextureMaker
Review URL: https://codereview.chromium.org/1403313003
2015-10-15 12:14:55 -07:00
robertphillips
2e1e51f049 GrDrawContext now holds GrRenderTarget pointer
Review URL: https://codereview.chromium.org/1404823005
2015-10-15 08:01:49 -07:00
reed
94dd7a52d3 change back to method for localmatrix imagefilter
This method is different from MatrixFilter, in that MatrixFilter does not require a pre-existing
filter, but LocalM does. Also change the comment to be more general, as there is no promise that
we return a different subclass, and certainly not a specific subclass.

This pattern of obj->newWithModifiers() also more closely matches the pattern in SkImage (newSubset).

BUG=skia:

Review URL: https://codereview.chromium.org/1402133002
2015-10-14 07:49:35 -07:00
senorblanco
20311d4843 Implement SkLocalMatrixImageFilter.
At draw time, this filter simply concatenates the given matrix to the
CTM, and recurses on its input. The matrix is thus applied to any
upstream filter parameters and crop rects.

BUG=skia:

Review URL: https://codereview.chromium.org/1392833005
2015-10-14 04:53:31 -07:00
reed
c837d8f372 adjust size of new apply-filter gm
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1395303003
2015-10-12 14:38:34 -07:00
halcanary
66a82f3872 SkPDF: fall back on paths for unembeddable fonts.
Add GM, SkPDFFont::CanEmbedTypeface

BUG=skia:3866

Review URL: https://codereview.chromium.org/1401763002
2015-10-12 13:05:04 -07:00
reed
88d064d0e4 add applyFilter() to SkImage
Result:
- clients can get a filtered version of an image without having to setup a temp drawing environment
- for some cases, the process is more efficient even than (deprecated) drawSprite, since there is no need to draw/copy the result

Impl:
- made Proxy virtual so we don't need to have an existing device to use it

This, in conjunction with LocalMatrixImageFilter, should allow us to simplify and optimize ApplyImageFilter() in cc/output/gl_renderer.cc

BUG=skia:

Review URL: https://codereview.chromium.org/1390913005
2015-10-12 11:30:02 -07:00
fmalita
063675ba37 Remove SK_SUPPORT_LEGACY_GRADIENT_DITHERING from Skia proper
Migrating the flag to embedder defines (Chromium already guarded).

Also augment gradient-focused GMs to generate both dithered/undithered
results.

BUG=skia:4436
R=reed@google.com,robertphillips@google.com

Review URL: https://codereview.chromium.org/1400813006
2015-10-12 10:41:48 -07:00
bsalomon
afa95e270c Remove image usage type enum. Use GrTextureParams instead.
BUG=skia:

Review URL: https://codereview.chromium.org/1404433002
2015-10-12 10:39:46 -07:00
bsalomon
0ba8c2401e Insert clip fragment processor outside GrCMM
Review URL: https://codereview.chromium.org/1393553002
2015-10-07 09:20:28 -07:00
reed
5ea95df02d Revert "Revert of factories should return baseclass, allowing the impl to specialize (patchset #4 id:60001 of https://codereview.chromium.org/1390523005/ )"
This reverts commit 95376a0dde.

BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1389083002
2015-10-06 14:05:32 -07:00
schenney
95376a0dde Revert of factories should return baseclass, allowing the impl to specialize (patchset #4 id:60001 of https://codereview.chromium.org/1390523005/ )
Reason for revert:
Breaks Chrome with this link error: ../../third_party/skia/include/effects/SkMorphologyImageFilter.h:75: error: undefined reference to 'SkMorphologyImageFilter::SkMorphologyImageFilter(int, int, SkImageFilter*, SkImageFilter::CropRect const*)'
../../third_party/skia/include/effects/SkMorphologyImageFilter.h:104: error: undefined reference to 'SkMorphologyImageFilter::SkMorphologyImageFilter(int, int, SkImageFilter*, SkImageFilter::CropRect const*)'

Presumably due to code in third_party/WebKit/Source/platform/graphics/filters/FEMorphology.cpp that contains:
#include "SkMorphologyImageFilter.h"

...

    if (m_type == FEMORPHOLOGY_OPERATOR_DILATE)
        return adoptRef(SkDilateImageFilter::Create(radiusX, radiusY, input.get(), &rect));
    return adoptRef(SkErodeImageFilter::Create(radiusX, radiusY, input.get(), &rect));

Original issue's description:
> factories should return baseclass, allowing the impl to specialize
>
> waiting on https://codereview.chromium.org/1386163002/# to land
>
> BUG=skia:4424
>
> Committed: https://skia.googlesource.com/skia/+/80a6dcaa1b757826ed7414f64b035d512d9ccbf8

TBR=senorblanco@google.com,robertphillips@google.com,reed@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:4424

Review URL: https://codereview.chromium.org/1389063002
2015-10-06 12:59:55 -07:00
reed
80a6dcaa1b factories should return baseclass, allowing the impl to specialize
waiting on https://codereview.chromium.org/1386163002/# to land

BUG=skia:4424

Review URL: https://codereview.chromium.org/1390523005
2015-10-06 11:12:23 -07:00
halcanary
8b2bc252fa SkPDF: when drawing stroked path, draw using SVG rules for zero-length segments
The "zeroPath" and emptystroke GMs capture this issue.

This CL changes the following PDF GMs: emptystroke dashing4
lineclosepath dashing3 zeroPath linepath
complexclip3_complex complexclip3_simple roundrects
degeneratesegments filltypes strokerect pathfill
inverse_paths desk_chalkboard.skp

After this change, all PDF GMs look better (closer to 8888).
The dashing4, emptystroke, and zeroPath GMs still need a lot
of work to make them look right.

BUG=538726

Review URL: https://codereview.chromium.org/1374383004
2015-10-06 09:41:47 -07:00
bsalomon
4a33952961 Bye bye processor data manager.
Review URL: https://codereview.chromium.org/1388113002
2015-10-06 08:40:51 -07:00
egdaniel
c00389e45a Fix gpu dashing for case where all intervals are 0.
BUG=skia:4409

Review URL: https://codereview.chromium.org/1381803005
2015-10-05 08:11:49 -07:00
halcanary
7a14b310d6 SkPDF: Implement drawImage*() properly
drawImage calls now properly embeds the original jpeg.

NOTE: drawBitmap*() calls no longer embed JPEG files when
possible (this is in advance of eliminating bitmaps backed
by encoded data).  Chromium has already moved from
drawBitmap to drawImage.

Comparisons:

control:
    total PDF drawImage/drawBitmap calls: 8010
    total PDF jpeg images: 0
    total PDF regular images: 3581

experiament:
    total PDF drawImage/drawBitmap calls: 8014
    total PDF jpeg images: 271
    total PDF regular images: 3311
    total PDF regular images: 3582 (271 + 3311)

When comparing rendered output there were perceptual
differences in the following four GMs: colorcube, emboss,
colormatrix, and tablecolorfilter.  All of these differences
were improvements (that is, closer to the 8888 rendering)
due fixing a bug with colorfilters and forgetting to call
notifyPixelsChanged.

No SKPs had perceptual differences.

Total PDF size dropped from 133964 kB to 126276 kB, a 5.7%
improvement (mostly due to restoring use of JPG images in
SKPs).

BUG=skia:4370

Review URL: https://codereview.chromium.org/1372783003
2015-10-01 07:28:13 -07:00
robertphillips
05302f8f24 Handle inverted rects in SkRRect creation methods
An alternative way of addressing this is to alter SkCanvas::drawRoundRect to just reject isEmpty (i.e., un-sorted or truly empty) input rects.

BUG=skia:3786

Review URL: https://codereview.chromium.org/1373293002
2015-09-29 11:24:07 -07:00
bsalomon
f1b7a1d828 Make skpaint->grpaint flow work for composing draws (verts and atlas)
One side effect is that the SkShader's (or implicit shader's) fragment processor is responsible for the transition from an unpremul paint color to a premul color.

Review URL: https://codereview.chromium.org/1348583002
2015-09-28 06:26:29 -07:00
fmalita
2f5891ea64 Remove SkBitmapSource
To avoid breaking existing SKPs, add a deserialization stub which
unflattens SkBitmapSource records to SkImageSources.

R=reed@google.com,mtklein@google.com,robertphillips@google.com

Review URL: https://codereview.chromium.org/1363913002
2015-09-25 09:15:55 -07:00
reed
d114645d93 SkInstallDiscardablePixelRef is deprecated, enforce that
No functionality change, just a renaming.

BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1372593002
2015-09-25 06:56:57 -07:00
halcanary
287d22d999 SkPDF Implement colorfilters on bitmaps
BUG=484583

Review URL: https://codereview.chromium.org/1367993002
2015-09-24 10:20:06 -07:00
robertphillips
24eb7a8ed0 Make drawbitmaprect GM use Ganesh-backed bitmaps and images
This is left over from trying to repro Android not serializing Ganesh-backed bitmaps

Review URL: https://codereview.chromium.org/1353313002
2015-09-24 08:47:49 -07:00
reed
7b6945bc4e remove unused (by the outside) SkImage::newSurface, and simplify newImage -> newSubset
BUG=skia:

Review URL: https://codereview.chromium.org/1364443002
2015-09-24 00:50:58 -07:00
halcanary
5cd406f0f6 GM for http://skbug.com/4374
BUG=skia:4374

Review URL: https://codereview.chromium.org/1367623002
2015-09-23 12:46:25 -07:00
bsalomon
aca31fea8c Stop supporting HW dither
Review URL: https://codereview.chromium.org/1359833004
2015-09-22 11:38:46 -07:00
bsalomon
87ba62e67c Replace GrExtractAlphaFragmentProcessor with DstIn compose processor
Review URL: https://codereview.chromium.org/1347943003
2015-09-22 06:42:00 -07:00
joshualitt
496d29f6b2 add new gm to test overlapping lcd text
BUG=skia:

Review URL: https://codereview.chromium.org/1358563002
2015-09-18 12:03:13 -07:00
joshualitt
33e91f1673 Make Ben happy
TBR=
BUG=skia:

Review URL: https://codereview.chromium.org/1351193004
2015-09-18 11:28:59 -07:00
fmalita
3b0d532df7 Purge cached resources on SkImage destruction.
BUG=532981
R=reed@google.com,mtklein@google.com

Review URL: https://codereview.chromium.org/1352883004
2015-09-18 08:07:31 -07:00
wangxianzhu
ef6c50a80f Merge sub-device annotations in SkPDFDevice::drawDevice()
Previously annotations added between saveLayer/restore were lost.

Merge annotations in SkPDFDevice::drawDevice(). Also modified code to
apply correct transformation and clipping on annotations added between
saveLayer/restore:
- Apply the initial transform only when adding the annotations into the
  doc, otherwise we need to unapply sub-device's initial transform
  before merging the annotations into parent-device.
- Apply only device-local clipping. fClipStack is in global coordinates,
  which is not suitable to clip rects in sub-devices.

BUG=skia:4080
BUG=503515

Review URL: https://codereview.chromium.org/1257533004
2015-09-17 20:38:02 -07:00
reed
1b55a963a2 Reland of add a ClassID function to GrBatch (patchset #1 id:1 of https://codereview.chromium.org/1353043002/ )
Reason for revert:
DEPS roll seems to have landed w/o this revert, so revert it again

Original issue's description:
> Revert of add a ClassID function to GrBatch (patchset #5 id:80001 of https://codereview.chromium.org/1352813003/ )
>
> Reason for revert:
> Speculative revert to unblock DEPS roll
>
> Original issue's description:
> > add a ClassID function to GrBatch
> >
> > BUG=skia:
> >
> > Committed: https://skia.googlesource.com/skia/+/4078d529e9e199eea13456db7bf3a63a104ab5b9
> >
> > Committed: https://skia.googlesource.com/skia/+/eb44d53cf96a7eaf103a98d76079ce1f5495e343
>
> TBR=robertphillips@google.com,bsalomon@google.com,joshualitt@google.com,joshualitt@chromium.org
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/48e3a45ade15c52c0c1a10cb00907dd444897745

TBR=robertphillips@google.com,bsalomon@google.com,joshualitt@google.com,joshualitt@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1344373005
2015-09-17 20:16:13 -07:00
reed
48e3a45ade Revert of add a ClassID function to GrBatch (patchset #5 id:80001 of https://codereview.chromium.org/1352813003/ )
Reason for revert:
Speculative revert to unblock DEPS roll

Original issue's description:
> add a ClassID function to GrBatch
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/4078d529e9e199eea13456db7bf3a63a104ab5b9
>
> Committed: https://skia.googlesource.com/skia/+/eb44d53cf96a7eaf103a98d76079ce1f5495e343

TBR=robertphillips@google.com,bsalomon@google.com,joshualitt@google.com,joshualitt@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1353043002
2015-09-17 17:35:11 -07:00
joshualitt
eb44d53cf9 add a ClassID function to GrBatch
BUG=skia:

Committed: https://skia.googlesource.com/skia/+/4078d529e9e199eea13456db7bf3a63a104ab5b9

Review URL: https://codereview.chromium.org/1352813003
2015-09-17 11:50:57 -07:00
joshualitt
a7008403dc Revert of add a ClassID function to GrBatch (patchset #5 id:80001 of https://codereview.chromium.org/1352813003/ )
Reason for revert:
breaks mac bot

Original issue's description:
> add a ClassID function to GrBatch
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/4078d529e9e199eea13456db7bf3a63a104ab5b9

TBR=robertphillips@google.com,bsalomon@google.com,joshualitt@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1345393003
2015-09-17 11:43:02 -07:00
joshualitt
4078d529e9 add a ClassID function to GrBatch
BUG=skia:

Review URL: https://codereview.chromium.org/1352813003
2015-09-17 11:21:17 -07:00
egdaniel
27b6335c71 On gpu, use max(r,g,b) for coverage alpha in LCD and update lcd blend gm.
BUG=skia:

Review URL: https://codereview.chromium.org/1339213004
2015-09-15 13:13:50 -07:00
fmalita
5598b63cd2 Convert unit tests, GMs from SkBitmapSource to SkImagesource
This removes SkBitmapSource clients within Skia.

http://crrev.com/1334173004 does the same for Blink, so we should be
able to remove SkBitmapSource in a follow-up.

R=reed@google.com,robertphillips@google.com,mtklein@google.com

Review URL: https://codereview.chromium.org/1343123002
2015-09-15 11:26:14 -07:00
robertphillips
30c4cae7d3 Add special case circle blur for Ganesh
This makes the blurcircles bench go from ~33us to ~8us on Windows desktop.

It will require layout test suppressions

Review URL: https://codereview.chromium.org/1311583005
2015-09-15 10:20:55 -07:00
egdaniel
723b0501e2 Add support for blending of LCD for all blend modes.
BUG=skia:

Review URL: https://codereview.chromium.org/1313623002
2015-09-15 09:31:40 -07:00
fmalita
cd56f812e0 SkImageSource
Blink is migrating away from SkBitmaps, so we need an SkImage-based
SkImageFilter source.  This is pretty much a 1-1 equivalent of
SkBitmapSource.

To avoid duplication, relocate the SkImage deserialization logic
from SkPictureData to SkReadBuffer.

R=reed@google.com,robertphillips@google.com,senorblanco@chromium.org

Review URL: https://codereview.chromium.org/1343703005
2015-09-14 13:31:18 -07:00
reed
74bd953719 discardable pixelrefs are gone, update tests accordingly
BUG=skia:4328

Review URL: https://codereview.chromium.org/1340803002
2015-09-14 08:52:12 -07:00
reed
c4a83e2652 support colortables in cacherator
BUG=skia:
TBR=scroggo

Review URL: https://codereview.chromium.org/1339753002
2015-09-11 11:47:27 -07:00
reed
25507d9a94 fix leaked picture
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1329143006
2015-09-09 13:42:14 -07:00
caryclark
6651a3238d Reland of more zero-length changes for svg compatibility (patchset #1 id:1 of https://codereview.chromium.org/1334543002/ )
Reason for revert:
DEPS should be fixed now

Original issue's description:
> Revert of more zero-length changes for svg compatibility (patchset #6 id:100001 of https://codereview.chromium.org/1330623003/ )
>
> Reason for revert:
> breaks DEPS
>
> Original issue's description:
> > more zero-length changes for svg compatibility
> >
> > If a path contains a moveTo followed by a line or curve,
> > even if the line or curve has no length, SVG expects
> > the end caps to draw if the cap style is round or square.
> >
> > Fredrik Söderquist attached a patch to the chrome bug
> > (slightly modified here) that fixes layout test failures
> > resulting from deleting special-case code in SVG
> > dealing with zero-length path segments.
> >
> > R=reed@google.com,fs@opera.com
> > BUG=22974
> >
> > Committed: https://skia.googlesource.com/skia/+/62fb1ba1786863e545c89839b5706ad5151cec15
>
> TBR=fs@opera.com,reed@google.com
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=22974
>
> Committed: https://skia.googlesource.com/skia/+/5ca4fa3846067a47e88d35ace895df3ebe3ec2a5

TBR=fs@opera.com,reed@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=22974

Review URL: https://codereview.chromium.org/1314833004
2015-09-09 13:20:49 -07:00
reed
7628967820 add picture-image variant
BUG=skia:

Review URL: https://codereview.chromium.org/1329283002
2015-09-09 11:29:09 -07:00
reed
4228c1fa2c switch over to using images
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1313543004
2015-09-09 10:45:36 -07:00
caryclark
5ca4fa3846 Revert of more zero-length changes for svg compatibility (patchset #6 id:100001 of https://codereview.chromium.org/1330623003/ )
Reason for revert:
breaks DEPS

Original issue's description:
> more zero-length changes for svg compatibility
>
> If a path contains a moveTo followed by a line or curve,
> even if the line or curve has no length, SVG expects
> the end caps to draw if the cap style is round or square.
>
> Fredrik Söderquist attached a patch to the chrome bug
> (slightly modified here) that fixes layout test failures
> resulting from deleting special-case code in SVG
> dealing with zero-length path segments.
>
> R=reed@google.com,fs@opera.com
> BUG=22974
>
> Committed: https://skia.googlesource.com/skia/+/62fb1ba1786863e545c89839b5706ad5151cec15

TBR=fs@opera.com,reed@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=22974

Review URL: https://codereview.chromium.org/1334543002
2015-09-09 09:34:22 -07:00
halcanary
2a24338c77 GM: replace boilerplate with macros
I have verified locally that nothing draws differently.

Motivation:
*   SK_SIMPLE_GM makes it easier to write a GM.
*   Reducing 1100 lines of code makes maintenance easier.
*   Simple GMs are easy to convert to Fiddles.

Review URL: https://codereview.chromium.org/1333553002
2015-09-09 08:16:41 -07:00
caryclark
62fb1ba178 more zero-length changes for svg compatibility
If a path contains a moveTo followed by a line or curve,
even if the line or curve has no length, SVG expects
the end caps to draw if the cap style is round or square.

Fredrik Söderquist attached a patch to the chrome bug
(slightly modified here) that fixes layout test failures
resulting from deleting special-case code in SVG
dealing with zero-length path segments.

R=reed@google.com,fs@opera.com
BUG=22974

Review URL: https://codereview.chromium.org/1330623003
2015-09-09 07:04:33 -07:00
msarett
9260296349 Bot fix
https://codereview.chromium.org/1311503008
https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Coverage/builds/1083/steps/build%20dm/logs/stdio

BUG=skia:

Review URL: https://codereview.chromium.org/1331463004
2015-09-04 13:12:55 -07:00
reed
58e524c98c draw 3 moveTos followed by various others [moves, lines, closes]
BUG=skia:

Review URL: https://codereview.chromium.org/1311503008
2015-09-04 10:03:26 -07:00
caryclark
c8b350df07 update gm test size to include new elements
TBR=
BUG=skia:562

Review URL: https://codereview.chromium.org/1305983006
2015-09-04 06:19:48 -07:00
caryclark
500ab7562c change for issue 562
Add a current version of the patch described in issue 562.

Of interest: the reference row, which is described in the
bug as looking correct draws differently with Ganesh.

TBR=senorblanco
BUG=skia:562

Review URL: https://codereview.chromium.org/1324023006
2015-09-04 05:20:32 -07:00
robertphillips
943a462fef Minor code cleanup (left over from prior CL)
This was requested in https://codereview.chromium.org/1309543012/ (Add new GM to directly exercise perspective bitmap drawing)

Review URL: https://codereview.chromium.org/1320673011
2015-09-03 13:32:33 -07:00
wangyix
d705958375 Will try composing a linear gradient with a color bitmap as well as an alpha8 bitmap to make sure the paint's color is being used/ignored in the right places.
BUG=skia:4182

Review URL: https://codereview.chromium.org/1311043008
2015-09-03 08:32:22 -07:00
robertphillips
fac9ceb5de Add new GM to directly exercise perspective bitmap drawing
BUG=skia:3326

Review URL: https://codereview.chromium.org/1309543012
2015-09-03 08:32:08 -07:00
robertphillips
c9a3706f1e Limit lifetime of GrDrawContext objects
GrDrawContext's are about to become real allocated objects. This CL sets up the machinery so they won't leak.

Review URL: https://codereview.chromium.org/1321353002
2015-09-01 08:34:28 -07:00
bsalomon
afcd7cd324 Rename flag from "distance field" to "device independent."
Review URL: https://codereview.chromium.org/1322433006
2015-08-31 12:39:41 -07:00
senorblanco
2aec4e9466 Add a GM for image filters applied to stroked primitives.
BUG=skia:3194

Review URL: https://codereview.chromium.org/1323573004
2015-08-31 10:28:49 -07:00
bsalomon
c21b09eec9 Change SkShader;asFragmentProcessor signature to no longer take skpaint\grcolor*
Committed: https://skia.googlesource.com/skia/+/ecfdc251be71f3d634e76afdd6375bf55fc061aa

Review URL: https://codereview.chromium.org/1316513002
2015-08-28 18:46:56 -07:00
rmistry
a511e6ad10 Revert of Change SkShader;asFragmentProcessor signature to no longer take skpaint\grcolor* (patchset #8 id:140001 of https://codereview.chromium.org/1316513002/ )
Reason for revert:
Primary suspect in failing DEPS rolls:
* https://codereview.chromium.org/1315753006
* https://codereview.chromium.org/1308323006
* https://codereview.chromium.org/1320903004

Primary suspect because the failing win bots did not fail in https://codereview.chromium.org/1315753005

Original issue's description:
> Change SkShader;asFragmentProcessor signature to no longer take skpaint\grcolor*
>
> Committed: https://skia.googlesource.com/skia/+/ecfdc251be71f3d634e76afdd6375bf55fc061aa

TBR=joshualitt@google.com,wangyix@google.com,robertphillips@google.com,bsalomon@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1313573005
2015-08-28 17:16:50 -07:00
bsalomon
ecfdc251be Change SkShader;asFragmentProcessor signature to no longer take skpaint\grcolor*
Review URL: https://codereview.chromium.org/1316513002
2015-08-28 14:33:47 -07:00
halcanary
96fcdcc219 Style Change: NULL->nullptr
DOCS_PREVIEW= https://skia.org/?cl=1316233002

Review URL: https://codereview.chromium.org/1316233002
2015-08-27 07:41:16 -07:00
bsalomon
ac856c97ac Remove GrStagedProcessor, remove the word Stage as it applies to FPs
Committed: https://skia.googlesource.com/skia/+/24243446cdf7b7e4e132c2a0c387c7723777e0c7

Review URL: https://codereview.chromium.org/1307223004
2015-08-27 06:30:17 -07:00
senorblanco
7b7ecfc046 Fix clipped lighting image filters.
The CPU path for lighting image filters was not adjusting the filter
matrix to accommodate srcOffset, resulting in incorrectly-positioned
lights.  (The GPU path was doing this correctly.)

This change adds a new test case to the imagefiltersclipped GM,
so it will need new baselines.

BUG=skia:

Review URL: https://codereview.chromium.org/1310053004
2015-08-26 14:26:40 -07:00
halcanary
385fe4d4b6 Style Change: SkNEW->new; SkDELETE->delete
DOCS_PREVIEW= https://skia.org/?cl=1316123003

Review URL: https://codereview.chromium.org/1316123003
2015-08-26 13:07:49 -07:00
joshualitt
e46cf96ef5 Write a gm to verify append large glyph as path works
BUG=chromium:522846

Review URL: https://codereview.chromium.org/1316443006
2015-08-26 11:19:56 -07:00
caryclark
5cb00a9573 zero-length cap fix
Re-land; layout tests are suppressed and gm differences are understood.
A merge conflict prevented a automatic reland.

If the endcap is not butt, draw the endcaps even when the line
has zero length.

If the dash length is zero, generate a zero length line segment.

Treat a move followed by a close as a move followed by a zero-length
line.

TBR=reed@google.com
BUG=422974

Review URL: https://codereview.chromium.org/1314213002
2015-08-26 09:04:55 -07:00
rmistry
4bf69f7bbc Revert of Remove GrStagedProcessor, remove the word Stage as it applies to FPs (patchset #6 id:90001 of https://codereview.chromium.org/1307223004/ )
Reason for revert:
Causes bot failures:

https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Mac10.9-Clang-MacMini6.2-GPU-HD4000-x86_64-Debug/builds/1639

https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Ubuntu-GCC-ShuttleA-GPU-GTX660-x86_64-Debug/builds/1702

https://uberchromegw.corp.google.com/i/client.skia.android/builders/Test-Android-GCC-NexusPlayer-GPU-PowerVR-x86-Debug/builds/1223

Original issue's description:
> Remove GrStagedProcessor, remove the word Stage as it applies to FPs
>
> Committed: https://skia.googlesource.com/skia/+/24243446cdf7b7e4e132c2a0c387c7723777e0c7

TBR=joshualitt@google.com,egdaniel@google.com,bsalomon@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1306803003
2015-08-26 06:48:27 -07:00
bsalomon
24243446cd Remove GrStagedProcessor, remove the word Stage as it applies to FPs
Review URL: https://codereview.chromium.org/1307223004
2015-08-26 05:39:18 -07:00
caryclark
45398dff71 Reland of ix zero-length tangent (patchset #1 id:1 of https://codereview.chromium.org/1312243002/ )
Reason for revert:
Layout suppression has landed, and verified that Skia gm test changes are correct.

Original issue's description:
> Revert of fix zero-length tangent (patchset #2 id:20001 of https://codereview.chromium.org/1311273002/ )
>
> Reason for revert:
> causes layout test to draw differently -- new drawing is more correct. Reverting until layout test ignore is landed.
>
> Original issue's description:
> > fix zero-length tangent
> >
> > If the end point and the control point are the same, computing
> > the tangent will result in (0, 0). In this case, use the prior
> > control point instead.
> >
> > R=reed@google.com
> >
> > BUG=skia:4191
> >
> > Committed: https://skia.googlesource.com/skia/+/7544124fb8ee744f68f549a353f8a9163cd7432d
>
> TBR=reed@google.com
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=skia:4191
>
> Committed: https://skia.googlesource.com/skia/+/91298b47c547b2ab4697038c04685af957bd1416

TBR=reed@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:4191

Review URL: https://codereview.chromium.org/1320473002
2015-08-25 13:19:06 -07:00
caryclark
91298b47c5 Revert of fix zero-length tangent (patchset #2 id:20001 of https://codereview.chromium.org/1311273002/ )
Reason for revert:
causes layout test to draw differently -- new drawing is more correct. Reverting until layout test ignore is landed.

Original issue's description:
> fix zero-length tangent
>
> If the end point and the control point are the same, computing
> the tangent will result in (0, 0). In this case, use the prior
> control point instead.
>
> R=reed@google.com
>
> BUG=skia:4191
>
> Committed: https://skia.googlesource.com/skia/+/7544124fb8ee744f68f549a353f8a9163cd7432d

TBR=reed@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:4191

Review URL: https://codereview.chromium.org/1312243002
2015-08-25 10:02:46 -07:00
caryclark
7544124fb8 fix zero-length tangent
If the end point and the control point are the same, computing
the tangent will result in (0, 0). In this case, use the prior
control point instead.

R=reed@google.com

BUG=skia:4191

Review URL: https://codereview.chromium.org/1311273002
2015-08-25 08:03:01 -07:00
caryclark
21b998b181 Revert of experiment with zero-length round capped line segments (patchset #4 id:60001 of https://codereview.chromium.org/1309753002/ )
Reason for revert:
More GMs changed than I expected. Will probably affect layout tests as well; reverting until I can verify that the changes are correct.

Original issue's description:
> experiment with zero-length round capped line segments
>
> If the endcap is not butt, draw the endcaps even when the line
> has zero length.
>
> If the dash length is zero, generate a zero length line segment.
>
> Treat a move followed by a close as a move followed by a zero-length
> line.
>
> R=reed@google.com,schenney@google.com
> BUG=422974
>
> Committed: https://skia.googlesource.com/skia/+/dd3c165828fffb369d0f4b13b48381169a0249a9

TBR=reed@google.com,schenney@google.com,schenney@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=422974

Review URL: https://codereview.chromium.org/1304163008
2015-08-21 13:47:06 -07:00
caryclark
dd3c165828 experiment with zero-length round capped line segments
If the endcap is not butt, draw the endcaps even when the line
has zero length.

If the dash length is zero, generate a zero length line segment.

Treat a move followed by a close as a move followed by a zero-length
line.

R=reed@google.com,schenney@google.com
BUG=422974

Review URL: https://codereview.chromium.org/1309753002
2015-08-21 13:27:37 -07:00
joshualitt
d2b23e0ee6 Standardize BW to NonAA
TBR=bsalomon@google.com, robertphillips@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/1310533004
2015-08-21 10:53:34 -07:00
joshualitt
b6b513b805 Create separate entry points for the various flavors of drawRect
BUG=skia:

Review URL: https://codereview.chromium.org/1308503002
2015-08-21 10:25:18 -07:00
halcanary
2f0a728e5a GMs: change some GMs to use SkImage over SkBitmap
Also, add GetResourceAsImage() to Resources.h

Motivation:  test drawImage() as much as we test drawBitmap()

Review URL: https://codereview.chromium.org/1306133003
2015-08-21 07:47:23 -07:00
reed
499ababa52 add gm for image->newShader
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1302943004
2015-08-20 12:30:20 -07:00
senorblanco
0abdf766d3 Reland of Implement canComputeFastBounds() for image filters. (patchset #1 id:1 of https://codereview.chromium.org/1300403003/ )
Reason for revert:
The Mac compile issue was fixed here: fdd331a42a

Original issue's description:
> Revert of Implement canComputeFastBounds() for image filters. (patchset #8 id:130001 of https://codereview.chromium.org/1296943002/ )
>
> Reason for revert:
> This causes a syntax error.
>
> http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_compile_dbg_ng/builds/87819/steps/compile%20%28with%20patch%29/logs/stdio
>
> Original issue's description:
> > Implement canComputeFastBounds() for image filters.
> >
> > Image filters have never implemented this check, which means that
> > filters which affect transparent black falsely claim they can compute
> > their bounds.
> >
> > Implemented an affectsTransparentBlack() virtual for image
> > filters, and a similar helper function for color filters.
> >
> > This will affect the following GMs: imagefiltersscaled
> > (lighting, perlin noise now filter to clip),
> > colorfilterimagefilter (new test case), imagefiltersclipped
> > (perlin noise now filters to clip).
> >
> > Note: I de-inlined SkPaint::canComputeFastBounds() to avoid adding
> > a dependency from SkPaint.h to SkImageFilter.h.h. Skia benches show
> > no impact from this change, but will watch the perf bots carefully.
> >
> > BUG=4212
> >
> > Committed: https://skia.googlesource.com/skia/+/915881fe743f9a789037695f543bc6ea189cd0cb
>
> TBR=reed@google.com,senorblanco@chromium.org
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=4212
>
> Committed: https://skia.googlesource.com/skia/+/12d8472d31ea5edb636d7d5214db253570115c40

TBR=reed@google.com,herb@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=4212

Review URL: https://codereview.chromium.org/1301823005
2015-08-20 11:10:41 -07:00
caryclark
02833bf055 fix override
TBR=herb@google.com

Review URL: https://codereview.chromium.org/1301763006
2015-08-20 10:53:13 -07:00
caryclark
05424f77fa fix cubic clip in y
Follow on to https://codereview.chromium.org/1299243002/

Clip using a geometric solution if the algebraic solution
fails in Y as well as in X.

If the root finder discovers real roots that are sufficiently
far apart, the root in the range of 0..1 can contain so much
error that it is computed to be slightly smaller than 0 or
larger than 1.

In this case, binary search the mono curve for the actual
answer.

R=reed@google.com

Review URL: https://codereview.chromium.org/1303873003
2015-08-20 10:35:43 -07:00
herb
12d8472d31 Revert of Implement canComputeFastBounds() for image filters. (patchset #8 id:130001 of https://codereview.chromium.org/1296943002/ )
Reason for revert:
This causes a syntax error.

http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_compile_dbg_ng/builds/87819/steps/compile%20%28with%20patch%29/logs/stdio

Original issue's description:
> Implement canComputeFastBounds() for image filters.
>
> Image filters have never implemented this check, which means that
> filters which affect transparent black falsely claim they can compute
> their bounds.
>
> Implemented an affectsTransparentBlack() virtual for image
> filters, and a similar helper function for color filters.
>
> This will affect the following GMs: imagefiltersscaled
> (lighting, perlin noise now filter to clip),
> colorfilterimagefilter (new test case), imagefiltersclipped
> (perlin noise now filters to clip).
>
> Note: I de-inlined SkPaint::canComputeFastBounds() to avoid adding
> a dependency from SkPaint.h to SkImageFilter.h.h. Skia benches show
> no impact from this change, but will watch the perf bots carefully.
>
> BUG=4212
>
> Committed: https://skia.googlesource.com/skia/+/915881fe743f9a789037695f543bc6ea189cd0cb

TBR=reed@google.com,senorblanco@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=4212

Review URL: https://codereview.chromium.org/1300403003
2015-08-20 09:28:45 -07:00
caryclark
7d173403f4 subdivide path when side-clipping fails
Please review concept; I'm OK not to check this in.

If the root finder fails, subdivide the curve and try again.
This is complicated by the reversed nature of the curves;
maybe it can be simpler, but how to do that escapes me.

R=reed@google.com
BUG=514246

Review URL: https://codereview.chromium.org/1299243002
2015-08-20 08:23:52 -07:00
bungeman
99fe822606 Use static_assert instead of SK_COMPILE_ASSERT.
Now that static_assert is allowed, there is no need to use a non-
standard compile time assertion

Review URL: https://codereview.chromium.org/1306443004
2015-08-20 07:57:52 -07:00
senorblanco
915881fe74 Implement canComputeFastBounds() for image filters.
Image filters have never implemented this check, which means that
filters which affect transparent black falsely claim they can compute
their bounds.

Implemented an affectsTransparentBlack() virtual for image
filters, and a similar helper function for color filters.

This will affect the following GMs: imagefiltersscaled
(lighting, perlin noise now filter to clip),
colorfilterimagefilter (new test case), imagefiltersclipped
(perlin noise now filters to clip).

Note: I de-inlined SkPaint::canComputeFastBounds() to avoid adding
a dependency from SkPaint.h to SkImageFilter.h.h. Skia benches show
no impact from this change, but will watch the perf bots carefully.

BUG=4212

Review URL: https://codereview.chromium.org/1296943002
2015-08-20 07:42:11 -07:00
robertphillips
2f0dbc761a Update SkLightingShader to support rotation
This also:
makes the SkLightingShader handle normal maps where the rects aren't aligned between the diffuse and normal maps.

adds a light aggregating class (Lights) to SkLightingShader (along with a Builder nested class).

Split out of https://codereview.chromium.org/1261433009/ (Add SkCanvas::drawLitAtlas call)

Committed: https://skia.googlesource.com/skia/+/45b59ed6e4e231814dbdb9f707b3d2a7ee50de84

Review URL: https://codereview.chromium.org/1291783003
2015-08-20 05:15:07 -07:00
robertphillips
f7d602a458 Revert "Update SkLightingShader to support rotation"
This reverts commit 45b59ed6e4.

TBR=herb@google.com

Review URL: https://codereview.chromium.org/1304673002
2015-08-19 13:11:23 -07:00
ethannicholas
fea7763140 Fix transformed stroke width in GrAALinearizingConvexPathRenderer.
BUG=520476

Review URL: https://codereview.chromium.org/1302503003
2015-08-19 12:09:12 -07:00
robertphillips
45b59ed6e4 Update SkLightingShader to support rotation
This also:
makes the SkLightingShader handle normal maps where the rects aren't aligned between the diffuse and normal maps.

adds a light aggregating class (Lights) to SkLightingShader (along with a Builder nested class).

Split out of https://codereview.chromium.org/1261433009/ (Add SkCanvas::drawLitAtlas call)

Review URL: https://codereview.chromium.org/1291783003
2015-08-19 10:35:14 -07:00
reed
a32cc950fb widen gm to show entire image, add place-holder for no context
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1294113003
2015-08-19 06:07:29 -07:00
wangyix
b1daa86732 When getGLInstance is called on a frag proc, the resulting GrGLFragmentProcessor will be the root of a tree of GrGLFragmentProcessors that mirrors the GrFragmentProcessor's tree. This allows setData() to be called recursively (removing the responsibility from compose shader) and allows gl instances direct access to their children gl instances so they can emit their code.
BUG=skia:4182

Review URL: https://codereview.chromium.org/1287023009
2015-08-18 11:29:32 -07:00
reed
935d6cfaa7 Add subsets to SkImageGenerator and SkImageCacherator
... to support subsets in SkImage!

BUG=skia:

Review URL: https://codereview.chromium.org/1301633002
2015-08-18 11:16:09 -07:00
robertphillips
ea4529d09a Move normal map creation methods to sk_tools
Split off of https://codereview.chromium.org/1261433009/ (Add SkCanvas::drawLitAtlas call)

Review URL: https://codereview.chromium.org/1298763002
2015-08-17 15:04:47 -07:00
bsalomon
7539856c1b Make GrVertexBatch objects hold their own draws during GrDrawTarget flush
NO_MERGE_BUILDS

Review URL: https://codereview.chromium.org/1286043004
2015-08-17 12:55:38 -07:00
mtklein
9a106ba2dd A bit of misc cleanup.
- Update comments about skia_shared_lib
 - Remove dead code (system_preferences)
 - Remove non-building code (techtalk1)
 - Turn gm/annotated_text back on.

BUG=skia:

Review URL: https://codereview.chromium.org/1286133004
2015-08-14 10:03:45 -07:00
joshualitt
2ba70995f8 Add GM to test drawing atlas case
BUG=skia:

Review URL: https://codereview.chromium.org/1294513002
2015-08-14 06:30:50 -07:00
bsalomon
16b991390b Split GrDrawBatch and GrVertexBatch into their own files
TBR=joshualitt@google.com

Review URL: https://codereview.chromium.org/1296483002
2015-08-13 14:55:50 -07:00
reed
8f4fe37b1c some catchup CL revisions
BUG=skia:

Review URL: https://codereview.chromium.org/1295593002
2015-08-13 14:06:46 -07:00
bsalomon
abd30f54b7 Introduce GrBatch subclasses GrDrawBatch and GrVertexBatch to prepare for non-drawing batches
Review URL: https://codereview.chromium.org/1293583002
2015-08-13 13:34:48 -07:00
reed
8f34372f7e Extend SkImageGenerator to support natively generated GrTextures. As part of this, added uniqueID() to the generator, and made it be in the same namespace is bitmaps, pixelrefs, images.
To do this, create SkImageCacherator, which wraps a generator and provides an
interface to get a cached answer for either the raster or texture output of
the generator.

BUG=skia:

Review URL: https://codereview.chromium.org/1291803002
2015-08-13 13:32:39 -07:00
reed
d5b75638f7 add SkImage::NewFromPicture and a GM to test it
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1288403002
2015-08-13 09:37:45 -07:00
joshualitt
2771b5617c GrDrawVertices to batches
BUG=skia:

Review URL: https://codereview.chromium.org/1276333004
2015-08-07 12:46:26 -07:00
bsalomon
ebc1c10fe1 Fix warnings on VS2015 x86_64 build
TBR=bungeman@google.com

Review URL: https://codereview.chromium.org/1276133002
2015-08-06 17:33:16 -07:00
reed
e47829b6b1 flag to use const& instead of const* for src-rect
BUG=skia:

Review URL: https://codereview.chromium.org/1272713005
2015-08-06 10:02:53 -07:00
bsalomon
fb1141ae1d Don't pass pipeline to GrBatch::generateGeometry()
R=joshualitt@google.com

Review URL: https://codereview.chromium.org/1275083002
2015-08-06 08:52:49 -07:00
bungeman
d3ebb48320 IWYU: 'core' target, files starting A-C.
TBR=reed@google.com
Verbal lgtm, does not change API.

Committed: https://skia.googlesource.com/skia/+/7403d87db8e43d4c2b5b25ac22a0ebc22bd09d69

Review URL: https://codereview.chromium.org/1265033002
2015-08-05 13:57:49 -07:00
reed
fb8c1fcab1 Revert of IWYU: 'core' target, files starting A-C. (patchset #5 id:80001 of https://codereview.chromium.org/1265033002/ )
Reason for revert:
revert to unblock DEPS roll

../../chrome/browser/chromeos/display/overscan_calibrator.cc:43:10: error: variable has incomplete type 'SkPath'
  SkPath base_path;

Original issue's description:
> IWYU: 'core' target, files starting A-C.
>
> TBR=reed@google.com
> Verbal lgtm, does not change API.
>
> Committed: https://skia.googlesource.com/skia/+/7403d87db8e43d4c2b5b25ac22a0ebc22bd09d69

TBR=reed@google.com,mtklein@google.com,bungeman@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1273613002
2015-08-04 18:44:57 -07:00
bungeman
7403d87db8 IWYU: 'core' target, files starting A-C.
TBR=reed@google.com
Verbal lgtm, does not change API.

Review URL: https://codereview.chromium.org/1265033002
2015-08-04 14:56:53 -07:00
fmalita
1dedc3d2c0 SkPictureImageGenerator
R=reed@google.com

Review URL: https://codereview.chromium.org/1240093004
2015-08-04 13:53:14 -07:00
wangyix
4b3050b410 Added registerChild; transforms, textures, glKey automatically handled.
BUG=skia:

Review URL: https://codereview.chromium.org/1266633003
2015-08-04 07:59:37 -07:00
bsalomon
c41f4d6055 Fix elliptical rrect clip shaders for large radii on devices with mediump
BUG=chromium:426217

Review URL: https://codereview.chromium.org/1256353004
2015-08-03 14:23:03 -07:00
joshualitt
df0c557850 Use new API everywhere for GrDefaultGeoProcFactory
BUG=skia:

Committed: https://skia.googlesource.com/skia/+/801823b3d825d96baadeb9077c5ed1a8ada05cf2

Review URL: https://codereview.chromium.org/1261083003
2015-08-03 11:35:29 -07:00
joshualitt
e494a58de3 Revert of Use new API everywhere for GrDefaultGeoProcFactory (patchset #5 id:80001 of https://codereview.chromium.org/1261083003/)
Reason for revert:
breaking things

Original issue's description:
> Use new API everywhere for GrDefaultGeoProcFactory
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/801823b3d825d96baadeb9077c5ed1a8ada05cf2

TBR=robertphillips@google.com,bsalomon@google.com,joshualitt@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1264283004
2015-08-03 09:32:36 -07:00
joshualitt
801823b3d8 Use new API everywhere for GrDefaultGeoProcFactory
BUG=skia:

Review URL: https://codereview.chromium.org/1261083003
2015-08-03 09:03:33 -07:00
joshualitt
d45fb5a3a5 Add BW masks to random scaler context
TBR=bsalomon@google.com
BUG=skia:

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

Review URL: https://codereview.chromium.org/1270793003
2015-08-01 10:33:40 -07:00
joshualitt
2a6f747cdd Revert of Add BW masks to random scaler context (patchset #1 id:1 of https://codereview.chromium.org/1270793003/)
Reason for revert:
breaks mac

Original issue's description:
> Add BW masks to random scaler context
>
> TBR=bsalomon@google.com
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/a4a530614e9ba856aac3f16c29683e6a2a9153d9

TBR=joshualitt@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1264843003
2015-08-01 10:17:53 -07:00
joshualitt
a4a530614e Add BW masks to random scaler context
TBR=bsalomon@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/1270793003
2015-08-01 09:36:02 -07:00
joshualitt
44c4851c91 adding gm to use random scaler context
BUG=skia:

Committed: https://skia.googlesource.com/skia/+/853336c532504b3436d7dcbf252419f00c79066d

Review URL: https://codereview.chromium.org/1268853008
2015-08-01 07:33:42 -07:00
halcanary
80a1c54740 C API: remove dead code, simplify boilerplate
Review URL: https://codereview.chromium.org/1261953006
2015-07-31 15:16:23 -07:00
joshualitt
d164a710c7 Revert of adding gm to use random scaler context (patchset #4 id:60001 of https://codereview.chromium.org/1268853008/)
Reason for revert:
breaking bots

Original issue's description:
> adding gm to use random scaler context
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/853336c532504b3436d7dcbf252419f00c79066d

TBR=bsalomon@google.com,joshualitt@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1259033004
2015-07-31 15:10:31 -07:00
joshualitt
853336c532 adding gm to use random scaler context
BUG=skia:

Review URL: https://codereview.chromium.org/1268853008
2015-07-31 14:46:46 -07:00
robertphillips
a9652ac09e Address some SkLightingShader TODOs
This CL:
  switches the light colors to be 3 scalars (SkColor3f)
  adds some dox

Review URL: https://codereview.chromium.org/1265983003
2015-07-31 05:17:24 -07:00
caryclark
159fa572c4 linear gradient with stops discretized gm
TBR=reed@google.com
BUG=skia:517

Review URL: https://codereview.chromium.org/1259983009
2015-07-30 12:35:48 -07:00
caryclark
1864bfae63 add radial gradient hard stop test
TBR=reed@google.com
BUG=skia:4140

Review URL: https://codereview.chromium.org/1269723002
2015-07-30 06:41:39 -07:00
robertphillips
640898f588 Update SkLightingShader to take a localMatrix
W/o this we can't draw lit objects anywhere but the origin.

Review URL: https://codereview.chromium.org/1253223003
2015-07-30 05:09:17 -07:00
robertphillips
5f865b9cf1 Move LightingShader to effects
Additionally this CL:

forces the light colors to be opaque
forces the light direction to be normalized
adds a raster implementation
adds a gm

Review URL: https://codereview.chromium.org/1245883003
2015-07-29 12:28:04 -07:00
caryclark
f1f8bd5851 fix dstreadshuffle text portable gm
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1259093004
2015-07-29 06:58:40 -07:00
caryclark
125960152d make tests portable by using 565 compatible colors
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1262703002
2015-07-29 05:27:47 -07:00
caryclark
efa1ece07e gm missed portable text in textblobshader
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1263593004
2015-07-28 11:55:50 -07:00
caryclark
66fb63ffec gm fix missed portable gm text in samplerstress
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1261093002
2015-07-28 11:22:48 -07:00
caryclark
f597c42c50 make pixelsnap textblob* etc gm portable
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1263553002
2015-07-28 10:37:53 -07:00
joshualitt
20dac88565 mixed text blobs really draws LCD
TBR=bsalomon@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/1261483002
2015-07-24 13:16:24 -07:00
caryclark
1818acb6a4 rename portable_typeface_always to portable_typeface
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1257773002
2015-07-24 12:09:25 -07:00
caryclark
37213558e6 make fontscalar gammatext lcdtext typeface verttext2 gm portable
Pass generic font names to tool util function to generate
platform specific fonts and gm test output by unique name.

R=bungeman@google.com

Review URL: https://codereview.chromium.org/1256903002
2015-07-24 11:08:01 -07:00
robertphillips
29ccdf86ab Fix Ganesh drawAtlas bug with quad colors
Ganesh was not expanding the quad colors to vertex colors before calling drawVertices.

The new GM would've caught this bug and reveals Ganesh's limitations re the various xfer modes used with drawAtlas (i.e., w/o AA Ganesh only supports kModulate, w/ AA Ganesh only supports the coefficient-based xfer modes).

Review URL: https://codereview.chromium.org/1254943002
2015-07-24 10:20:45 -07:00
caryclark
ba9757abc2 make dftext gm not overlap itself
TBR=jvanverth@google.com

Review URL: https://codereview.chromium.org/1253643004
2015-07-23 14:07:58 -07:00
caryclark
1b31402bab make fontcache textblob gm portable
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1245123006
2015-07-23 13:48:31 -07:00
caryclark
a0170f10aa make dftext the same on Linux and Android
Use the same font sizes on both platforms so that the gm images
are easier to compare one to the other.

TBR=jvanverth@google.com

Review URL: https://codereview.chromium.org/1253573006
2015-07-23 12:38:59 -07:00
caryclark
3b0f98ee17 fix typeface leak
TBR=bungeman@google.com

Review URL: https://codereview.chromium.org/1239303003
2015-07-23 11:52:01 -07:00
wangyix
7c157a9888 Added GrGLFragmentProcessor::EmitArgs struct for use with emitCode()
BUG=skia:

Review URL: https://codereview.chromium.org/1251173002
2015-07-22 15:08:53 -07:00
caryclark
e59524dff5 make mixedtextblobs gm portable
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1250753004
2015-07-21 13:11:26 -07:00
caryclark
c3dcb67f07 make color emoji gm portable
R=bungeman@google.com

Review URL: https://codereview.chromium.org/1248703004
2015-07-21 12:27:36 -07:00
caryclark
ae3714f27a make varied_text* gm portable
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1244063002
2015-07-21 09:15:53 -07:00
jvanverth
02781977e0 Run noise shader separately in imagefiltersclipped
BUG=skia:4079

Review URL: https://codereview.chromium.org/1245983002
2015-07-21 08:38:06 -07:00
caryclark
4ec1ac6a2d make xfermode* portable
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1243103002
2015-07-21 07:42:45 -07:00
rileya
134003902d Add Rec709 YUV color space support to GrYUVtoRGBEffect.
This change is motivated by a recent switch in how chromium handles
<video> color spaces, making rec709 more commonly used. This will
allow video -> canvas copies to take the fast GPU path when we're using
709, just as we do with 601 and jpeg.

Chromium-side change: https://codereview.chromium.org/1236313002

Review URL: https://codereview.chromium.org/1241723005
2015-07-20 15:00:03 -07:00
caryclark
6531c3619f Generate platform specific fontmgr gm.
The gm output on different font platforms is so different
that comparing images in Gold has little value. Separate the
images by appending platform information to the gm name to
group somewhat similar images together.

Note that this does not attempt to make sure that all images
generated by Gold are nearly pixel identical; it only reduces
the number of nonsensical comparisons.

R=bungeman@google.com

Review URL: https://codereview.chromium.org/1245643002
2015-07-20 13:38:56 -07:00
caryclark
85693c15c8 make stroketext textblob* texteffects tileimagefilter gm portable
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1244833002
2015-07-20 10:48:01 -07:00
wangxianzhu
d76665da1c Reland "SkPDF: Annotations are clipped by canvas clip stack."
Original patch was created by halcanary@google.com, and was reverted
because it triggered crbug.com/503541.

This patch fixes a bug in the original patch about clip path
transformation.

> Also, remove some SkPDFDevice functions.
> Will fix this GM: http://crrev.com/1159273003
> BUG=skia:3872
> Review URL: https://codereview.chromium.org/1148263005

BUG=skia:3872
BUG=503514

Review URL: https://codereview.chromium.org/1238503007
2015-07-17 17:23:15 -07:00
caryclark
97a26d04e2 make drawbitmaprect lighting lumafilter matrixconvolution srcmode gm portable
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1240843005
2015-07-17 13:20:48 -07:00
caryclark
dfcb7abc41 make arithmode bigtext colortype* degeneratesegments gm portable
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1235343004
2015-07-17 09:39:16 -07:00
reed
84984efeb6 Revert[2] of guard to remove DrawBitmapRectFlags
This reverts commit 91110195a2.

BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1240753003
2015-07-17 07:09:43 -07:00
scroggo
91110195a2 Revert of guard to remove DrawBitmapRectFlags (patchset #1 id:1 of https://codereview.chromium.org/1235393003/)
Reason for revert:
breaking android framework build

Original issue's description:
> guard to remove DrawBitmapRectFlags
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/6fb0b6779e40ce05c20cf279f0ecff31fa3cd60d

TBR=fmalita@chromium.org,djsollen@google.com,reed@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1230823007
2015-07-17 05:57:34 -07:00
caryclark
ef14cb397c make glyph_pos imageblur* largeglyphblur portable
R=reed@google.com,bungeman@google.com

Review URL: https://codereview.chromium.org/1243493003
2015-07-16 14:16:04 -07:00
caryclark
d2ce18520e make imagefilters* imagemagnifier imageresizetiled portable
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1238083004
2015-07-16 12:35:58 -07:00
joshualitt
dbe1e6f0c3 Give GrBatch a pointer to GrPipeline
BUG=skia:

Committed: https://skia.googlesource.com/skia/+/1170a12839218f7a23c93487bf95fd83aae0201f

Review URL: https://codereview.chromium.org/1237283007
2015-07-16 08:12:45 -07:00
jvanverth
3e5f55542c Various GL testing fixes
Check for GL context when printing NVPR error string.
Fix some indenting.

Review URL: https://codereview.chromium.org/1235283004
2015-07-16 07:46:07 -07:00
joshualitt
0df62e3d68 Revert of Give GrBatch a pointer to GrPipeline (patchset #1 id:1 of https://codereview.chromium.org/1237283007/)
Reason for revert:
breaking nanobench

Original issue's description:
> Give GrBatch a pointer to GrPipeline
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/1170a12839218f7a23c93487bf95fd83aae0201f

TBR=bsalomon@google.com,joshualitt@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1239073002
2015-07-16 07:16:53 -07:00
joshualitt
1170a12839 Give GrBatch a pointer to GrPipeline
BUG=skia:

Review URL: https://codereview.chromium.org/1237283007
2015-07-16 07:06:50 -07:00
caryclark
5f7f428844 increase gm offsetimagefilter stroke width
With a hairline width, offsetimagefilter fails to draw the
rectangle on some platforms. Make the width 2 so that it
shows up everywhere.

TBR=reed@google.com

Review URL: https://codereview.chromium.org/1236133003
2015-07-16 07:06:46 -07:00
mtklein
767d273ea0 Replace buggy_blend_modes GM with an exhaustive test.
The new test is disabled by default, as it's quite slow.
We can run it if we suspect problems by passing -x to DM.

This test would have been failing before the bug fix, and now is passing.

Assuming the Priv on the end means it's not considered public API...
TBR=reed@google.com

BUG=skia:4052

Review URL: https://codereview.chromium.org/1228333003
2015-07-16 07:01:40 -07:00
reed
6fb0b6779e guard to remove DrawBitmapRectFlags
BUG=skia:

Review URL: https://codereview.chromium.org/1235393003
2015-07-16 06:10:02 -07:00
caryclark
18a240d15c make *imagefilter morphology iamge bitmapsource gm portable
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1236403002
2015-07-15 14:23:50 -07:00
caryclark
e148ac5262 make strokefill gm portable
Convert the Mac-specific font text statically into
paths so that they draw the same on all platforms.

Add drawing portable text using the fake bold paint
setting so that the code path is tested everywhere
and but draws the same thing.

R=reed@google.com

Review URL: https://codereview.chromium.org/1234463006
2015-07-15 14:03:13 -07:00
caryclark
5df0575f04 make gradtext quadpaths gm portable
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1234233003
2015-07-15 11:57:00 -07:00
caryclark
3aaa0db1c4 make colorwheelnative displacement dropshadowimagefilter getposttextpath gm portable
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1237233004
2015-07-15 09:29:32 -07:00
caryclark
cae3ca65d2 make path-reverse gm portable
Put font glyph data in test as path
instead of getting data from the Mac
font. THe font may change, and is
not available on most platforms.

Also remove unreachable code.

R=reed@google.com

Review URL: https://codereview.chromium.org/1230703005
2015-07-15 08:58:13 -07:00
caryclark
108b5b2c23 make linepaths gm portable
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1225303010
2015-07-15 06:18:47 -07:00
caryclark
001ceb7e1b remove funkster from dcshader gm
The multicolored font that funster enables
only draws and measures on some platforms.

Removing it from the dcshader gm allows
the layout to be uniform on all devices,
making it easier to compare the output
in gold.

TBR=bsalomon@google.com

Review URL: https://codereview.chromium.org/1231853004
2015-07-15 05:43:38 -07:00
jvanverth
8895792877 Rename backing texture testing routines
Review URL: https://codereview.chromium.org/1230193006
2015-07-14 11:02:52 -07:00
reed
a5517e2b19 add src-rect-constraint to drawImageRect
Follow-on work
- unify around SrcRectConstraint (i.e. drawBitmapRect)
- remove silly drawBitmapRectToRect alias
- clean-up (possibly remove) alias problems around drawBitmapRect + IRect parameter

BUG=skia:

Review URL: https://codereview.chromium.org/1228083004
2015-07-14 10:54:12 -07:00
robertphillips
3d32d768cd Add new SkPoint3 class
The existing Light filter and the upcoming Lighting Shader both need a Point3 class

Review URL: https://codereview.chromium.org/1229693009
2015-07-13 13:16:44 -07:00
caryclark
7aa1899c03 use portable typeface
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1235873004
2015-07-13 12:08:45 -07:00
mtklein
e20633ed26 Add a GM that reproduces layout test failures with my new xfermode code.
Inspired by https://storage.googleapis.com/chromium-layout-test-archives/linux_blink_rel/69169/layout-test-results/results.html

I think the root cause is overflow.

Also, adds tests for Sk16b::operator<().  It wasn't wrong, but it was suspect
(used in all three of these xfermode implementations) and so it's best to have
tests.

BUG=skia:

Review URL: https://codereview.chromium.org/1228393006
2015-07-13 12:06:33 -07:00
caryclark
1e545b6915 make gm text and colors portable
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1236893002
2015-07-13 08:19:58 -07:00
joshualitt
1c735488cb Start to propagate constness of GrPipelineBuilder up the stack
BUG=skia:

Review URL: https://codereview.chromium.org/1229143007
2015-07-13 08:08:25 -07:00
jvanverth
672bb7fc66 Remove GL-specific code from GMs and tests
TBR=bsalomon@google.com

Review URL: https://codereview.chromium.org/1232173002
2015-07-13 07:19:57 -07:00
mtklein
f059900f75 Fix up -Winconsistent-missing-override
(and a couple presubmit fixes)

This allows us to turn back on -Werror for LLVM coverage builds,
and more generally supports building with Clang 3.7.

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

BUG=skia:

Review URL: https://codereview.chromium.org/1232463006
2015-07-13 06:18:39 -07:00
caryclark
2e096609b2 make convex poly clip portable
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1238483002
2015-07-13 05:39:47 -07:00
joshualitt
7b670db2b4 Remove setFromPaint from GrPipelineBuilder
TBR=bsalomon@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/1227153003
2015-07-09 13:25:02 -07:00
reed
1c84634454 add runtime option to provide data->imagegenerator factory
BUG=skia:

Review URL: https://codereview.chromium.org/1229933003
2015-07-09 11:47:36 -07:00
joshualitt
5f10b5c1b5 More threading of GrProcessorDataManager
TBR=bsalomon@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/1230813003
2015-07-09 10:24:36 -07:00
joshualitt
2cdec31c29 YUV to RGB Texture threading GrProcessorDataManager
BUG=skia:

Review URL: https://codereview.chromium.org/1230803002
2015-07-09 07:31:32 -07:00
joshualitt
9cc1775e72 rename GrShaderDataManager -> GrProcessorDataManager
BUG=skia:

Review URL: https://codereview.chromium.org/1228683002
2015-07-09 06:28:14 -07:00
joshualitt
b2456053c7 more threading of GrShaderDataManager
TBR=bsalomon@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/1215643006
2015-07-08 09:36:59 -07:00
joshualitt
8ca93e7c73 Initial CL to create dummy GrShaderDataManager and thread it through
TBR=bsalomon@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/1225673007
2015-07-08 06:51:43 -07:00
reed
a8db72864a add matrix options to drawDrawable
BUG=skia:

Review URL: https://codereview.chromium.org/1224783002
2015-07-07 10:22:31 -07:00
mtklein
d2baa90938 Make sp- via support SkDrawables; add a GM to test it.
BUG=skia:

Review URL: https://codereview.chromium.org/1212363005
2015-07-07 09:43:28 -07:00
reed
5617900063 add SkImage::NewFromBitmap
BUG=skia:

Review URL: https://codereview.chromium.org/1217053003
2015-07-07 06:11:20 -07:00
robertphillips
d312dcade1 Revert of Revert of Revert of Fix SkTileImageFilter clipping/cropRect interaction issue (patchset #1 id:1 of https://codereview.chromium.org/1207353004/)
Reason for revert:
Still want to disable due to pref regression

Original issue's description:
> Revert of Revert of Fix SkTileImageFilter clipping/cropRect interaction issue (patchset #1 id:1 of https://codereview.chromium.org/1219193002/)
>
> Reason for revert:
> Blocking the roll
>
> Original issue's description:
> > Revert of Fix SkTileImageFilter clipping/cropRect interaction issue (patchset #2 id:30001 of https://codereview.chromium.org/1210053003/)
> >
> > Reason for revert:
> > Perf regression: https://code.google.com/p/chromium/issues/detail?id=505564
> >
> > Original issue's description:
> > > Fix SkTileImageFilter clipping/cropRect interaction issue
> > >
> > > BUG=499499
> > >
> > > Committed: https://skia.googlesource.com/skia/+/157bcd0840b578060dbc3365daafffc6837da391
> >
> > TBR=reed@google.com,senorblanco@google.com,senorblanco@chromium.org,robertphillips@google.com
> > NOPRESUBMIT=true
> > NOTREECHECKS=true
> > NOTRY=true
> > BUG=499499
> >
> > Committed: https://skia.googlesource.com/skia/+/ebaf6a69bf604c85185e23aca3fb93308e747ff5
>
> TBR=reed@google.com,senorblanco@google.com,senorblanco@chromium.org,robertphillips@google.com,reed@chromium.org,bsalomon@google.com
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=499499
>
> Committed: https://skia.googlesource.com/skia/+/835510085062f055c04d8ea46d82831cfbe51793

TBR=reed@google.com,senorblanco@google.com,senorblanco@chromium.org,reed@chromium.org,bsalomon@google.com,jvanverth@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=499499

Review URL: https://codereview.chromium.org/1217303004
2015-07-06 07:59:09 -07:00
jvanverth
8355100850 Revert of Revert of Fix SkTileImageFilter clipping/cropRect interaction issue (patchset #1 id:1 of https://codereview.chromium.org/1219193002/)
Reason for revert:
Blocking the roll

Original issue's description:
> Revert of Fix SkTileImageFilter clipping/cropRect interaction issue (patchset #2 id:30001 of https://codereview.chromium.org/1210053003/)
>
> Reason for revert:
> Perf regression: https://code.google.com/p/chromium/issues/detail?id=505564
>
> Original issue's description:
> > Fix SkTileImageFilter clipping/cropRect interaction issue
> >
> > BUG=499499
> >
> > Committed: https://skia.googlesource.com/skia/+/157bcd0840b578060dbc3365daafffc6837da391
>
> TBR=reed@google.com,senorblanco@google.com,senorblanco@chromium.org,robertphillips@google.com
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=499499
>
> Committed: https://skia.googlesource.com/skia/+/ebaf6a69bf604c85185e23aca3fb93308e747ff5

TBR=reed@google.com,senorblanco@google.com,senorblanco@chromium.org,robertphillips@google.com,reed@chromium.org,bsalomon@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=499499

Review URL: https://codereview.chromium.org/1207353004
2015-07-03 05:48:53 -07:00
bsalomon
ebaf6a69bf Revert of Fix SkTileImageFilter clipping/cropRect interaction issue (patchset #2 id:30001 of https://codereview.chromium.org/1210053003/)
Reason for revert:
Perf regression: https://code.google.com/p/chromium/issues/detail?id=505564

Original issue's description:
> Fix SkTileImageFilter clipping/cropRect interaction issue
>
> BUG=499499
>
> Committed: https://skia.googlesource.com/skia/+/157bcd0840b578060dbc3365daafffc6837da391

TBR=reed@google.com,senorblanco@google.com,senorblanco@chromium.org,robertphillips@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=499499

Review URL: https://codereview.chromium.org/1219193002
2015-07-01 11:02:50 -07:00
mtklein
2766c00fc0 remove SkInstCnt
It's been outclassed by Valgrind and leak sanitizer,
and it seems to be causing problems for external folks building Skia.

I'm not sure why our own builds seem unaffected.

Latest thread:
https://groups.google.com/forum/#!topic/skia-discuss/oj9FsQwwSF0

BUG=skia:

Review URL: https://codereview.chromium.org/1217573002
2015-06-26 11:45:03 -07:00
mtklein
46043ee50f Kill mixedxfermodes
It's too random to be helpful.

BUG=skia:

Review URL: https://codereview.chromium.org/1215703005
2015-06-26 11:43:30 -07:00
robertphillips
157bcd0840 Fix SkTileImageFilter clipping/cropRect interaction issue
BUG=499499

Review URL: https://codereview.chromium.org/1210053003
2015-06-26 08:07:39 -07:00
reed
f9ad558943 Revert of Revert of Return GrGLContext from GrTestTarget (patchset #1 id:1 of https://codereview.chromium.org/1211123004/)
Reason for revert:
un-referting, did not help DEPS roll

Original issue's description:
> Revert of Return GrGLContext from GrTestTarget (patchset #3 id:40001 of https://codereview.chromium.org/1207393002/)
>
> Reason for revert:
> speculative revert to unblock DEPS roll (layout-tests)
>
> Original issue's description:
> > Return GrGLContext from GrTestTarget
> >
> > BUG=skia:
> >
> > Committed: https://skia.googlesource.com/skia/+/b6d93ea428ca5d13641c35faca7d0380980a3a17
>
> TBR=bsalomon@google.com,joshualitt@google.com,joshualitt@chromium.org
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/1852ec2b46a2a0efbb3550ff4d8b640f56a810e9

TBR=bsalomon@google.com,joshualitt@google.com,joshualitt@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1215593002
2015-06-25 21:29:25 -07:00
reed
1852ec2b46 Revert of Return GrGLContext from GrTestTarget (patchset #3 id:40001 of https://codereview.chromium.org/1207393002/)
Reason for revert:
speculative revert to unblock DEPS roll (layout-tests)

Original issue's description:
> Return GrGLContext from GrTestTarget
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/b6d93ea428ca5d13641c35faca7d0380980a3a17

TBR=bsalomon@google.com,joshualitt@google.com,joshualitt@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1211123004
2015-06-25 18:59:32 -07:00
joshualitt
b6d93ea428 Return GrGLContext from GrTestTarget
BUG=skia:

Review URL: https://codereview.chromium.org/1207393002
2015-06-25 15:02:22 -07:00
reed
4c21dc5ddf add drawImageNine
this also exposes nine-patch drawing directly to devices, and creates a shared iterator for unrolling a nine-patch into single rect->rect draws.

BUG=skia:

Review URL: https://codereview.chromium.org/1211583003
2015-06-25 12:32:03 -07:00
reed
71c3c760a8 add SkCanvas::drawAtlas
BUG=skia:

Review URL: https://codereview.chromium.org/1181913003
2015-06-24 10:29:18 -07:00
reed
5fbb623099 add more tests
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1201333002
2015-06-23 14:34:58 -07:00
robertphillips
da57105708 Fix memory leak in simple-offsetimagefilter
Review URL: https://codereview.chromium.org/1203613004
2015-06-23 09:28:52 -07:00
reed
b3fe1b87e0 more tests for offsetimagefilter
BUG=skia:

Review URL: https://codereview.chromium.org/1199933011
2015-06-23 08:29:20 -07:00
robertphillips
702edbd4bc Propagate SkSurfaceProps to more call sites
Start moving to a world where everyone provides surface properties.

Most notably this exposes a portion of SkSurfaceProps to the C API.

BUG=skia:3934

Review URL: https://codereview.chromium.org/1195003003
2015-06-23 06:26:08 -07:00
reed
477fdd8aa4 add simple test for offsetimagefilter
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1204723002
2015-06-23 06:01:10 -07:00
reed
871872f3f2 change old picture serialization to really handle images
BUG=skia:3965

Review URL: https://codereview.chromium.org/1199473002
2015-06-22 12:48:26 -07:00
robertphillips
9a53fd7c41 Begin kLegacyFontHost_InitType cleanup
This CL starts the process of pushing kLegacyFontHost_InitType-type SkSurfaceProps up the call stack and out of Skia. It:

 Gets rid of the default SkBaseDevice ctor. This means everyone has to always hand an explicit SkSurfaceProps to it.

 It makes public the SkBitmapDevice creation methods that require SkSurfaceProps.

 Removes (in Skia's code base) all SkBitmapDevice ctor calls w/o SkSurfaceProps.

 Makes the "recording" canvases (e.g., pdf, svg, xps) explicitly not use kLegacyFontHost_InitType.

 Replicates the creating canvas/device's flags on saveLayer devices

BUG=skia:3934

Review URL: https://codereview.chromium.org/1204433002
2015-06-22 09:46:59 -07:00
reed
462a33c7ac clean offsetimagefilter gm
BUG=skia:
TBR=robertphilips

Review URL: https://codereview.chromium.org/1203473002
2015-06-22 09:10:14 -07:00
jvanverth
34d7288b19 Change large glyph check back to > threshold.
Using >= misses some Chromium test cases that are still
being rendered as paths.

BUG=chromium:467569

Review URL: https://codereview.chromium.org/1202433002
2015-06-22 08:08:09 -07:00
jvanverth
4854d13c27 Remove distance field flag from SkPaint
Review URL: https://codereview.chromium.org/1192413005
2015-06-22 06:46:56 -07:00
robertphillips
c3176aa5e5 Fix dst bound reported by SkTileImageFilter
In the example from the bug we had the filter DAG:

color filter (table)
    0: xfermode filter (arith)
        0: tile filter [0,80,34,114] -> [0,80,800,480]
             0: color filter (table)
                 0: bitmap src 34x34 -> [0,80,34,114]
        1: color filter (table)
             0: picture filter [0, 80, 800, 480]

computeFastBounds was coming out of the DAG with a bound of [0,80,34,114] which didn't represent the pixels that would be drawn.

This CL updates SkTileImageFilter to correctly set the bound for the pixels it will hit.

BUG=493783

Committed: https://skia.googlesource.com/skia/+/05be93bbdf09576f7903130e3b106b0a8c7c4b4e

Committed: https://skia.googlesource.com/skia/+/0be685755f942baea26c66a87226b569fc17e960

Review URL: https://codereview.chromium.org/1152553006
2015-06-16 09:44:56 -07:00
fmalita
109a23d64f Remove the SkCanvas comment API
No longer used in Chromium/Blink.

R=reed@google.com,robertphillips@google.com,mtklein@google.com

Review URL: https://codereview.chromium.org/1153593003
2015-06-15 13:15:31 -07:00
caryclark
65cdba6ba7 Revert of Revert of make gm background colors 565 compatible (patchset #1 id:1 of https://codereview.chromium.org/1184123002/)
Reason for revert:
underlying problem with portable refs deleted more than once fixed

Original issue's description:
> Revert of make gm background colors 565 compatible (patchset #2 id:20001 of https://codereview.chromium.org/1176243006/)
>
> Reason for revert:
> breaks many bots with refcnt error
>
> Original issue's description:
> > make gm background colors 565 compatible
> >
> > Change a batch of GM tests to convert their background color
> > so that it is representable in 8888 and 565.
> >
> > Enable portable text in those same tests to minimize platform
> > differences.
> >
> > In a couple of bitmap tests, use portable typefaces instead of
> > choosing 'Times' which may or may not be available on the platform.
> >
> > R=borenet@google.com
> >
> > Committed: https://skia.googlesource.com/skia/+/be7f768a357aefb39c42d24b81b24d647bb6ab70
>
> TBR=borenet@google.com
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
>
> Committed: https://skia.googlesource.com/skia/+/0bdb08b1ba8fbd18c4838f86a23f1ef4b3a3bfdf

TBR=borenet@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1182403003
2015-06-15 06:51:08 -07:00
caryclark
0bdb08b1ba Revert of make gm background colors 565 compatible (patchset #2 id:20001 of https://codereview.chromium.org/1176243006/)
Reason for revert:
breaks many bots with refcnt error

Original issue's description:
> make gm background colors 565 compatible
>
> Change a batch of GM tests to convert their background color
> so that it is representable in 8888 and 565.
>
> Enable portable text in those same tests to minimize platform
> differences.
>
> In a couple of bitmap tests, use portable typefaces instead of
> choosing 'Times' which may or may not be available on the platform.
>
> R=borenet@google.com
>
> Committed: https://skia.googlesource.com/skia/+/be7f768a357aefb39c42d24b81b24d647bb6ab70

TBR=borenet@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1184123002
2015-06-15 05:28:00 -07:00
caryclark
be7f768a35 make gm background colors 565 compatible
Change a batch of GM tests to convert their background color
so that it is representable in 8888 and 565.

Enable portable text in those same tests to minimize platform
differences.

In a couple of bitmap tests, use portable typefaces instead of
choosing 'Times' which may or may not be available on the platform.

R=borenet@google.com

Review URL: https://codereview.chromium.org/1176243006
2015-06-15 05:09:59 -07:00
caryclark
82fecd4d53 make drawlooper portable
TBR=djsollen@google.com

Review URL: https://codereview.chromium.org/1187603002
2015-06-12 13:41:02 -07:00
caryclark
6eba305422 remove lcd
TBR=djsollen@google.com

Review URL: https://codereview.chromium.org/1183753002
2015-06-12 12:25:26 -07:00
caryclark
d85093c28f make emptypath portable; add 565 color utility
R=djsollen@google.com

Review URL: https://codereview.chromium.org/1182833004
2015-06-12 11:49:04 -07:00
caryclark
ceb9f3b389 update complexclip to portable
TBR=djsollen@google.com

Review URL: https://codereview.chromium.org/1179713007
2015-06-12 10:00:11 -07:00
caryclark
57856a1f58 convert cubicpaths gm tests to portable
TBR=djsollen

Review URL: https://codereview.chromium.org/1182113002
2015-06-12 08:54:38 -07:00
caryclark
7e85216104 fix portable text in test
TBR=djsollen@google.com

Review URL: https://codereview.chromium.org/1179173003
2015-06-12 08:18:45 -07:00
caryclark
ceadfefb93 next batch of portable typeface changes
TBR=djsollen@google.com

Review URL: https://codereview.chromium.org/1177303005
2015-06-12 05:42:58 -07:00
reed
026beb52a2 SkPath::Direction serves two masters:
- input param to addFoo (e.g. addRect), where only CW or CCW are valid)
- output param from computing functions, that sometimes return kUnknown

This CL's intent is to split these into distinct enums/features:
- Direction (public) loses kUnknown, and is only used for input
- FirstDirection (private) is used for computing the first direction we see when analyzing a contour

BUG=skia:

Review URL: https://codereview.chromium.org/1176953002
2015-06-10 14:23:15 -07:00
caryclark
d3c162200f turn on antialiased text
Aliased text didn't work with msaa16, so make it all
antialiased.

TBR=reed@google.com

Review URL: https://codereview.chromium.org/1169173006
2015-06-10 10:34:08 -07:00
caryclark
83ca628cb6 Today's gm include many differences caused by platform font implementations.
This experiment replaces the label used in the aaxfermodes gm with
aliased text generated from paths common to all platforms.

Since there is no way today to generate all dm output from trybots,
this will be checked in to confirm that this strategy provides simpler
output across devices.

This does not introduce a new public interface; instead, dm uses
a extern backdoor to install the SkTypeface::CreateFromName
handler.

Review URL: https://codereview.chromium.org/1163283002
2015-06-10 09:31:09 -07:00
reed
41e010cb90 Revert[2] SkDraw and all Blitters to use pixmap instead of bitmapi
This reverts commit b3f0ec9f99.

BUG=skia:

Review URL: https://codereview.chromium.org/1168303006
2015-06-09 12:16:53 -07:00
reed
b3f0ec9f99 Revert of change SkDraw and all Blitters to use pixmap instead of bitmap (patchset #6 id:100001 of https://codereview.chromium.org/1148793007/)
Reason for revert:
speculative revert to try to unblock DEPS roll

Original issue's description:
> change SkDraw and all Blitters to use pixmap instead of bitmap
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/c31af44336f5eb4a50e83e76e51962d46c3ed458

TBR=scroggo@google.com,jvanverth@google.com,reed@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1164373003
2015-06-08 19:58:07 -07:00
reed
c31af44336 change SkDraw and all Blitters to use pixmap instead of bitmap
BUG=skia:

Review URL: https://codereview.chromium.org/1148793007
2015-06-08 10:47:13 -07:00
robertphillips
63195181d1 Add bigtileimagefilter GM & improvements to toString
This is all the ancillary code from https://codereview.chromium.org/1152553006/ (Fix dst bound reported by SkTileImageFilter).

TBR=reed@google.com, senorblanco@google.com

Review URL: https://codereview.chromium.org/1169713003
2015-06-08 06:21:14 -07:00
robertphillips
270fe6aad5 Revert of Fix dst bound reported by SkTileImageFilter (patchset #3 id:40001 of https://codereview.chromium.org/1152553006/)
Reason for revert:
Blink

Original issue's description:
> Fix dst bound reported by SkTileImageFilter
>
> In the example from the bug we had the filter DAG:
>
> color filter (table)
>     0: xfermode filter (arith)
>         0: tile filter [0,80,34,114] -> [0,80,800,480]
>              0: color filter (table)
>                  0: bitmap src 34x34 -> [0,80,34,114]
>         1: color filter (table)
>              0: picture filter [0, 80, 800, 480]
>
> computeFastBounds was coming out of the DAG with a bound of [0,80,34,114] which didn't represent the pixels that would be drawn.
>
> This CL updates SkTileImageFilter to correctly set the bound for the pixels it will hit.
>
> BUG=493783
>
> Committed: https://skia.googlesource.com/skia/+/05be93bbdf09576f7903130e3b106b0a8c7c4b4e
>
> Committed: https://skia.googlesource.com/skia/+/0be685755f942baea26c66a87226b569fc17e960

TBR=reed@google.com,senorblanco@google.com,senorblanco@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=493783

Review URL: https://codereview.chromium.org/1156583004
2015-06-04 11:15:27 -07:00
caryclark
99a69eb152 make test hittestpath random calls deterministic
R=bsalomon@google.com

Review URL: https://codereview.chromium.org/1157943006
2015-06-04 09:27:43 -07:00
halcanary
74015ed78e Add GM that tests clipping annotations
TBR=reed@google.com

BUG=skia:3880

Review URL: https://codereview.chromium.org/1159273003
2015-06-04 07:26:54 -07:00
robertphillips
0be685755f Fix dst bound reported by SkTileImageFilter
In the example from the bug we had the filter DAG:

color filter (table)
    0: xfermode filter (arith)
        0: tile filter [0,80,34,114] -> [0,80,800,480]
             0: color filter (table)
                 0: bitmap src 34x34 -> [0,80,34,114]
        1: color filter (table)
             0: picture filter [0, 80, 800, 480]

computeFastBounds was coming out of the DAG with a bound of [0,80,34,114] which didn't represent the pixels that would be drawn.

This CL updates SkTileImageFilter to correctly set the bound for the pixels it will hit.

BUG=493783

Committed: https://skia.googlesource.com/skia/+/05be93bbdf09576f7903130e3b106b0a8c7c4b4e

Review URL: https://codereview.chromium.org/1152553006
2015-06-04 06:53:37 -07:00
robertphillips
a66cc7e1e0 Revert of Fix dst bound reported by SkTileImageFilter (patchset #3 id:40001 of https://codereview.chromium.org/1152553006/)
Reason for revert:
breaking tests

Original issue's description:
> Fix dst bound reported by SkTileImageFilter
>
> In the example from the bug we had the filter DAG:
>
> color filter (table)
>     0: xfermode filter (arith)
>         0: tile filter [0,80,34,114] -> [0,80,800,480]
>              0: color filter (table)
>                  0: bitmap src 34x34 -> [0,80,34,114]
>         1: color filter (table)
>              0: picture filter [0, 80, 800, 480]
>
> computeFastBounds was coming out of the DAG with a bound of [0,80,34,114] which didn't represent the pixels that would be drawn.
>
> This CL updates SkTileImageFilter to correctly set the bound for the pixels it will hit.
>
> BUG=493783
>
> Committed: https://skia.googlesource.com/skia/+/05be93bbdf09576f7903130e3b106b0a8c7c4b4e

TBR=reed@google.com,senorblanco@google.com,senorblanco@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=493783

Review URL: https://codereview.chromium.org/1143083006
2015-06-02 10:57:26 -07:00
robertphillips
05be93bbdf Fix dst bound reported by SkTileImageFilter
In the example from the bug we had the filter DAG:

color filter (table)
    0: xfermode filter (arith)
        0: tile filter [0,80,34,114] -> [0,80,800,480]
             0: color filter (table)
                 0: bitmap src 34x34 -> [0,80,34,114]
        1: color filter (table)
             0: picture filter [0, 80, 800, 480]

computeFastBounds was coming out of the DAG with a bound of [0,80,34,114] which didn't represent the pixels that would be drawn.

This CL updates SkTileImageFilter to correctly set the bound for the pixels it will hit.

BUG=493783

Review URL: https://codereview.chromium.org/1152553006
2015-06-02 10:52:43 -07:00
bsalomon
993a4216a6 SkImage::NewFromYUVTexturesCopy
Review URL: https://codereview.chromium.org/1149553002
2015-05-29 11:37:25 -07:00
cdalton
6fd158ea47 Implement Porter Duff XP with a blend table
Removes the runtime logic used by PorterDuffXferProcessor to decide
blend coeffs and shader outputs, and instead uses a compile-time
constant table of pre-selected blend formulas. Separates out the dst
read fallback into its own XP.

Introduces a new blend strategy for srcCoeff=0 that can apply coverage
with a reverse subtract blend equation instead of dual source
blending.

Adds new macros in GrBlend.h to analyze blend formulas both runtime.

Removes kSetCoverageDrawing_OptFlag and GrSimplifyBlend as they are no
longer used.

Adds a GM that verifies all xfermodes, including arithmetic, with the
color/coverage invariants used by Porter Duff.

Adds a unit test that verifies each Porter Duff formula with every
color/coverage invariant.

Major changes:

 * Uses a reverse subtract blend equation for coverage when srcCoeff=0
   (clear, dst-out [Sa=1], dst-in, modulate). Platforms that don't
   support dual source blending no longer require a dst copy for
   dst-in and modulate.

 * Sets BlendInfo::fWriteColor to false when the blend does not modify
   the dst. GrGLGpu will now use glColorMask instead of blending for
   these modes (dst, dst-in [Sa=1], modulate ignored for [Sc=1]).

 * Converts all SA blend coeffs to One for opaque inputs, and ISA to
   Zero if there is also no coverage. (We keep ISA around when there
   is coverage because we use it to tweak alpha for coverage.)

 * Abandons solid white optimizations for the sake of simplicity
   (screen was the only mode that previous had solid white opts).

Minor differences:

 * Inconsequential differences in opt flags (e.g. we now return
   kCanTweakAlphaForCoverage_OptFlag even when there is no coverage).

 * Src coeffs when the shader outputs 0.

 * IS2C vs IS2A when the secondary output is scalar.

BUG=skia:

Committed: https://skia.googlesource.com/skia/+/9a70920db22b6309c671f8e5d519bb95570e4414

Review URL: https://codereview.chromium.org/1124373002
2015-05-27 15:08:33 -07:00
bsalomon
4ee6bd86c5 Add caps overrides to GMs
Review URL: https://codereview.chromium.org/1158963002
2015-05-27 13:23:23 -07:00
joshualitt
7a9c45c01c real fix for textblob use after gpu free
This patch addresses two issues:
1) Textblobs with abandoned strikes were not properly regenerating.
2) Provided by ericrk - GrTextBlobCache removed blobs from |fCache| during freeAll, but left
potentially released blobs in the |fBlobList|. We now remove these from
|fBlobList| as well.
BUG=skia:

Review URL: https://codereview.chromium.org/1160633002
2015-05-26 12:32:23 -07:00
robertphillips
ea46150344 Split drawing functionality out of GrContext and into new GrDrawContext
This is mainly a mechanical CL. There were some fiddly bits in GrContext.cpp where it no longer had access to the GrDrawTarget (and had to use the new GrDrawContext).

I've converted GrAARectRenderer & GrOvalRenderer into static classes so I could stop allocating them.

Review URL: https://codereview.chromium.org/1151283004
2015-05-26 11:38:03 -07:00
bungeman
c33db93d1b Revert of Implement Porter Duff XP with a blend table (patchset #12 id:220001 of https://codereview.chromium.org/1124373002/)
Reason for revert:
Blocking DEPS roll into Chromium. Crashing virtual/gpu/fast/canvas/canvas-composite-*.html tests with the assert

../../third_party/skia/src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp:281: failed assertion "k110_GrGLSLGeneration != gpu->glslGeneration() || fOutputs.empty()"

Original issue's description:
> Implement Porter Duff XP with a blend table
>
> Removes the runtime logic used by PorterDuffXferProcessor to decide
> blend coeffs and shader outputs, and instead uses a compile-time
> constant table of pre-selected blend formulas.
>
> Introduces a new blend strategy for srcCoeff=0 that can apply coverage
> with a reverse subtract blend equation instead of dual source
> blending.
>
> Adds new macros in GrBlend.h to analyze blend formulas both runtime.
>
> Removes kSetCoverageDrawing_OptFlag and GrSimplifyBlend as they are no
> longer used.
>
> Adds a GM that verifies all xfermodes, including arithmetic, with the
> color/coverage invariants used by Porter Duff.
>
> Adds a unit test that verifies each Porter Duff formula with every
> color/coverage invariant.
>
> Major changes:
>
>  * Uses a reverse subtract blend equation for coverage when srcCoeff=0
>    (clear, dst-out [Sa=1], dst-in, modulate). Platforms that don't
>    support dual source blending no longer require a dst copy for
>    dst-in and modulate.
>
>  * Sets BlendInfo::fWriteColor to false when the blend does not modify
>    the dst. GrGLGpu will now use glColorMask instead of blending for
>    these modes (dst, dst-in [Sa=1], modulate ignored for [Sc=1]).
>
>  * Converts all SA blend coeffs to One for opaque inputs, and ISA to
>    Zero if there is also no coverage. (We keep ISA around when there
>    is coverage because we use it to tweak alpha for coverage.)
>
>  * Abandons solid white optimizations for the sake of simplicity
>    (screen was the only mode that previous had solid white opts).
>
> Minor differences:
>
>  * Inconsequential differences in opt flags (e.g. we now return
>    kCanTweakAlphaForCoverage_OptFlag even when there is no coverage).
>
>  * Src coeffs when the shader outputs 0.
>
>  * IS2C vs IS2A when the secondary output is scalar.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/9a70920db22b6309c671f8e5d519bb95570e4414

TBR=egdaniel@google.com,bsalomon@google.com,cdalton@nvidia.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1153993002
2015-05-22 17:55:26 -07:00
cdalton
9a70920db2 Implement Porter Duff XP with a blend table
Removes the runtime logic used by PorterDuffXferProcessor to decide
blend coeffs and shader outputs, and instead uses a compile-time
constant table of pre-selected blend formulas.

Introduces a new blend strategy for srcCoeff=0 that can apply coverage
with a reverse subtract blend equation instead of dual source
blending.

Adds new macros in GrBlend.h to analyze blend formulas both runtime.

Removes kSetCoverageDrawing_OptFlag and GrSimplifyBlend as they are no
longer used.

Adds a GM that verifies all xfermodes, including arithmetic, with the
color/coverage invariants used by Porter Duff.

Adds a unit test that verifies each Porter Duff formula with every
color/coverage invariant.

Major changes:

 * Uses a reverse subtract blend equation for coverage when srcCoeff=0
   (clear, dst-out [Sa=1], dst-in, modulate). Platforms that don't
   support dual source blending no longer require a dst copy for
   dst-in and modulate.

 * Sets BlendInfo::fWriteColor to false when the blend does not modify
   the dst. GrGLGpu will now use glColorMask instead of blending for
   these modes (dst, dst-in [Sa=1], modulate ignored for [Sc=1]).

 * Converts all SA blend coeffs to One for opaque inputs, and ISA to
   Zero if there is also no coverage. (We keep ISA around when there
   is coverage because we use it to tweak alpha for coverage.)

 * Abandons solid white optimizations for the sake of simplicity
   (screen was the only mode that previous had solid white opts).

Minor differences:

 * Inconsequential differences in opt flags (e.g. we now return
   kCanTweakAlphaForCoverage_OptFlag even when there is no coverage).

 * Src coeffs when the shader outputs 0.

 * IS2C vs IS2A when the secondary output is scalar.

BUG=skia:

Review URL: https://codereview.chromium.org/1124373002
2015-05-22 11:36:57 -07:00
reed
5a72c42952 remove unused SkBitmap::scrollRect API
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1154623002
2015-05-21 15:46:20 -07:00
mtklein
7005a57c54 Add PlusMergesAA GM
C.f. https://crrev.com/1156453002/

BUG=skia:

Review URL: https://codereview.chromium.org/1149103003
2015-05-21 10:33:09 -07:00
kkinnunen
b4a797f3aa Move font loading in gm tests and benches out of constructors
Constructing the gm tests and benches causes many calls to font loads.
This is visible as profiling samples in fontconfig and freetype on Linux
for all profiling runs of nanobench. This complicates analysis of
test-cases that are suspected of being slow due to font-related issues.

Move the font loading to GM::onOnceBeforeDraw and Benchmark::onPreDraw.
This way the code is not executed if the testcase does not match the
nanobench --match filter. This way the samples in font-related code are
more easy to identify as legitimate occurances caused by the testcase.

This should not cause differences in timings, because:
* Benchmark::preDraw / onPreDraw is defined to be run outside the timer
* GM::runAsBench is not enabled for any of the modified testcases. Also
  nanobench untimed warmup round should run the onOnceBeforeDraw.
  (and there are other GM::runAsBench gms already doing loading in
   onOnceBeforeDraw).

Changes the behavior:
In TextBench:
Before, the test would report two different gms with the same name if
the color emoji font was not loaded successfully.
After, the test always reports all tests as individual names.

Generally:
The errors from loading fonts now print inbetween each testcase, as
opposed to printing during construction phase. Sample output:
( 143/145 MB  1872) 14.7ms	8888 gm  quadclosepathResource /fonts/Funkster.ttf not a valid font.
( 160/160 MB  1831) 575µs	8888 gm  surfacenewResource /fonts/Funkster.ttf not a valid font.
( 163/165 MB  1816) 12.5ms	8888 gm  linepathResource /fonts/Funkster.ttf not a valid font.
( 263/411 MB  1493) 118ms	8888 gm  typefacestyles_kerningResource /fonts/Funkster.ttf not a valid font.
( 374/411 MB  1231) 7.16ms	565 gm  getpostextpathResource /fonts/Funkster.ttf not a valid font.
( 323/411 MB  1179) 4.92ms	565 gm  stringartResource /fonts/Funkster.ttf not a valid font.
( 347/493 MB   917) 191ms	565 gm  patch_gridResource /fonts/Funkster.ttf not a valid font.
( 375/493 MB   857) 23.9ms	gpu gm  clipdrawdrawCannot render path (0)
( 393/493 MB   706) 2.91ms	unit test  ParsePath------ png error IEND: CRC error
( 394/493 MB   584) 166ms	gpu gm  hairmodesResource /fonts/Funkster.ttf not a valid font.
Resource /fonts/Funkster.ttf not a valid font.
Resource /fonts/Funkster.ttf not a valid font.
...

Review URL: https://codereview.chromium.org/1144023002
2015-05-21 06:15:28 -07:00
bungeman
41868fe562 Font variations.
Multiple Master and TrueType fonts support variation axes.
This implements back-end support for axes on platforms which
support it.

Committed: https://skia.googlesource.com/skia/+/05773ed30920c0214d1433c07cf6360a05476c97

Committed: https://skia.googlesource.com/skia/+/3489ee0f4fa34f124f9de090d12bdc2107d52aa9

Review URL: https://codereview.chromium.org/1027373002
2015-05-20 09:21:04 -07:00
caryclark
612f70d5fa handle large conic strokes better
A stroked conic computes the outset quad's control point by
computing the intersection of the quad's endpoints. If the
the denominator used to compute the scale factor for the
control point is small, check to see if the numerator is also
small so that the division stays bounded.

Also clean up error returns and internal function calls to
simplify the code.

Additionally, remove comic max curvature (unimplemented) and call
extrema functions instead to handle cases where the conic is degenerate
or is a line.

R=reed@google.com, fmalita@chromium.org
BUG=skia:3843

Review URL: https://codereview.chromium.org/1144883003
2015-05-19 11:05:37 -07:00
joshualitt
b8c241ad09 Preliminary attempt to remove batch tracker
BUG=skia:

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

Review URL: https://codereview.chromium.org/1139723004
2015-05-19 08:23:30 -07:00
joshualitt
d3a560fa80 Revert of Preliminary attempt to remove batch tracker (patchset #3 id:40001 of https://codereview.chromium.org/1139723004/)
Reason for revert:
breaking bots

Original issue's description:
> Preliminary attempt to remove batch tracker
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/cbfe91d82500f4ae8c3ff7bd74b3021a4b89fd84

TBR=robertphillips@google.com,joshualitt@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1132323003
2015-05-19 07:15:28 -07:00
joshualitt
cbfe91d825 Preliminary attempt to remove batch tracker
BUG=skia:

Review URL: https://codereview.chromium.org/1139723004
2015-05-19 06:49:32 -07:00
robertphillips
2e5b4c52c5 Fix GrAARectRenderer's handling of unsorted nested rects
What is going on here is that, after the mapPoints in fillAANestedRects, devInside was upside down so the isEmpty check was always firing. I don't see why we need to avoid having devInside sorted.

BUG=488103

Review URL: https://codereview.chromium.org/1135753004
2015-05-19 04:35:39 -07:00
reed
2ba21a08d4 add GM to test extractAlpha
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1142123003
2015-05-18 12:57:56 -07:00
robertphillips
465706820d Revert of Font variations. (patchset #26 id:500001 of https://codereview.chromium.org/1027373002/)
Reason for revert:
Appears to be breaking  Linux ARM bots:

FAILED:
/usr/local/google/home/mosaic-role/slave/repo_clients/chromium_tot/chromium/src/../../prebuilt/toolchain/armv7a/bin/armv7a-cros-linux-gnueabi-g++
... -o obj/third_party/skia/src/ports/skia_library.SkFontHost_FreeType.o
../../third_party/skia/src/ports/SkFontHost_FreeType.cpp:37:31: fatal error:
freetype/ftmm.h: No such file or directory
 #include FT_MULTIPLE_MASTERS_H
                               ^
compilation terminated.

Original issue's description:
> Font variations.
>
> Multiple Master and TrueType fonts support variation axes.
> This implements back-end support for axes on platforms which
> support it.
>
> Committed: https://skia.googlesource.com/skia/+/05773ed30920c0214d1433c07cf6360a05476c97
>
> Committed: https://skia.googlesource.com/skia/+/3489ee0f4fa34f124f9de090d12bdc2107d52aa9

TBR=reed@google.com,mtklein@google.com,djsollen@google.com,halcanary@google.com,bungeman@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1139123008
2015-05-15 11:30:41 -07:00
bungeman
3489ee0f4f Font variations.
Multiple Master and TrueType fonts support variation axes.
This implements back-end support for axes on platforms which
support it.

Committed: https://skia.googlesource.com/skia/+/05773ed30920c0214d1433c07cf6360a05476c97

Review URL: https://codereview.chromium.org/1027373002
2015-05-14 14:18:03 -07:00
joshualitt
88c23fc6e8 remove color from GrGeometryProcessor
BUG=skia:

Review URL: https://codereview.chromium.org/1140983002
2015-05-13 14:18:07 -07:00
bungeman
5ae1312c9f Revert of Font variations. (patchset #21 id:400001 of https://codereview.chromium.org/1027373002/)
Reason for revert:
Mac failing to build due to CFNumberType in Chromium Canary.

Original issue's description:
> Font variations.
>
> Multiple Master and TrueType fonts support variation axes.
> This implements back-end support for axes on platforms which
> support it.
>
> Committed: https://skia.googlesource.com/skia/+/05773ed30920c0214d1433c07cf6360a05476c97

TBR=reed@google.com,mtklein@google.com,djsollen@google.com,halcanary@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1128913008
2015-05-13 12:16:41 -07:00
bungeman
05773ed309 Font variations.
Multiple Master and TrueType fonts support variation axes.
This implements back-end support for axes on platforms which
support it.

Review URL: https://codereview.chromium.org/1027373002
2015-05-13 10:57:10 -07:00
reed
80ea19ca4b Revert of Revert of stop calling SkScalarDiv (patchset #1 id:1 of https://codereview.chromium.org/1138263002/)
Reason for revert:
android patched, blink has rolled

Original issue's description:
> Revert of stop calling SkScalarDiv (patchset #4 id:60001 of https://codereview.chromium.org/1135053002/)
>
> Reason for revert:
> need to wait for Blink roll (and patch android)
>
> Original issue's description:
> > stop calling SkScalarDiv
> >
> > BUG=skia:
> > TBR=
> >
> > Committed: https://skia.googlesource.com/skia/+/67d71c898249a7af3523b16c6a69895a63bfae0a
>
> TBR=
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/2629697933b5cc975e45d2a45c48f803fc6cbcec

TBR=
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1135693003
2015-05-12 10:37:34 -07:00
reed
2629697933 Revert of stop calling SkScalarDiv (patchset #4 id:60001 of https://codereview.chromium.org/1135053002/)
Reason for revert:
need to wait for Blink roll (and patch android)

Original issue's description:
> stop calling SkScalarDiv
>
> BUG=skia:
> TBR=
>
> Committed: https://skia.googlesource.com/skia/+/67d71c898249a7af3523b16c6a69895a63bfae0a

TBR=
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1138263002
2015-05-12 10:28:06 -07:00
reed
67d71c8982 stop calling SkScalarDiv
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1135053002
2015-05-12 09:47:22 -07:00
joshualitt
1107e901c9 Fix blur on large glyphs in runs < SkGlyphCache::max
BUG=skia:

Review URL: https://codereview.chromium.org/1135113002
2015-05-11 14:52:12 -07:00
joshualitt
e4cee1f283 fix for cached textblobs look garbled
BUG=skia:

Review URL: https://codereview.chromium.org/1135813007
2015-05-11 13:04:28 -07:00
robertphillips
2a974625c5 Fix convex-lineonly-paths GM so it plays nice with SampleApp
Review URL: https://codereview.chromium.org/1131273002
2015-05-08 07:08:13 -07:00
bsalomon
e64eb570a5 Iterate over instanced draws in GrGpu rather than above GrBatchTarget
Review URL: https://codereview.chromium.org/1127273007
2015-05-07 11:35:55 -07:00
robertphillips
e40d397259 Isolate GrBufferAllocPools inside GrBatchTarget
This CL refactors the location of the GrBufferAllocPools so they reside entirely inside the GrBatchTarget. This is in preparation for making them use scratch resources.

Review URL: https://codereview.chromium.org/1131553002
2015-05-07 09:51:43 -07:00
bsalomon
cb8979d088 Move DrawInfo out from GrDrawTarget and rename to GrVertices.
Review URL: https://codereview.chromium.org/1124733004
2015-05-05 09:51:38 -07:00
bsalomon
b5238a7571 Start on simplifying generateGeometry() overrides
Committed: https://skia.googlesource.com/skia/+/f28381c6866cad92af8ebe5b9d2db074613b1963

Review URL: https://codereview.chromium.org/1122673002
2015-05-05 07:49:49 -07:00
bsalomon
8415abe44c Revert of Start on simplifying generateGeometry() overrides (patchset #10 id:160001 of https://codereview.chromium.org/1122673002/)
Reason for revert:
Breaking bots

Original issue's description:
> Start on simplifying generateGeometry() overrides
>
> Committed: https://skia.googlesource.com/skia/+/f28381c6866cad92af8ebe5b9d2db074613b1963

TBR=joshualitt@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1124633003
2015-05-04 11:41:42 -07:00
bsalomon
f28381c686 Start on simplifying generateGeometry() overrides
Review URL: https://codereview.chromium.org/1122673002
2015-05-04 11:27:45 -07:00
bsalomon
ed0bcad9c8 Move instanced index buffer creation to flush time
Committed: https://skia.googlesource.com/skia/+/ab622c7b8cc8c39f0a594e4392b9e31b7e1ddb26

Review URL: https://codereview.chromium.org/1116943004
2015-05-04 10:36:43 -07:00
bsalomon
d8ed1b64a6 Revert of Move instanced index buffer creation to flush time (patchset #6 id:100001 of https://codereview.chromium.org/1116943004/)
Reason for revert:
messed up caching, recreating index buffers all the time.

Original issue's description:
> Move instanced index buffer creation to flush time
>
> Committed: https://skia.googlesource.com/skia/+/ab622c7b8cc8c39f0a594e4392b9e31b7e1ddb26

TBR=joshualitt@google.com,robertphillips@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1126613003
2015-05-04 10:09:24 -07:00
reed
71a6cbfc58 remove redundant/deprecated TwoPointRadial gradiet -- use TwoPointConical
This CL derived from https://codereview.chromium.org/1114243005/

BUG=skia:

Review URL: https://codereview.chromium.org/1117423003
2015-05-04 08:32:51 -07:00
bsalomon
ab622c7b8c Move instanced index buffer creation to flush time
Review URL: https://codereview.chromium.org/1116943004
2015-05-04 08:09:30 -07:00
joshualitt
99c7c07e0f Move bounds to GrBatch
BUG=skia:

Review URL: https://codereview.chromium.org/1121463002
2015-05-01 13:43:30 -07:00
bsalomon
d309e7aa0e This replaces the texture creation/caching functions on GrContext with a GrTextureProvider interface. The goal is to pass this narrowly focused object in places that currently take a GrContext but don't need and shouldn't use its other methods. It also has an extended private interface for interacting with non-texture resource types.
Review URL: https://codereview.chromium.org/1107973004
2015-04-30 14:18:54 -07:00
bungeman
3ffa126066 Move resource fonts to common location.
Move resource fonts to resources/fonts, add a destortable font for
testing, and clean up how the tests create fonts from resources.

R=joshualitt@google.com

Review URL: https://codereview.chromium.org/1120823002
2015-04-30 17:12:58 -04:00
egdaniel
29bee0fe65 Make XPFragmentBuilder only Builder with access to DstCopy.
Plus a bunch of renaming.

BUG=skia:

Review URL: https://codereview.chromium.org/1110033004
2015-04-29 11:54:42 -07:00
bungeman
c64239a466 Remove system call in DW for default font.
The last user of the GDI default font in DW is
onMatchFamilyStyleCharacter and it doesn't appear to actually need
to use it. This change removes a system call, making things a bit
faster, as well as eliminating a call blocked in the sandbox.

BUG=chromium:459056

Review URL: https://codereview.chromium.org/1107283003
2015-04-29 08:15:31 -07:00
bsalomon
fcabe429a4 Do circular clipping in normalized space
BUG=skia:426217

Review URL: https://codereview.chromium.org/1110173002
2015-04-28 12:43:01 -07:00
jvanverth
cfc18867d9 Use GLSLCaps for creating processor keys and GLSL-specific programs
Effectively all this does is future-proof any GLSL-specific code, as
GLSLCaps is just a typedef of GLCaps.

BUG=skia:

Review URL: https://codereview.chromium.org/1109863004
2015-04-28 08:48:20 -07:00
robertphillips
db3f8cdb59 Fix memory deletion error in "convex-lineonly-paths" GM
TBR=humper@google.com

Review URL: https://codereview.chromium.org/1110153002
2015-04-28 08:13:51 -07:00
robertphillips
7272935744 Add new GM/bench for line-only convex paths
BUG=472723

Review URL: https://codereview.chromium.org/1112603002
2015-04-28 07:42:04 -07:00
mtklein
1113da72ec Mike's radial gradient CL with better float -> int.
patch from issue 1072303005 at patchset 40001 (http://crrev.com/1072303005#ps40001)

This looks quite launchable.  radial_gradient3, min of 100 samples:
  N5:  985µs -> 946µs
  MBP: 395µs -> 279µs

On my MBP, most of the meat looks like it's now in reading the cache and writing to dst one color at a time.  Is that something we could do in float math rather than with a lookup table?

BUG=skia:

CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Mac10.8-Clang-Arm7-Debug-Android-Trybot,Build-Ubuntu-GCC-Arm7-Release-Android_NoNeon-Trybot

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

Review URL: https://codereview.chromium.org/1109643002
2015-04-27 12:08:01 -07:00
mtklein
8d3e9dff3f Revert of Mike's radial gradient CL with better float -> int. (patchset #7 id:120001 of https://codereview.chromium.org/1109643002/)
Reason for revert:
compile failures.

Original issue's description:
> Mike's radial gradient CL with better float -> int.
>
> patch from issue 1072303005 at patchset 40001 (http://crrev.com/1072303005#ps40001)
>
> This looks quite launchable.  radial_gradient3, min of 100 samples:
>   N5:  985µs -> 946µs
>   MBP: 395µs -> 279µs
>
> On my MBP, most of the meat looks like it's now in reading the cache and writing to dst one color at a time.  Is that something we could do in float math rather than with a lookup table?
>
> BUG=skia:
>
> CQ_EXTRA_TRYBOTS=client.skia.android:Test-Android-GCC-Nexus5-CPU-NEON-Arm7-Debug-Trybot,Test-Android-GCC-Nexus9-CPU-Denver-Arm64-Debug-Trybot
>
> Committed: https://skia.googlesource.com/skia/+/abf6c5cf95e921fae59efb487480e5b5081cf0ec

TBR=reed@google.com,robertphillips@google.com,mtklein@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1109883003
2015-04-27 11:21:16 -07:00
mtklein
abf6c5cf95 Mike's radial gradient CL with better float -> int.
patch from issue 1072303005 at patchset 40001 (http://crrev.com/1072303005#ps40001)

This looks quite launchable.  radial_gradient3, min of 100 samples:
  N5:  985µs -> 946µs
  MBP: 395µs -> 279µs

On my MBP, most of the meat looks like it's now in reading the cache and writing to dst one color at a time.  Is that something we could do in float math rather than with a lookup table?

BUG=skia:

CQ_EXTRA_TRYBOTS=client.skia.android:Test-Android-GCC-Nexus5-CPU-NEON-Arm7-Debug-Trybot,Test-Android-GCC-Nexus9-CPU-Denver-Arm64-Debug-Trybot

Review URL: https://codereview.chromium.org/1109643002
2015-04-27 11:13:53 -07:00
tfarina
567ff2f614 Cleanup: Remove unnecessary double-semicolons.
The entries were found by the following command line:

$ find . -regex ".*\.[cChH]\(pp\)?" | xargs git grep -e ';;' --and --not
-e 'for *(.*;;'

Which is a combination of http://stackoverflow.com/a/3858879 and
http://gitster.livejournal.com/27674.html

BUG=None
R=mtklein@google.com

Review URL: https://codereview.chromium.org/1088763005
2015-04-27 07:01:45 -07:00
reed
3d9005c028 add GM to show bad banding in raster for radial gradients
BUG=427508
TBR=

Review URL: https://codereview.chromium.org/1061753009
2015-04-23 10:30:27 -07:00
reed
8f76cb905a new GM to test clipping cubics
BUG=skia:3716
TBR=caryclark@google.com

Review URL: https://codereview.chromium.org/1096433009
2015-04-22 17:38:23 -07:00
bsalomon
c6534a28a6 Make pixel_snap GMs incur less platform-specific variation
Review URL: https://codereview.chromium.org/1080393009
2015-04-22 11:34:46 -07:00
bsalomon
87cbcf3f86 Add GM to test non-AA pixel snapping for points, lines, rects.
Review URL: https://codereview.chromium.org/1070213003
2015-04-22 08:51:38 -07:00
reed
4912437891 adjust GM to have a final opaque bg, to make it easier to triage
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1085333003
2015-04-20 09:10:31 -07:00
reed
7e4186acce add GM to test imagefilters + xfermodes
draws incorrectly as is, but will be fixed by https://codereview.chromium.org/1091173003

BUG=skia:3741

Review URL: https://codereview.chromium.org/1088773004
2015-04-20 07:27:15 -07:00
halcanary
a8448bc3df PDF: Correctly embed JPEG images directly into PDF output.
We only embed images with YUV planes.  That should only grab the
subset of color JPEGs supported by PDF.

BUG=skia:3180

Review URL: https://codereview.chromium.org/1025773002
2015-04-17 13:27:24 -07:00
joshualitt
523ed6c0c1 adding new gm to rotate, translate, and scale textblobs
this is to test distance field caching and regen of texture blobs on scale.

BUG=skia:

Review URL: https://codereview.chromium.org/1097563002
2015-04-17 09:01:05 -07:00
mtklein
4afe21e864 add a GM to demo the blend bug
BUG=skia:3739

Review URL: https://codereview.chromium.org/1094863003
2015-04-17 06:32:13 -07:00
mtklein
6ef68ab2cd Don't serialize anything for SkEmptyShader.
BUG=skia:3735

Review URL: https://codereview.chromium.org/1097433002
2015-04-16 07:59:12 -07:00