Commit Graph

19175 Commits

Author SHA1 Message Date
scroggo
860e8a6719 Renable image benchmarking
- Remove --images '' to renable image benchmarking
- Add a flag to disable testing JPEG's buildTileIndex, since it also leaks memory
- Do not run images on GPU
- Do not run large interlaced images on 32 bit bots
- When buildTileIndex is not being used in the subset benches, do not use it for BRD

BUG=skia:3418
BUG=skia:4469
BUG=skia:4471
BUG=skia:4360

Review URL: https://codereview.chromium.org/1396113002
2015-10-15 07:51:28 -07:00
joshualitt
c603c143bb small tidy of benchmarkstream
BUG=skia:

Committed: https://skia.googlesource.com/skia/+/691b6af907e55250a29a7a2a346b63c2026011c3

Review URL: https://codereview.chromium.org/1395703002
2015-10-15 07:18:29 -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
74ec8d47b5 Add a comment to explain clip intersection in crop rects.
BUG=skia:
R=robertphillips

Review URL: https://codereview.chromium.org/1401973003
2015-10-15 05:04:27 -07:00
ericrk
f469fc0e0f Fix floating point data loss in SkPictureShader
SkPictureShader had an invalid use of SkMax32 on two SkScalars which
ended up converting the result to an integer which caused us to lose
necessary floating point data.

BUG=473166

