Commit Graph

2940 Commits

Author SHA1 Message Date
bsalomon
045802dbb7 Rewrite GrTextureMaker to disentangle bitmap case from base class and give GPU object a say in what copying needs to be done.
Committed: https://skia.googlesource.com/skia/+/fcffaf22d697f06f903c3193308f9dc54a959f79

Committed: https://skia.googlesource.com/skia/+/1a197ea31e0aac7ea312e9a6c0d9f5df626b0350

Review URL: https://codereview.chromium.org/1409163002
2015-10-20 07:58:01 -07:00
robertphillips
423f6461e9 Add SkTTopoSort
BUG=skia:4094

Review URL: https://codereview.chromium.org/1414503003
2015-10-19 12:15:55 -07:00
Brian Salomon
bc0bcc08b3 Revert recent CLs around GrTextureMaker/GrTextureParamsAdjuster
Review URL: https://codereview.chromium.org/1411353002 .
2015-10-19 15:12:32 -04:00
bsalomon
2fc11d39d1 Move definitions of GrGL basic types (e.g. GrGLenum) to their own header.
Review URL: https://codereview.chromium.org/1410333003
2015-10-19 09:03:23 -07:00
bsalomon
1a197ea31e Rewrite GrTextureMaker to disentangle bitmap case from base class and give GPU object a say in what copying needs to be done.
Committed: https://skia.googlesource.com/skia/+/fcffaf22d697f06f903c3193308f9dc54a959f79

Review URL: https://codereview.chromium.org/1409163002
2015-10-19 08:24:09 -07:00
robertphillips
9c4909b50f Add imgblur tool to assist BlurMaskFilter debugging
imgblur is intended to establish a ground truth for debugging mask blur issues. It performs a brute force (non-separable) Gaussian blur of the provided image.

The blur code itself is in sk_tools_utils so it can be more easily used programmatically in other places (e.g., blur unit tests).

Review URL: https://codereview.chromium.org/1384203002
2015-10-19 06:39:17 -07:00
egdaniel
91957941ce Revert of Rewrite GrTextureMaker to disentangle bitmap case from base class and give GPU object a say in what… (patchset #4 id:60001 of https://codereview.chromium.org/1409163002/ )
Reason for revert:
breaking nanobench

Original issue's description:
> Rewrite GrTextureMaker to disentangle bitmap case from base class and give GPU object a say in what copying needs to be done.
>
> Committed: https://skia.googlesource.com/skia/+/fcffaf22d697f06f903c3193308f9dc54a959f79

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

Review URL: https://codereview.chromium.org/1409923003
2015-10-16 13:59:14 -07:00
bsalomon
fcffaf22d6 Rewrite GrTextureMaker to disentangle bitmap case from base class and give GPU object a say in what copying needs to be done.
Review URL: https://codereview.chromium.org/1409163002
2015-10-16 13:35:10 -07:00
mtklein
2e2ea38bb7 SkRemote
BUG=skia:

Review URL: https://codereview.chromium.org/1391023005
2015-10-16 10:29:41 -07:00
caryclark
26ad22ab61 Enabling clip stack flattening exercises path ops.
Iterating through the 903K skps that represent the
imagable 1M top web pages triggers a number of
bugs, some of which are addressed here.

Some web pages trigger intersecting cubic
representations of arc with their conic
counterparts. This exposed a flaw in coincident
detection that caused an infinite loop. The loop
alternatively extended the coincident section and,
determining the that the bounds of the curve pairs
did not overlap, deleted the extension.

Track the number of times the coincident detection
is called, and if it exceeds an empirically found
limit, assume that the curves are coincident and
force it to be so.

The loop count limit can be determined by enabling
DEBUG_T_SECT_LOOP_COUNT and running all tests. The
largest count is reported on completion.

Another class of bugs was caused by concident
detection duplicating nearly identical points that
had been merged earlier. To track these bugs, the
'handle coincidence' code was duplicated as a
const debug variety that reported if one of a
dozen or so irregularities are present; then it is
easier to see when a block of code that fixes one
irregularity regresses another.

Creating the debug const code version exposed some
non-debug code that could be const, and some that
was experimental and could be removed. Set
DEBUG_COINCIDENCE to track coincidence health and
handling.

For running on Chrome, DEBUG_VERIFY checks the
result of pathops against the same operation
using SkRegion to verify that the results are
nearly the same.

When visualizing the pathops work using
tools/pathops_visualizer.htm, set
DEBUG_DUMP_ALIGNMENT to see the curves after
they've been aligned for coincidence.

Other bugs fixed include detecting when a
section of a pair of curves have devolved into
lines and are coincident.

TBR=reed@google.com

Review URL: https://codereview.chromium.org/1394503003
2015-10-16 09:03:38 -07:00
jvanverth
338047e21f Clean up iOS build files
Review URL: https://codereview.chromium.org/1409663002
2015-10-15 13:20:35 -07:00
msarett
f724b99435 Reenable warnings in src/codec
BUG=skia:

Review URL: https://codereview.chromium.org/1400343005
2015-10-15 06:41:06 -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
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
halcanary
34422610ac SkPDF: Optionally output PDF/A-2b archive format.
Note: this format does not yet pass validation tests.

Add skia_pdf_generate_pdfa GYP flag.  Default to off for now.
PDF/A files are not reproducable, so they make correctness
testing harder.

Turn the Metadata struct into te SkPDFMetadata struct.  This
splits out a lot of functionality around both kinds of metadata.

When PDF/A is used, add an ID entry to the trailer.

Add SkPDFObjNumMap::addObjectRecursively.

Test with

    GYP_DEFINES=skia_pdf_generate_pdfa=1 bin/sync-and-gyp
    ninja -C out/Release dm
    out/Release/dm --config pdf --src skp gm -w /tmp/dm

With skia_pdf_generate_pdfa=0, all PDFs generated from GMs and
SKPs are identical.  With skia_pdf_generate_pdfa=1, all PDFs
generated from GMs and SKPs render identically in Pdfium.

BUG=skia:3110

Review URL: https://codereview.chromium.org/1394263003
2015-10-12 10:11:18 -07:00
bungeman
21f99b7733 Revert of SkPDF: Optionally output PDF/A-2b archive format. (patchset #5 id:80001 of https://codereview.chromium.org/1394263003/ )
Reason for revert:
SkMD5 is not really part of the Skia library. This is breaking the roll by using it, since Chromium doesn't build it.

Original issue's description:
> SkPDF: Optionally output PDF/A-2b  archive format.
>
> Note: this format does not yet pass validation tests.
>
> Add skia_pdf_generate_pdfa GYP flag.  Default to off for now.
> PDF/A files are not reproducable, so they make correctness
> testing harder.
>
> Turn the Metadata struct into te SkPDFMetadata struct.  This
> splits out a lot of functionality around both kinds of metadata.
>
> When PDF/A is used, add an ID entry to the trailer.
>
> Add SkPDFObjNumMap::addObjectRecursively.
>
> Test with
>
>     GYP_DEFINES=skia_pdf_generate_pdfa=1 bin/sync-and-gyp
>     ninja -C out/Release dm
>     out/Release/dm --config pdf --src skp gm -w /tmp/dm
>
> With skia_pdf_generate_pdfa=0, all PDFs generated from GMs and
> SKPs are identical.  With skia_pdf_generate_pdfa=1, all PDFs
> generated from GMs and SKPs render identically in Pdfium.
>
> BUG=skia:3110
>
> Committed: https://skia.googlesource.com/skia/+/939c0fe51f157104758bcb268643c8b6d317a530

TBR=tomhudson@google.com,halcanary@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:3110

Review URL: https://codereview.chromium.org/1398193002
2015-10-09 13:45:50 -07:00
bsalomon
f276ac5c16 Move functions from SkGr to SkGrPriv.h
Review URL: https://codereview.chromium.org/1397123002
2015-10-09 13:36:42 -07:00
halcanary
939c0fe51f SkPDF: Optionally output PDF/A-2b archive format.
Note: this format does not yet pass validation tests.

Add skia_pdf_generate_pdfa GYP flag.  Default to off for now.
PDF/A files are not reproducable, so they make correctness
testing harder.

Turn the Metadata struct into te SkPDFMetadata struct.  This
splits out a lot of functionality around both kinds of metadata.

When PDF/A is used, add an ID entry to the trailer.

Add SkPDFObjNumMap::addObjectRecursively.

Test with

    GYP_DEFINES=skia_pdf_generate_pdfa=1 bin/sync-and-gyp
    ninja -C out/Release dm
    out/Release/dm --config pdf --src skp gm -w /tmp/dm

With skia_pdf_generate_pdfa=0, all PDFs generated from GMs and
SKPs are identical.  With skia_pdf_generate_pdfa=1, all PDFs
generated from GMs and SKPs render identically in Pdfium.

BUG=skia:3110

Review URL: https://codereview.chromium.org/1394263003
2015-10-09 13:09:58 -07:00
msarett
e6dd004c1b Fill incomplete images in SkCodec parent class
Rather than implementing some sort of "fill" in every
SkCodec subclass for incomplete images, let's make the
parent class handle this situation.

This includes an API change to SkCodec.h

SkCodec::getScanlines() now returns the number of lines it
read successfully, rather than an SkCodec::Result enum.
getScanlines() most often fails on an incomplete input, in
which case it is useful to know how many lines were
successfully decoded - this provides more information than
kIncomplete vs kSuccess.  We do lose information when the
API is used improperly, as we are no longer able to return
kInvalidParameter or kScanlineNotStarted.

Known Issues:
Does not work for incomplete fFrameIsSubset gifs.
Does not work for incomplete icos.

BUG=skia:

Review URL: https://codereview.chromium.org/1332053002
2015-10-09 11:07:34 -07:00
bsalomon
4a33952961 Bye bye processor data manager.
Review URL: https://codereview.chromium.org/1388113002
2015-10-06 08:40:51 -07:00
herb
39e2e75f73 Remove duplicate .cpp which should have been a .h
Review URL: https://codereview.chromium.org/1389923002
2015-10-06 07:42:53 -07:00
herb
1562855b19 Add more .h files to the .gypi
BUG=skia:

Review URL: https://codereview.chromium.org/1386963002
2015-10-05 13:28:59 -07:00
jvanverth
2f5bb3abfa Add ship sample
BUG=skia:

Review URL: https://codereview.chromium.org/1359033005
2015-10-05 11:05:07 -07:00
jvanverth
44dcb8a84b Some iOS fixes to make SampleApp work better.
Changes:
- Rebuild argc and argv so we can process command line arguments
- Remove unnecessary SimpleiOSApp files
- Add support for reading files from the app bundle
- Add gpu flag so we can start up directly into OpenGL

Review URL: https://codereview.chromium.org/1382943004
2015-10-02 09:12:05 -07:00
bsalomon
473addf176 Remove separate cache for clip mask textures
Review URL: https://codereview.chromium.org/1377943003
2015-10-02 07:49:06 -07:00
hendrikw
b1ac52fb0f Skia: Add Command Buffer support to Linux/Mac
Code added to load libcommand_buffer_gles2.so on linux or
mac.

Review URL: https://codereview.chromium.org/1346423002
2015-10-01 18:29:34 -07:00
scroggo
f174e92873 Update libwebp and resume testing scaled webp
libwebp has a fix for [1]. Update to the commit that contains the fix.

Update libwebp.gypi, corresponding to libwebp's latest makefile.

Turn back on DM testing for scaled webp, now that it should no longer
use uninitialized memory.

[1] https://code.google.com/p/webp/issues/detail?id=254

BUG=skia:4038

Committed: https://skia.googlesource.com/skia/+/0575d3e6c272744a66ab3281f9871366717df339

Review URL: https://codereview.chromium.org/1280073002
2015-10-01 10:56:08 -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
herb
f32602921a Add some of my favorite headers to gyp.
BUG=skia:

Review URL: https://codereview.chromium.org/1378133003
2015-09-30 12:22:25 -07:00
reed
856e9d9214 Revert[4] of add ImageShader, sharing code with its Bitmap cousin
Now with GrTextureMaker subclasses to handle npot usage.

This reverts commit 476506d070.

BUG=skia:

Review URL: https://codereview.chromium.org/1370223002
2015-09-30 12:21:45 -07:00
scroggo
46c5747256 Merge SkCodec with SkScanlineDecoder
Benefits:
- This mimics other decoding APIs (including the ones SkCodec relies
on, e.g. a png_struct, which can be used to decode an entire image or
one line at a time).

- It allows a client to ask us to do what we can do efficiently - i.e.
start from encoded data and either decode the whole thing or scanlines.

- It removes the duplicate methods which appeared in both SkCodec and
SkScanlineDecoder (some of which, e.g. in SkJpegScanlineDecoder, just
call fCodec->sameMethod()).

- It simplifies moving more checks into the base class (e.g. the
examples in skbug.com/4284).

BUG=skia:4175
BUG=skia:4284

=====================================================================

SkScanlineDecoder.h/.cpp:
Removed.

SkCodec.h/.cpp:
Add methods, enums, and variables which were previously in
SkScanlineDecoder.
Default fCurrScanline to -1, as a sentinel that start has not been
called.

General changes:
Convert SkScanlineDecoders to SkCodecs.

General changes in SkCodec subclasses:
Merge SkScanlineDecoder implementation into SkCodec. Most (all?) owned
an SkCodec, so they now call this-> instead of fCodec->.

SkBmpCodec.h/.cpp:
Replace the unused rowOrder method with an override for
onGetScanlineOrder.
Make getDstRow const, since it is called by onGetY, which is const.

SkCodec_libpng.h/.cpp:
Make SkPngCodec an abstract class, with two subclasses which handle
scanline decoding separately (they share code for decoding the entire
image). Reimplement onReallyHasAlpha so that it can return the most
recent result (e.g. after a scanline decode which only decoded part
of the image) or a better answer (e.g. if the whole image is known to
be opaque).
Compute fNumberPasses early, so we know which subclass to instantiate.
Make SkPngInterlaceScanlineDecoder use the base class' fCurrScanline
rather than a separate variable.

CodexTest.cpp:
Add tests for the state changes in SkCodec (need to call start before
decoding scanlines; calling getPixels means that start will need to
be called again before decoding more scanlines).
Add a test which decodes in stripes, currently only used for an
interlaced PNG.

TODO: Add tests for onReallyHasAlpha.

Review URL: https://codereview.chromium.org/1365313002
2015-09-30 08:57:14 -07:00
herb
e4c17356b6 Unify ThreadID.
BUG=skia:

Review URL: https://codereview.chromium.org/1371303003
2015-09-29 14:38:01 -07:00
herb
62a69c26b3 Move Mutexy things to private.
There is no API change.

TBR=reed@google.com

BUG=skia:

Review URL: https://codereview.chromium.org/1368333004
2015-09-29 11:47:45 -07:00
hendrikw
03ba61436b skia: roll ANGLE and remove compile flags
Recent angle change allows us to remove some of the ANGLE specific
compile flags

Review URL: https://codereview.chromium.org/1376803003
2015-09-29 10:30:31 -07:00
herb
b906daf112 Have /src files use header directly.
BUG=skia:

Review URL: https://codereview.chromium.org/1373253003
2015-09-29 09:37:59 -07:00
reed
476506d070 Revert of Revert[2] of add ImageShader, sharing code with its Bitmap cousin (patchset #11 id:200001 of https://codereview.chromium.org/1352293002/ )
Reason for revert:
guess: Need to handle NPOT support in shader case

Original issue's description:
> Revert[2] of add ImageShader, sharing code with its Bitmap cousin
>
> Adjustment from previous land : runtime check for npot-support when texture is requested for tiling.
>
> (patchset #10 id:180001 of https://codereview.chromium.org/1342113002/ )
>
> This reverts commit f260851362.
>
> BUG=skia:4365
>
> Committed: https://skia.googlesource.com/skia/+/fe05707c356d2a8c2c69222591d4cafbd456b4e5

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

Review URL: https://codereview.chromium.org/1375673002
2015-09-28 10:26:51 -07:00
reed
c9e190ddac Revert of change pixel-serializer to support reencoding existing data (patchset #5 id:80001 of https://codereview.chromium.org/1373683003/ )
Reason for revert:
Need to somehow get access to encoders in chrome -- link error on the roll since SkImageEncoder is not built as part of chrome.

Original issue's description:
> change pixel-serializer to support reencoding existing data
>
> Trying to evolve this interface so it can
> - support rich set of backend-encoders (including ones like ETC1 that can cheaply convert to KXT
> - allow for encoding images as well as bitmaps (e.g. for picture serialization)
> - perhaps replace SkImageEncoder as an API (assuming we create a factory that returns a serializer given a format)
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/13f48dc85aa68a60da66aaf39c93d527d11d1278

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

Review URL: https://codereview.chromium.org/1371983003
2015-09-28 09:58:41 -07:00
reed
13f48dc85a change pixel-serializer to support reencoding existing data
Trying to evolve this interface so it can
- support rich set of backend-encoders (including ones like ETC1 that can cheaply convert to KXT
- allow for encoding images as well as bitmaps (e.g. for picture serialization)
- perhaps replace SkImageEncoder as an API (assuming we create a factory that returns a serializer given a format)

BUG=skia:

Review URL: https://codereview.chromium.org/1373683003
2015-09-28 08:58:53 -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
fe05707c35 Revert[2] of add ImageShader, sharing code with its Bitmap cousin
Adjustment from previous land : runtime check for npot-support when texture is requested for tiling.

(patchset #10 id:180001 of https://codereview.chromium.org/1342113002/ )

This reverts commit f260851362.

BUG=skia:4365

Review URL: https://codereview.chromium.org/1352293002
2015-09-25 02:31:09 -07:00
herb
7f0a3d7523 Make mutex semaphore based.
This implementation improves performance of SkMutex acquire / release pair from 42ns -> 13 ns.

SkSharedMutex and SkSpinlock have the same performance.

It also removes specialized windows and linux/mac code.

BUG=skia:

Review URL: https://codereview.chromium.org/1359733002
2015-09-24 07:34:49 -07:00
reed
dd42e5c05c Revert "Revert of remove unused SkCachingPixelRef (patchset #1 id:1 of https://codereview.chromium.org/1364743002/ )"
removed test for unsupported SkInstallDiscardable...

This reverts commit 60c73d5180.

BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1369443002
2015-09-24 00:21:20 -07:00
benjaminwagner
60c73d5180 Revert of remove unused SkCachingPixelRef (patchset #1 id:1 of https://codereview.chromium.org/1364743002/ )
Reason for revert:
Build failure: https://uberchromegw.corp.google.com/i/client.skia.compile/builders/Build-Ubuntu-GCC-Arm7-Debug-Android_FrameworkDefs/builds/1146

Original issue's description:
> remove unused SkCachingPixelRef
>
> BUG=skia:
> TBR=
>
> Committed: https://skia.googlesource.com/skia/+/70d58b7da535e32bcac35739d11ab8367e99f224

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

Review URL: https://codereview.chromium.org/1359393004
2015-09-23 11:53:37 -07:00
reed
70d58b7da5 remove unused SkCachingPixelRef
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1364743002
2015-09-23 11:36:03 -07:00
hendrikw
6f0fdac9e7 skia: Add support for ANGLE on linux
This will allow the ANGLE guys to test the ANGLE gl backend
with nanobench and DM

Review URL: https://codereview.chromium.org/1343193005
2015-09-23 11:35:55 -07:00
msarett
7f69144aaa Add nanobench tests for BitmapRegionDecoder
SkBitmapRegionDecoderInterface provides an interface
for multiple implementations of Android's
BitmapRegionDecoder.

We already have correctness tests in DM that will enable us
to compare the quality of our various BRD implementations.

We also need these performance tests to compare the speed
of our various implementations.

BUG=skia:4357

Review URL: https://codereview.chromium.org/1344993003
2015-09-22 11:56:16 -07:00
bsalomon
bf87730c7d Move GrFragmentProcessor implementation to its own cpp file
TBR=joshualitt@google.com

Review URL: https://codereview.chromium.org/1350523004
2015-09-22 09:06:13 -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