Review URL: https://codereview.chromium.org/1401743004
2015-10-14 17:33:29 -07:00
msarett
67e676087c Revert of Supply separate flags for onBuildTileIndex (patchset #1 id:1 of https://codereview.chromium.org/1402783008/ )
Reason for revert:
Missing an important line.

Original issue's description:
> Supply separate flags for onBuildTileIndex
>
> This is a follow up to:
> https://codereview.chromium.org/1401283003/
>
> Supply separate flags for onBuildTileIndex
>
> Since png and jpeg's implementations of onBuildTileIndex rely on
> modifications to their underlying libraries, rather than whether we are
> running on Android, use separate flags that can be disabled
> independently.
>
> This will allow us to easily turn off the feature. It also is a step
> towards building and running on other platforms for testing (e.g.
> valgrind/ASAN to find memory leaks etc).
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/fc06e9c0e621744654e231ae6fa4460d88c0e27e

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

Review URL: https://codereview.chromium.org/1394433005
2015-10-14 15:21:11 -07:00
bsalomon
a912ddef05 Don't abort analytic clipping if using MSAA until elements are examined
TBR=joshualitt@google.com

Review URL: https://codereview.chromium.org/1399223005
2015-10-14 15:01:50 -07:00
joshualitt
a3b8c67ea6 Revert of small tidy of benchmarkstream (patchset #2 id:20001 of https://codereview.chromium.org/1395703002/ )
Reason for revert:
Breaks visualbench

Original issue's description:
> small tidy of benchmarkstream
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/691b6af907e55250a29a7a2a346b63c2026011c3

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

Review URL: https://codereview.chromium.org/1392833006
2015-10-14 14:45:07 -07:00
msarett
fc06e9c0e6 Supply separate flags for onBuildTileIndex
This is a follow up to:
https://codereview.chromium.org/1401283003/

Supply separate flags for onBuildTileIndex

Since png and jpeg's implementations of onBuildTileIndex rely on
modifications to their underlying libraries, rather than whether we are
running on Android, use separate flags that can be disabled
independently.

This will allow us to easily turn off the feature. It also is a step
towards building and running on other platforms for testing (e.g.
valgrind/ASAN to find memory leaks etc).

BUG=skia:

Review URL: https://codereview.chromium.org/1402783008
2015-10-14 14:42:44 -07:00
bsalomon
10528f1d58 Store texture target on GrGLTexture. This is in preparation for using texture targets other than 2D.
Review URL: https://codereview.chromium.org/1403123002
2015-10-14 12:54:52 -07:00
scroggo
fd2b067b9e Remove unnecessary allocation in nanobench
Review URL: https://codereview.chromium.org/1408593002
2015-10-14 09:00:36 -07:00
bsalomon
0b5b6b2105 Fix clipping when all analytic FP creations can be skipped
BUG=skia:

Review URL: https://codereview.chromium.org/1400343004
2015-10-14 08:31:34 -07:00
fmalita
0b01da7bca Fix TextBlobTest valgrind error
When converting text to glyph IDs, the paint needs to reflect the actual
text encoding.

R=bungeman@google.com,herb@google.com

Review URL: https://codereview.chromium.org/1404153002
2015-10-14 08:11:40 -07:00
joshualitt
691b6af907 small tidy of benchmarkstream
BUG=skia:

Review URL: https://codereview.chromium.org/1395703002
2015-10-14 08:04:22 -07:00
scroggo
8e48ed51ba Supply separate flags for onBuildTileIndex
Since png and jpeg's implementations of onBuildTileIndex rely on
modifications to their underlying libraries, rather than whether we are
running on Android, use separate flags that can be disabled
independently.

This will allow us to easily turn off the feature. It also is a step
towards building and running on other platforms for testing (e.g.
valgrind/ASAN to find memory leaks etc).

Review URL: https://codereview.chromium.org/1401283003
2015-10-14 07:54:34 -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
joshualitt
d0f0bceb0e Create VisualStreamTimingModule
BUG=skia:

Review URL: https://codereview.chromium.org/1385073002
2015-10-14 07:49:28 -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
scroggo
2da1a854b0 Stop benching PNG buildTileIndex by default
It leaks memory and kills the bots. Supply an option to run it for
local comparison.

BUG=skia:4360
BUG=skia:3418

Review URL: https://codereview.chromium.org/1396613007
2015-10-13 13:33:33 -07:00
kkinnunen
0adfffba1b Fix dm with Chromium command buffer driver
Fix a crash in dm when run with Chromium command buffer driver.

Also removes glCopyTextureCHROMIUM, it does not seem to be used.
This is removed on the grounds that it would need similar change,
if it was used. The variable fCopyTextureCHROMIUM does not seem to
be populated in the Chromium side, either.

BUG=skia:2992

Review URL: https://codereview.chromium.org/1389213004
2015-10-13 12:58:38 -07:00
msarett
fdb47571a3 Add subsetting to SkScanlineDecoder
This CL allows the SkScanlineDecoder to decode partial
scanlines.

This is a first step in efficiently implementing subsetting
in SkScaledCodec.

BUG=skia:4209

Review URL: https://codereview.chromium.org/1390213002
2015-10-13 12:50:14 -07:00
herb
eb85b8321b Fix text axis alignment calculation
BUG=skia:

Review URL: https://codereview.chromium.org/1405583002
2015-10-13 11:47:54 -07:00
fmalita
9ae8fe1c60 [SkTextBlob] Remove incorrect builder assert
At the end of TightRunBounds, glyphPosX cannot exceed the start of the
next run.  But glyphPosY is running ahead of glyphPosX (for
kFull_Positioning) => the glyphPosY assert is incorrect.

Since the two pointers advance in lock-step, there isn't much value in
the glyphPosY assert anyway - we might as well remove it.

BUG=chromium:542643
R=reed@google.com,bungeman@google.com

Review URL: https://codereview.chromium.org/1405463004
2015-10-13 08:59:23 -07:00
rmistry
598f3ff4b3 Whitespace change to test CQ waiting for l-g-t-m
BUG=skia:

Review URL: https://codereview.chromium.org/1401333002
2015-10-13 04:44:40 -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
msarett
ea03aed9c5 SkBitmapRegionCanvas bug fix
BUG=skia:

Review URL: https://codereview.chromium.org/1393423004
2015-10-12 13:33:18 -07:00
reed
d82bc7b90a post-commit fixes to applyFilter CL
BUG=skia:

Review URL: https://codereview.chromium.org/1404483002
2015-10-12 13:17:23 -07:00
rmistry
69113ba19b Whitespace change to turn Android bots green
BUG=skia:
TBR=borenet

Review URL: https://codereview.chromium.org/1405433002
2015-10-12 13:07:28 -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
reed
f028003cf4 change more effects to only expose factories
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1395403002
2015-10-12 11:10:10 -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
msarett
04965c6f11 SkBitmapRegionDecoder clean-up
Use SkCodecPrintf instead of SkDebugf.

Check if the conversion is possible rather than starting many decodes
that will certainly fail.

Small refactor to code that deals with subsets that fall outside
of the image.

BUG=skia:

Review URL: https://codereview.chromium.org/1395383002
2015-10-12 10:24:38 -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
msarett
14bbe1dcd5 Enable more testing for scaled webps
BUG=skia:

Review URL: https://codereview.chromium.org/1401093002
2015-10-12 08:14:40 -07:00
update-skps
205f1ac915 Update SKP version
Automatic commit by the RecreateSKPs bot.

TBR=
NO_MERGE_BUILDS

Review URL: https://codereview.chromium.org/1401013002
2015-10-11 00:20:57 -07:00
fmalita
b0b45d35e4 [TextBlob] Fall back to TightRunBounds when the font bounds are empty
Empty font bounds are likely an indication of a font bug.  As a best
effort, we can use TightRunBounds in this easily detectable case.

Since TightRunBounds only supports kDefault_Positioning currently, the
CL also reinstates handling of kFull_Positioning and
kHorizontal_Positioning (removed in http://crrev.com/858153007).

BUG=507022
R=reed@google.com,bungeman@google.com

Review URL: https://codereview.chromium.org/1399123002
2015-10-09 14:46:28 -07:00
Brian Salomon
8b3eca95ae Fix SkWindow.cpp includes for non-gpu mode
TBR=bungeman@google.com

Review URL: https://codereview.chromium.org/1400933002 .
2015-10-09 16:54:48 -04: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
jvanverth
cda8ec2b03 Add test with GLFW framework
BUG=skia:

Review URL: https://codereview.chromium.org/1367403006
2015-10-09 13:27:34 -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
scroggo
e361781bf7 Fix codec memory leaks in nanobench
SubsetTranslateBench.cpp:
Unref the color table, so it gets deleted.

SkBitmapRegionDecoderInterface.cpp:
Delete the stream if it is not used.

BUG=skia:3418

Review URL: https://codereview.chromium.org/1396113003
2015-10-09 12:15:57 -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
egdaniel
79da63fa0b Fix gpu drawBitmap to work when BM is A8 and we have a shader
BUG=skia:

Review URL: https://codereview.chromium.org/1399763002
2015-10-09 10:55:16 -07:00
fmalita
37d8688927 Optional gradient dithering
Update raster gradient impls to observe the paint dithering flag.

For now this new behavior is disabled pending internal/external
client updates to mitigate diffs.

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

Review URL: https://codereview.chromium.org/1391303002
2015-10-09 10:22:46 -07:00
scroggo
2c3b218f74 Focus SkScaledCodec on BitmapRegionDecoder
The primary goal of SkScaledCodec is to replace the current
implementation of BitmapRegionDecoder, which depends on modified
versions of libjpeg and libpng, with an implementation that uses
standard versions of the libaries. Since BitmapRegionDecoder only
supports PNG, WEBP and JPEG, limit SkScaledCodec to those classes.
We will focus on those three until we complete this primary goal.
Then we can continue to make SkScaledCodec work for other formats.

Fix some bugs in SkScaledCodec::NewFromStream:
- Handle a NULL input stream properly
- Ensure that the input stream is deleted as expected on bad data

Add tests for these error cases.

BUG=skia:4428

Review URL: https://codereview.chromium.org/1389053002
2015-10-09 08:40:59 -07:00
scroggo
0a3cac8a90 Reland of Pass --images '' to nanobench to disable image benchmarking. (patchset #1 id:1 of https://codereview.chromium.org/1400633002/ )
Reason for revert:
Still breaking. e.g.

http://build.chromium.org/p/client.skia/builders/Test-iOS-Clang-iPad4-GPU-SGX554-Arm7-Debug/builds/1466/steps/nanobench/logs/stdio

http://build.chromium.org/p/client.skia.android/builders/Perf-Android-GCC-Nexus7-GPU-Tegra3-Arm7-Release/builds/2280/steps/nanobench/logs/stdio

Original issue's description:
> Revert of Pass --images '' to nanobench to disable image benchmarking. (patchset #1 id:1 of https://codereview.chromium.org/1381703003/ )
>
> Reason for revert:
> I have attempted to fix the problems that caused running nanobench with images to fail, so testing to see if they are in fact fixed.
>
> Original issue's description:
> > Pass --images '' to nanobench to disable image benchmarking.
> >
> > Enabling image benchmarking has caused most nanobench runs to fail,
> > both Debug and Release.
> >
> > BUG=skia:3418
> > NOTREECHECKS=true
> > TBR=scroggo@google.com
> >
> > Committed: https://skia.googlesource.com/skia/+/1f7039c6c5f0f118b629994b0bac255345e5abd6
>
> BUG=skia:3418
>
> Committed: https://skia.googlesource.com/skia/+/c2e59caa0a466040f4b4f08cb5604c86b2615efa

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

Review URL: https://codereview.chromium.org/1396843003
2015-10-08 14:44:51 -07:00
scroggo
c2e59caa0a Revert of Pass --images '' to nanobench to disable image benchmarking. (patchset #1 id:1 of https://codereview.chromium.org/1381703003/ )
Reason for revert:
I have attempted to fix the problems that caused running nanobench with images to fail, so testing to see if they are in fact fixed.

Original issue's description:
> Pass --images '' to nanobench to disable image benchmarking.
>
> Enabling image benchmarking has caused most nanobench runs to fail,
> both Debug and Release.
>
> BUG=skia:3418
> NOTREECHECKS=true
> TBR=scroggo@google.com
>
> Committed: https://skia.googlesource.com/skia/+/1f7039c6c5f0f118b629994b0bac255345e5abd6

BUG=skia:3418

Review URL: https://codereview.chromium.org/1400633002
2015-10-08 14:09:41 -07:00