Commit Graph

3173 Commits

Author SHA1 Message Date
egdaniel
fca294b83b Create Sample that combines combose shader and coons patch
BUG=skia:

Review URL: https://codereview.chromium.org/1417123004
2015-11-05 13:09:08 -08:00
joshualitt
474a9ea051 Wire up SDL on Android
BUG=skia:

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

Review URL: https://codereview.chromium.org/1415453009
2015-11-05 11:49:35 -08:00
joshualitt
5d7a7fe563 Revert of Wire up SDL on Android (patchset #4 id:60001 of https://codereview.chromium.org/1415453009/ )
Reason for revert:
breaks appurify

Original issue's description:
> Wire up SDL on Android
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/a4d3797c3b0f0cac8493c46cb334ca88a5d6ccf6

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

Review URL: https://codereview.chromium.org/1410703009
2015-11-05 10:48:41 -08:00
joshualitt
a4d3797c3b Wire up SDL on Android
BUG=skia:

Review URL: https://codereview.chromium.org/1415453009
2015-11-05 08:35:31 -08:00
joshualitt
65d6fbb576 Create SDL backed SkOSWindow
BUG=skia:

Review URL: https://codereview.chromium.org/1413593007
2015-11-04 13:41:02 -08:00
msarett
677de31a2f Compile bitmap_region_decoder on Android
BUG=skia:

Review URL: https://codereview.chromium.org/1422313004
2015-11-04 04:28:59 -08:00
robertphillips
e51fa4ac31 Clean up GrAtlas and rename it GrLayerAtlas
Review URL: https://codereview.chromium.org/1412243013
2015-11-03 07:04:48 -08:00
caryclark
ef784fb7f5 More conic-specific tests revealed a few conic-specific bugs. Because javascript / canvas make visualizing conics tricky, new native tools are required.
The utility SubsetPath removes parts of a potentially very large path to isolate a minimal test case. SubsetPath is very useful for debugging path ops, but is not path ops specific.

PathOpsBuilderConicTest compares the output of the Path Ops Builder, sequential calls to Simplify, and SkRegions for some number of rotated ovals.

Some tests caused path ops to hang. It was caught adding a loop of curves because the head was not found by the tail. Even though the root cause has been fixed, SkSegment::addCurveTo callers now abort the path op if the same curve was added twice.

The subdivided conic weight was been computed anew. Fortunately, it's a simpler computation that the one it replaces.

Some Simplify() subroutines returned false to signal that the results needed assembling. Change these to abort the current operation instead.

Coincident curve intersection triggered two small bugs; one where no perpendicular could be found for coincident curves, and one where no coincident curves remain after looping.

The SixtyOvals test can be run through multiple processes instead of multiple threads. This strategy allows a 48 core machine to saturate all cores at 100%.

The DEBUG_VISUALIZE_CONICS code in PathOpsConicIntersectionTest acknowleges that it is easier to visualize conics with Skia than with script and html canvas. This test also verifies that path ops subdivision matches geometry chopping.

TBR=reed@google.com

Review URL: https://codereview.chromium.org/1405383004
2015-10-30 12:03:06 -07:00
robertphillips
687378229a Remove GrPipelineBuilder from getPathRenderer call
Logically this CL:

Moves the PathRendererChain from GrContext to GrDrawManager
   - this was needed to untangled the Path-Chain/Renderer header mess
   - this entailed adding getDrawingMgr so the CMM could access the PathRenderingChain
   - this also entailed re-adding freeGpuResources to the GrDrawingMgr
Moves the CanDrawArgs struct up stack
Removes the GrPipelineBuilder from the CanDrawArgs struct

Review URL: https://codereview.chromium.org/1407883004
2015-10-29 12:12:21 -07:00
egdaniel
7dc4bd06fc Remove GrGLProcessor and create GrGLSLTextureSampler class.
Part ??? of separating glsl and gl

BUG=skia:

Review URL: https://codereview.chromium.org/1425013003
2015-10-29 07:57:02 -07:00
joshualitt
cc92b4a7ec Initial gyp files for SDL
BUG=skia:

Review URL: https://codereview.chromium.org/1411033003
2015-10-29 07:09:53 -07:00
scroggo
a3f792d4d4 Rename SkScaledCodec.cpp to SkSampledCodec.cpp
Review URL: https://codereview.chromium.org/1413363008
2015-10-28 14:06:10 -07:00
hendrikw
9a7404188e skia: Add ANGLE support on Mac
I want to be able to compare ANGLE vs CommandBuffer for
dm and nanobench on Mac, so enabling ANGLE on mac.

Review URL: https://codereview.chromium.org/1395783003
2015-10-28 08:42:29 -07:00
egdaniel
018fb62d12 Create GLSL base class for ProgramDataManager
BUG=skia:

Review URL: https://codereview.chromium.org/1428543003
2015-10-28 07:26:40 -07:00
mtklein
f7c0822911 Default off LTCG for human builds.
It's absurdly slow.

We can turn it back on with

skia> python gyp_skia -Dskia_win_ltcg=1

The bots will automatically define skia_is_bot and skia_win_ltcg.

BUG=skia:

Review URL: https://codereview.chromium.org/1407043009
2015-10-27 11:24:40 -07:00
hendrikw
855dc9395f skia: Fix command buffer support on the mac
The extension on the mac is .dylib, updated the name.

EGL.h isn't available on mac (unless we include skia_angle.h).
I've got a somewhat bad hack of defining the types that I need
to get this running.

GetProcedureAddress was somehow successfully grabbing gl
functions from another lib.  Removed this call, I copied it
from ANGLE impl, but it isn't required.

lib load path works differently, fixed in GYP

BUG=skia:2992

Review URL: https://codereview.chromium.org/1403153002
2015-10-27 10:04:34 -07:00
bungeman
13dd023882 Update Android FreeType version.
Update FreeType to a newer version. Because this caused issues in
finding the correct ftoptions.h and ftmodule.h [1], be sure to state
the ones we want explicitly.

This also add gzip.c which is needed for WOFF support [2].

[1] FreeType "Simplify header file hierarchy."
    fae382076409db198dfbff36ac4cbb97b05b30a1

[2] FreeType "[gzip] New function `FT_Gzip_Uncompress'."
    dc240524ff31891a442225430b28e9620c1fa89f

Review URL: https://codereview.chromium.org/833103004
2015-10-27 08:39:39 -07:00
robertphillips
87ed6be0e4 Get debugger compiling again
Recent house cleaning has broken the debugger - mainly around the defunct profiling feature. This makes CL it even more defunct.

Review URL: https://codereview.chromium.org/1416723006
2015-10-26 09:28:12 -07:00
tomhudson
3c8ceb7350 Simplify linkages to Android framework internals
We've migrated SkHwuiRenderer into the Android Framework as
android::uirenderer::TestWindowContext in response to an internal
bug; we now delete that class and change our build references here.

R=djsollen@google.com

Review URL: https://codereview.chromium.org/1407053009
2015-10-26 07:21:32 -07:00
mtklein
33eefcd58b SkTime::GetNSecs()
- Move high-precision wall timers from tools/timer to SkTime.
   - Implement SkTime::GetMSecs() in terms of SkTime::GetNSecs().
   - Delete unused tools/timer code.

I have no idea what's going on there in src/animator.
I don't intend to investigate.

BUG=skia:

Committed: https://skia.googlesource.com/skia/+/70084cbc16ee8162649f2601377feb6e49de0217

CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Ubuntu-GCC-x86_64-Debug-CrOS_Link-Trybot

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

Committed: https://skia.googlesource.com/skia/+/38a88e4c0c28a7be981aac7bb4a198ad95a62a63

Review URL: https://codereview.chromium.org/1422513003
2015-10-23 07:02:06 -07:00
mtklein
3b5b784542 Revert of SkTime::GetNSecs() (patchset #11 id:200001 of https://codereview.chromium.org/1422513003/ )
Reason for revert:
Times don't look like they make sense on Windows.

Original issue's description:
> SkTime::GetNSecs()
>
>    - Move high-precision wall timers from tools/timer to SkTime.
>    - Implement SkTime::GetMSecs() in terms of SkTime::GetNSecs().
>    - Delete unused tools/timer code.
>
> I have no idea what's going on there in src/animator.
> I don't intend to investigate.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/70084cbc16ee8162649f2601377feb6e49de0217
>
> CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Ubuntu-GCC-x86_64-Debug-CrOS_Link-Trybot
>
> Committed: https://skia.googlesource.com/skia/+/a1840d50e29fd95e4df2d1168fe54c34c2a5c30c
>
> Committed: https://skia.googlesource.com/skia/+/38a88e4c0c28a7be981aac7bb4a198ad95a62a63

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

Review URL: https://codereview.chromium.org/1422623003
2015-10-23 06:40:33 -07:00
mtklein
38a88e4c0c SkTime::GetNSecs()
- Move high-precision wall timers from tools/timer to SkTime.
   - Implement SkTime::GetMSecs() in terms of SkTime::GetNSecs().
   - Delete unused tools/timer code.

I have no idea what's going on there in src/animator.
I don't intend to investigate.

BUG=skia:

Committed: https://skia.googlesource.com/skia/+/70084cbc16ee8162649f2601377feb6e49de0217

CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Ubuntu-GCC-x86_64-Debug-CrOS_Link-Trybot

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

Review URL: https://codereview.chromium.org/1422513003
2015-10-23 06:24:07 -07:00
mtklein
5a06df4686 Revert of SkTime::GetNSecs() (patchset #10 id:180001 of https://codereview.chromium.org/1422513003/ )
Reason for revert:
https://codereview.chromium.org/1412453006

Original issue's description:
> SkTime::GetNSecs()
>
>    - Move high-precision wall timers from tools/timer to SkTime.
>    - Implement SkTime::GetMSecs() in terms of SkTime::GetNSecs().
>    - Delete unused tools/timer code.
>
> I have no idea what's going on there in src/animator.
> I don't intend to investigate.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/70084cbc16ee8162649f2601377feb6e49de0217
>
> CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Ubuntu-GCC-x86_64-Debug-CrOS_Link-Trybot
>
> Committed: https://skia.googlesource.com/skia/+/a1840d50e29fd95e4df2d1168fe54c34c2a5c30c

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

Review URL: https://codereview.chromium.org/1417753003
2015-10-22 17:49:22 -07:00
mtklein
a1840d50e2 SkTime::GetNSecs()
- Move high-precision wall timers from tools/timer to SkTime.
   - Implement SkTime::GetMSecs() in terms of SkTime::GetNSecs().
   - Delete unused tools/timer code.

I have no idea what's going on there in src/animator.
I don't intend to investigate.

BUG=skia:

Committed: https://skia.googlesource.com/skia/+/70084cbc16ee8162649f2601377feb6e49de0217

CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Ubuntu-GCC-x86_64-Debug-CrOS_Link-Trybot

Review URL: https://codereview.chromium.org/1422513003
2015-10-22 13:33:22 -07:00
caryclark
6ae30fbbaf Revert of SkTime::GetNSecs() (patchset #9 id:160001 of https://codereview.chromium.org/1422513003/ )
Reason for revert:
broke chromeos

Original issue's description:
> SkTime::GetNSecs()
>
>    - Move high-precision wall timers from tools/timer to SkTime.
>    - Implement SkTime::GetMSecs() in terms of SkTime::GetNSecs().
>    - Delete unused tools/timer code.
>
> I have no idea what's going on there in src/animator.
> I don't intend to investigate.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/70084cbc16ee8162649f2601377feb6e49de0217

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

Review URL: https://codereview.chromium.org/1420923003
2015-10-22 13:03:02 -07:00
mtklein
70084cbc16 SkTime::GetNSecs()
- Move high-precision wall timers from tools/timer to SkTime.
   - Implement SkTime::GetMSecs() in terms of SkTime::GetNSecs().
   - Delete unused tools/timer code.

I have no idea what's going on there in src/animator.
I don't intend to investigate.

BUG=skia:

Review URL: https://codereview.chromium.org/1422513003
2015-10-22 12:47:04 -07:00
msarett
26ad17b8f8 Implementation of SkBitmapRegionDecoder using SkAndroidCodec
Includes testing in DM and nanobench

BUG=skia:

Review URL: https://codereview.chromium.org/1402863002
2015-10-22 07:29:19 -07:00
mtklein
e71000f0df Move SkChecksum::Murmur3 out of the header.
As we use this more and more, we end up with more and more inline copies.
On my desktop, this makes Skia ~16K smaller.

Boy perf trybots would be neat.

BUG=skia:

Review URL: https://codereview.chromium.org/1415133003
2015-10-21 11:53:27 -07:00
egdaniel
0d3f061262 Move GrGLShaderVar to GrGLSL
BUG=skia:

Review URL: https://codereview.chromium.org/1417123002
2015-10-21 10:45:48 -07:00
msarett
3d9d7a7213 Create an SkAndroidCodec API separate from SkCodec
We will implement this API using SkCodecs.

SkAndroidCodecs will be used to implement the
BitmapRegionDecoder Java API (and possibly
BitmapFactory).

BUG=skia:

Review URL: https://codereview.chromium.org/1406223002
2015-10-21 10:27:10 -07:00
mtklein
0c768a2f33 Clean up some dead code.
This cleans up tools/ code, or code that should have been in tools/.

The only interesting code change trims features off of PictureRenderer.
It's still in use by a few useful-looking tools.

BUG=skia:

Review URL: https://codereview.chromium.org/1416913003
2015-10-20 14:29:10 -07:00
mtklein
a1bde7d2e1 Remove SkThread::setProcessorAffinity()
It's only used by a couple unit tests.  We have other ways of getting
the same quality testing of our ref-count code now (e.g. TSAN).

BUG=skia:
CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Ubuntu-GCC-x86_64-Release-CMake-Trybot,Build-Mac10.9-Clang-x86_64-Release-CMake-Trybot

Review URL: https://codereview.chromium.org/1408213005
2015-10-20 11:05:06 -07:00
robertphillips
3dc6ae55ca Move GrDrawingManager methods to their own .cpp file
Small cleanup

Review URL: https://codereview.chromium.org/1407393004
2015-10-20 09:54:32 -07:00
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
tomhudson
f260851362 Revert of add ImageShader, sharing code with its Bitmap cousin (patchset #10 id:180001 of https://codereview.chromium.org/1342113002/ )
Reason for revert:
Failing ImageNewShaderTest on both Android (Tegra3 GPU) and iOS bots.

e.g.

/Users/chrome-bot/buildbot/skiabot-ipad4-000/build/slave/workdir/build/skia/tests/
	ImageNewShaderTest.cpp:24	0 == memcmp(bm1.getPixels(), bm2.getPixels(), bm1.getSize())
	ImageNewShaderTest.cpp:95	0xFFFF0000 == bmt.getColor(0, y)
	ImageNewShaderTest.cpp:98	0xFFDEDEDE == bmt.getColor(x, y)
	ImageNewShaderTest.cpp:98	0xFFDEDEDE == bmt.getColor(x, y)
	ImageNewShaderTest.cpp:98	0xFFDEDEDE == bmt.getColor(x, y)
	ImageNewShaderTest.cpp:98	0xFFDEDEDE == bmt.getColor(x, y)
	ImageNewShaderTest.cpp:95	0xFFFF0000 == bmt.getColor(0, y)
...

Original issue's description:
> add ImageShader, sharing code with its Bitmap cousin
>
> This is done by having abstracted the BitmapShaderContext to take a BitmapProvider, instead of just a bitmap. This allows us to share all of that code between SkBitmap and SkImage, since both are valid providers.
>
> It also means that we can simplify SkImage_Base to not need a virtual for onNewShader, since ALL images can uniformly be turned into a shader now.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/0b93e3149d2cb30860c51f9f3204ae811d9a97ca

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

Review URL: https://codereview.chromium.org/1355863002
2015-09-18 09:36:12 -07:00
robertphillips
5ce341fcd7 Add slice tool
Don't know if we want to add this but I found it useful when tracking down blur circle bugs.

Review URL: https://codereview.chromium.org/1350323002
2015-09-18 09:04:43 -07:00
reed
0b93e3149d add ImageShader, sharing code with its Bitmap cousin
This is done by having abstracted the BitmapShaderContext to take a BitmapProvider, instead of just a bitmap. This allows us to share all of that code between SkBitmap and SkImage, since both are valid providers.

It also means that we can simplify SkImage_Base to not need a virtual for onNewShader, since ALL images can uniformly be turned into a shader now.

BUG=skia:

Review URL: https://codereview.chromium.org/1342113002
2015-09-18 08:26:26 -07:00
joshualitt
3566d44d85 Move StrokeRectBatches into .cpp files
BUG=skia:

Review URL: https://codereview.chromium.org/1353683003
2015-09-18 07:12:56 -07:00
mtklein
b1c56ec01e unplumb sknx_no_simd
BUG=skia:

Review URL: https://codereview.chromium.org/1355833002
2015-09-18 06:50:38 -07:00
robertphillips
42bd6bfd0d Remove duplicate GrProcessorUnitTest.cpp from gpu.gypi
This appears to be blocking the roll.

TBR=tomhudson@chromium.org

Review URL: https://codereview.chromium.org/1349683003
2015-09-16 05:42:40 -07:00
bsalomon
ae4738f677 Create fragment processor for performing input color blend with child processor
The new FP is used to implement SkXM::Mode color filters and SkXM::Mode image filters. Also, these now support all advanced SkXM::Mode xfermodes.

Review URL: https://codereview.chromium.org/1334293003
2015-09-15 15:33:27 -07:00
reed
013e9e3bb0 move SkBitmapProvider to its own file
BUG=skia:

Review URL: https://codereview.chromium.org/1346713002
2015-09-15 14:46:27 -07:00
ericrk
0a5fa484fd Add onMemoryDump to GrContext
Adds an entry point to GrContext to allow enumeration and tracing of GPU resources
via the newly added SkTraceMemoryDump.

Plan is for Chrome to call this on each of its GrContexts.

Dumps both the total size of GPU resources, as well as the total purgeable size.

BUG=526261

Review URL: https://codereview.chromium.org/1313743002
2015-09-15 14:16:10 -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
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
bsalomon
506c802a3d Add helper for creating leaf FPs inside GrFP::TestCreate functions
Review URL: https://codereview.chromium.org/1334273003
2015-09-14 13:16:26 -07:00
reed
94cf37f425 remove obsolete samples
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1340793002
2015-09-12 09:55:30 -07:00
joshualitt
102081aba2 move GrGLPathProcessor back into GrPathProcessor
BUG=skia:

Review URL: https://codereview.chromium.org/1333423003
2015-09-11 11:52:17 -07:00
joshualitt
d8dd47b5fa remove path specific program building classes
BUG=skia:

Review URL: https://codereview.chromium.org/1336763003
2015-09-11 11:45:01 -07:00
joshualitt
e7afc2d85b Start trying to collapse path program stuff
BUG=skia:

Review URL: https://codereview.chromium.org/1333273003
2015-09-11 10:44:14 -07:00
reed
85d9178832 Use SkImageCacherator in SkImages
Possible follow-up changes to consider

1. Roll SkImage_Raster and _Gpu into _Generator, where the generator (or cacherator) is backed by a pre-existing texture or raster.
2. Evolve SkImageUsageType into a verb requiring stretching, and have the caller (common code) digest the caps() and usage, so that subclasses are just told what to do (stretch or not)
3. Common code/utility to convert an unstretched texture into a stretch one (and cache it) if the generator can only make an unstretched one.

BUG=skia:

Review URL: https://codereview.chromium.org/1282363002
2015-09-10 14:33:38 -07:00
bsalomon
512be5340c Cleanup GrDrawTarget now that all paths lead to GrBatch
Review URL: https://codereview.chromium.org/1315513008
2015-09-10 10:42:55 -07:00
wangyix
809e5afdd9 Brian requested a new namespace for factories that create fragment processors that combine 2 things with a xfermode. This way, we can change the implementation of these factories in the future to not use GrComposeEffect if desired.
BUG=skia:4182

Review URL: https://codereview.chromium.org/1306163005
2015-09-09 12:58:32 -07:00
mtklein
61a81e3947 Mimic Chrome better in our GYPs.
To match Chrome, make sure we've disabled thread-safe statics, RTTI, and exceptions.  Linux needed -fno-threadsafe-statics, Mac needed all three.

Nothing important triggered this CL.  I just got confused when I saw exception handling (calls to delete, stack unwinding) in some generated code on my laptop.

BUG=skia:

Review URL: https://codereview.chromium.org/1323533003
2015-09-09 10:46:20 -07:00
bsalomon
1fcc01c415 GrPathRangeBatch
BUG=skia:

Review URL: https://codereview.chromium.org/1315563003
2015-09-09 09:48:06 -07:00
msarett
a5783aeff0 Provides various implementations of Android's SkBitmapRegionDecoder.
Implements testing in DM for these implementations.

nanobench testing will follow after this.

TBR=scroggo
BUG=skia:

Committed: https://skia.googlesource.com/skia/+/76f755e6d54a32f9887ad254ce59a3a62f28bde4

Review URL: https://codereview.chromium.org/1288963002
2015-09-08 15:35:32 -07:00
reed
0f0af23889 Revert[2] of "switch to isABitmap, deprecate SK_SUPPORT_LEGACY_SHADERBITMAPTYPE"
master-skia has been updated to use isABitmap

This reverts commit ff390c9bdd.

BUG=skia:

Review URL: https://codereview.chromium.org/1310573008
2015-09-08 11:02:04 -07:00
reed
43fe6185c5 refactor parts of SkGr.cpp for use by SkImages
BUG=skia:

Review URL: https://codereview.chromium.org/1315353006
2015-09-08 08:37:36 -07:00
joshualitt
189aef7834 Create module system for VisualBench
The newly created VisualLightweightBenchModule is just the old VisualBench.cpp, but gutted to only include timing code.

Future CLs will harden this abstraction, but for this CL the module owns a backpointer to VisualBench.cpp for a couple of calls.

BUG=skia:

Review URL: https://codereview.chromium.org/1304083007
2015-09-08 07:08:11 -07:00
msarett
8fd97eab1d Revert of Provides multiple implementations of Android's SkBitmapRegionDecoder (patchset #16 id:360001 of https://codereview.chromium.org/1288963002/ )
Reason for revert:
Breaking Android bots
Bad use of the utils folder

Original issue's description:
> Provides various implementations of Android's SkBitmapRegionDecoder.
>
> Implements testing in DM for these implementations.
>
> nanobench testing will follow after this.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/76f755e6d54a32f9887ad254ce59a3a62f28bde4

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

Review URL: https://codereview.chromium.org/1322773004
2015-09-08 06:59:48 -07:00
msarett
76f755e6d5 Provides various implementations of Android's SkBitmapRegionDecoder.
Implements testing in DM for these implementations.

nanobench testing will follow after this.

BUG=skia:

Review URL: https://codereview.chromium.org/1288963002
2015-09-04 13:00:50 -07:00
reed
f4a6d30044 remove duplicated sample (already have a gm)
BUG=skia:

Review URL: https://codereview.chromium.org/1317693011
2015-09-04 10:03:22 -07:00
reed
1a9cafff04 add interactive xfer sample
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1323223004
2015-09-02 19:05:10 -07:00
joshualitt
0cffb171eb Remove GrAddPathRenderers_default
BUG=skia:

Review URL: https://codereview.chromium.org/1311673014
2015-09-02 08:42:16 -07:00
joshualitt
6335a72976 Move PathRenderers to batches folder
BUG=skia:

Review URL: https://codereview.chromium.org/1306143005
2015-09-01 06:50:55 -07:00
msarett
fbccb5995d Call standard libjpeg/libjpeg-turbo APIs
BUG=skia:

Review URL: https://codereview.chromium.org/1322623004
2015-09-01 06:43:41 -07:00
mtklein
46b42f5304 Add empty files to empty targets to appease XCode.
BUG=skia:4117

Review URL: https://codereview.chromium.org/1312703004
2015-08-31 14:21:08 -07:00
caryclark
5ef194c31a Suppress embedding fonts when the skp's fonts match the OS fonts.
The million SKPs generated require >5T of storage. A good deal
of that are copies of system fonts.

Chrome built with
#DEFINE SK_WHITELIST_SERIALIZED_TYPEFACES
will omit the font data if the font matches a precomputed
checksum.

The captured SKP prepends sk_ to the names of fonts that
have their data omitted. The SKP consumer can either add
renamed fonts from the recording machine, or add

gDeserializeTypefaceDelegate = WhitelistDeserializeTypeface;

which strips the sk_ prefix when deserializing typefaces.

whitelist_typefaces --check
Computes the checksums of fallback
fonts and returns 0 if the checksums match the checked-in
file SkWhitelistChecksum.cpp.

whitelist_typefaces --generate
Writes an updated version of SkWhitelistChecksum.cpp.

(Added Mike since this modifies a public header)

R=bungeman@google.com,rmistry@google.com,reed@google.com

Review URL: https://codereview.chromium.org/1317913005
2015-08-31 09:22:38 -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
msarett
d02b99f106 Interlaced gifs without the iterator
BUG=skia:

Review URL: https://codereview.chromium.org/1315583003
2015-08-28 07:36:55 -07:00
hendrikw
885bf09255 skia: add ability to load command_buffer_gles2
BUG=skia:

Review URL: https://codereview.chromium.org/1306823003
2015-08-27 10:38:39 -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
joshualitt
bcf33d5c06 Rename GrBWFillRectBatch to GrNonAAFillRectBAtch
TBR=bsalomon@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/1319733002
2015-08-26 08:10:35 -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
bungeman
afd7c74972 Remove SK_OFFSETOF from SkTypes, clean up offsetof usage.
The motivation for this was to remove SK_OFFSETOF from SkTypes, but
this CL is mostly about cleaning up our use of offsetof generally.

SK_OFFSETOF is removed to SkTypes and added to the two places it is
actually used (for the non standard behavior of finding the offset of
fields in types which are not standard layout).

Older versions of gcc required POD for offsetof to be used without
warning. Newer versions require the more relaxed standard layout.
Now that we no longer build on older versions of gcc, remove the
old warning suppressions.

PODMatrix is renamed to AggregateMatrix. SkMatrix is already POD
(trivial and standard layout). The PODMatrix name implies that the
POD-ness is needed for the offsetof, but it is actually the aggregate
attribute which is needed for compile time constant initialization.
This makes it more obvious that this can be revisited after we can
rely on constexpr constructors.

This also adds skstd::declval since this allows removal of existing
awkward code which casts a constant to a pointer to find the size of
a field.

TBR=reed@google.com
No API change, only removes unused macro.

Review URL: https://codereview.chromium.org/1309523003
2015-08-25 12:05:55 -07:00
mtklein
85533968a8 Add build targets for advanced Intel instruction sets (1.5 of 3)
This is a follow-up to https://codereview.chromium.org/1290423007/,
with a couple small changes:

   - turn on AVX and AVX2 for Windows using /arch ('EnabledEnhancedInstructionSet')
   - reformat and de-conditionalize where possible / irrelevant

Picked up this while poking around in libvpx's Chrome GYPs.

And yes, AVX = 3, AVX2 = 5.  Don't even ask what 4 means...

BUG=skia:4117

Review URL: https://codereview.chromium.org/1309253002
2015-08-25 06:30:07 -07:00
mtklein
a5114d7f26 Have DM manually encode its .png outputs.
This eliminates some variability on various axes: different PNG encoders, different libpng versions, different formats (RGB, indexed), different unpremultiplication, different sRGB tags.

BUG=skia:

Committed: https://skia.googlesource.com/skia/+/3cc0dfffb70c0bd08ed8899efcd2e98da86a6ec7

CQ_EXTRA_TRYBOTS=client.skia:Test-Win8-MSVC-ShuttleB-CPU-AVX2-x86_64-Debug-Trybot

Review URL: https://codereview.chromium.org/1304443002
2015-08-24 13:27:01 -07:00
msarett
0e6ff3882d Update giflib to 5.1.1 (AOSP hash)
This also disables warnings in giflib and fixes
compile warnings in icu, in order to fix a skia
bug.

BUG=skia:4220

Review URL: https://codereview.chromium.org/1314633002
2015-08-24 12:00:15 -07:00
mtklein
5141d90796 Add build targets for advanced Intel instruction sets (1 of 3).
CL (1 of 3) adds empty lists in our .gypi,
and builds the files in those empty lists with the appropriate flags.

CL (2 of 3) will have Chrome's GYP and GN files read these lists,
and build them with the appropriate flags.

CL (3 of 3) will add runtime detection and stub files to the lists
with empty Init_sse42(), Init_avx(), Init_avx2() methods.

After that, we should be able to use SSE 4.2, AVX, and AVX2 if desired.

Some motivation:
  - SSE 4.2 adds some sweet string-oriented methods that
    can help us write fast high quality 32-bit hashes.
  - AVX is SSE doubled, e.g. 8 floats or two SkPMFloat at a time.
  - AVX2 is SSE2 doubled, e.g. 8 pixels at a time.

BUG=skia:4117

Review URL: https://codereview.chromium.org/1290423007
2015-08-24 10:32:02 -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
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
bsalomon
add79ef7cb Put drawPath in GrBatch.
TODO: Implement path range version of this (and preserve combining consecutive ranges).

Review URL: https://codereview.chromium.org/1301823002
2015-08-19 13:26:49 -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
bungeman
f3c15b7cfc Move SkTemplates.h to private.
SkTemplates.h contains a number of Skia specific utilities which are
not designed for external use. In addition to reducing the external
support burden, this will allow Skia to freely refactor this file.

Review URL: https://codereview.chromium.org/1272293004
2015-08-19 11:56:48 -07:00
reed
f5822825ec change asABitmap to isABitmap on shader
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1287263005
2015-08-19 11:46:38 -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
joshualitt
ae5b2c623b Create GrQuad
BUG=skia:

Review URL: https://codereview.chromium.org/1294713009
2015-08-19 08:48:41 -07:00
reed
451af5062e remove SkDeferredCanvas
Waiting a day or so to see if the blink-removal of SkDeferredCanvas sticks

BUG=skia:

Review URL: https://codereview.chromium.org/1269093002
2015-08-19 08:18:04 -07:00
joshualitt
da04e0e80a Allow setting of GrBatchFontCache atlas sizes
BUG=skia:

Review URL: https://codereview.chromium.org/1255943006
2015-08-19 08:16:43 -07:00
mtklein
8c9a67ae4b Revert of Have DM manually encode its .png outputs. (patchset #2 id:20001 of https://codereview.chromium.org/1304443002/ )
Reason for revert:
derek + Test-Win8-MSVC-ShuttleB-CPU-AVX2-x86_64-Debug

Original issue's description:
> Have DM manually encode its .png outputs.
>
> This eliminates some variability on various axes: different PNG encoders, different libpng versions, different formats (RGB, indexed), different unpremultiplication, different sRGB tags.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/3cc0dfffb70c0bd08ed8899efcd2e98da86a6ec7

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

Review URL: https://codereview.chromium.org/1297383002
2015-08-19 08:11:37 -07:00
mtklein
3cc0dfffb7 Have DM manually encode its .png outputs.
This eliminates some variability on various axes: different PNG encoders, different libpng versions, different formats (RGB, indexed), different unpremultiplication, different sRGB tags.

BUG=skia:

Review URL: https://codereview.chromium.org/1304443002
2015-08-19 07:37:51 -07:00
halcanary
48305e8353 SkPDF/Deflate: clean up old SkFlate code
Factor out some of https://crrev.com/1227913008

BUG=skia:3030

Review URL: https://codereview.chromium.org/1298243002
2015-08-18 13:30:25 -07:00
bsalomon
a44919ea27 Path stenciling in GrBatch
Review URL: https://codereview.chromium.org/1293973003
2015-08-18 13:28:20 -07:00
joshualitt
892b0c3db9 Add skeleton json support to visualbench
BUG=skia:

Review URL: https://codereview.chromium.org/1298213002
2015-08-18 12:13:34 -07:00
bsalomon
872062cab8 GrCopySurfaceBatch
Review URL: https://codereview.chromium.org/1289673004
2015-08-18 12:12:35 -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
joshualitt
2ad37be2b1 Move GrTBatchTesselator to its own file
BUG=skia:

Review URL: https://codereview.chromium.org/1298983002
2015-08-18 10:16:01 -07:00
bsalomon
5346983b2e Put clear and discard into GrBatch.
Review URL: https://codereview.chromium.org/1293563003
2015-08-18 09:20:09 -07:00
mtklein
9483763793 Remove SkOpts_sse2.cpp.
It's sort of pointless: all our clients that will have SSE2 at runtime have it
unconditionally at compile time, so the functions in namespace portable will
pick up the SSE2 code.  The procs in SkOpts_sse2.o were just duplicate code.

A couple of the procs we had in _sse2.cpp can benefit slightly when compiled
with SSSE3.  I've moved those to _ssse3.cpp.  This should lead to small speedups
on platforms like Linux and Windows that have a baseline of SSE2.

Similarly, I've removed the call to Init_neon() when NEON is available globally... it's a no-op.

Renaming namespace portable to something clearer is TBD.

BUG=skia:4117

Review URL: https://codereview.chromium.org/1294213002
2015-08-18 05:18:53 -07:00
reed
95dd17737d Revert[8] "move some public headers into private"
This reverts commit fb28cd2b13.

BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1298833002
2015-08-17 18:29:48 -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
dcbaa8ab6d Revert of Depend on ETC1 via DEPS instead of a direct third_party checkin. (patchset #1 id:1 of https://codereview.chromium.org/1296253003/ )
Reason for revert:
This will make the google3 roll awkward.  Reverting.

Original issue's description:
> Depend on ETC1 via DEPS instead of a direct third_party checkin.
>
> Yes, this does mean we'll check out ~40M of code for 2 files...
>
> I think these trybots are moot... they gclient sync before patching.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/ca01d179347b5e848ded97c8228b79ffc6b5e7bf

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

Review URL: https://codereview.chromium.org/1290913008
2015-08-17 11:15:00 -07:00
Derek Sollenberger
b279668c64 fix typo in android_framework_lib.gyp
BUG=skia:

Review URL: https://codereview.chromium.org/1293183002 .
2015-08-17 13:39:03 -04:00
djsollen
a408260bfa Add GPU to the android include path.
Review URL: https://codereview.chromium.org/1301623002
2015-08-17 10:20:46 -07:00
mtklein
ca01d17934 Depend on ETC1 via DEPS instead of a direct third_party checkin.
Yes, this does mean we'll check out ~40M of code for 2 files...

I think these trybots are moot... they gclient sync before patching.

BUG=skia:

Review URL: https://codereview.chromium.org/1296253003
2015-08-17 10:20:16 -07:00
reed
fb28cd2b13 Revert[7] "move some public headers into private"
This reverts commit e02716908f.

BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1300523002
2015-08-15 08:46:27 -07:00
reed
e02716908f Revert[6] "move some public headers into private"
This reverts commit cc1229c9d5.

BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1295003002
2015-08-15 07:28:34 -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
egdaniel
540e4888a5 Add include paths in gputest.gyp for use by additional gpu tests.
BUG=skia:

Review URL: https://codereview.chromium.org/1290553005
2015-08-14 08:37:50 -07:00
mtklein
820bffb893 Build all GMs on Android.
Many of these were excluded from the build for bots that no longer exist.

Will fix up anything that starts failing using dm_flags.py.

BUG=skia:2326,skia:2313, skia:1978

Review URL: https://codereview.chromium.org/1290943004
2015-08-14 08:33:50 -07:00
emmaleer
8f4ba76742 SkScaledCodec class
This class does scaling by using a scanlineDecoder.
getScanlines and skipScanlines are used for y sampling,
the swizzler is used for x sampling

this class is currently only working for png and jpeg images
I will update other Codec types to work soon

For SkJpegCodec to implement width wise swizzling it now
uses a swizzler. I ran performance tests on this change.
Here are the performance test results:
https://docs.google.com/a/google.com/spreadsheets/d/1D7-Q_GXD_dI68LZO005NNvb8Wq2Ee0wEBEPG72671yw/edit?usp=sharing

BUG=skia:

Committed: https://skia.googlesource.com/skia/+/0944100ac89f797714eeae0cf2875e2335ff52ee

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

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

Review URL: https://codereview.chromium.org/1260673002
2015-08-14 07:44:46 -07:00
egdaniel
b0a32cc38f Revert of SkScaledCodec class (patchset #35 id:680001 of https://codereview.chromium.org/1260673002/ )
Reason for revert:
breaking ubuntu bots

Original issue's description:
> SkScaledCodec class
>
> This class does scaling by using a scanlineDecoder.
> getScanlines and skipScanlines are used for y sampling,
> the swizzler is used for x sampling
>
> this class is currently only working for png and jpeg images
> I will update other Codec types to work soon
>
> For SkJpegCodec to implement width wise swizzling it now
> uses a swizzler. I ran performance tests on this change.
> Here are the performance test results:
> https://docs.google.com/a/google.com/spreadsheets/d/1D7-Q_GXD_dI68LZO005NNvb8Wq2Ee0wEBEPG72671yw/edit?usp=sharing
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/0944100ac89f797714eeae0cf2875e2335ff52ee
>
> Committed: https://skia.googlesource.com/skia/+/d518ea7927f9f4e0ed5b4134d1b4f48243855a47
>
> Committed: https://skia.googlesource.com/skia/+/b157917507d4f7d2651f0aeb566d31603cc02240

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

Review URL: https://codereview.chromium.org/1285173003
2015-08-14 06:37:37 -07:00
emmaleer
b157917507 SkScaledCodec class
This class does scaling by using a scanlineDecoder.
getScanlines and skipScanlines are used for y sampling,
the swizzler is used for x sampling

this class is currently only working for png and jpeg images
I will update other Codec types to work soon

For SkJpegCodec to implement width wise swizzling it now
uses a swizzler. I ran performance tests on this change.
Here are the performance test results:
https://docs.google.com/a/google.com/spreadsheets/d/1D7-Q_GXD_dI68LZO005NNvb8Wq2Ee0wEBEPG72671yw/edit?usp=sharing

BUG=skia:

Committed: https://skia.googlesource.com/skia/+/0944100ac89f797714eeae0cf2875e2335ff52ee

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

Review URL: https://codereview.chromium.org/1260673002
2015-08-14 05:46:09 -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
emmaleer
c7993d747f Revert of SkScaledCodec class (patchset #34 id:660001 of https://codereview.chromium.org/1260673002/ )
Reason for revert:
Seg-faulting:
http://build.chromium.org/p/client.skia/builders/Test-Ubuntu-GCC-GCE-CPU-AVX2-x86-Release/builds/1608/steps/dm/logs/stdio

Original issue's description:
> SkScaledCodec class
>
> This class does scaling by using a scanlineDecoder.
> getScanlines and skipScanlines are used for y sampling,
> the swizzler is used for x sampling
>
> this class is currently only working for png and jpeg images
> I will update other Codec types to work soon
>
> For SkJpegCodec to implement width wise swizzling it now
> uses a swizzler. I ran performance tests on this change.
> Here are the performance test results:
> https://docs.google.com/a/google.com/spreadsheets/d/1D7-Q_GXD_dI68LZO005NNvb8Wq2Ee0wEBEPG72671yw/edit?usp=sharing
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/0944100ac89f797714eeae0cf2875e2335ff52ee
>
> Committed: https://skia.googlesource.com/skia/+/d518ea7927f9f4e0ed5b4134d1b4f48243855a47

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

Review URL: https://codereview.chromium.org/1294613002
2015-08-13 13:59:21 -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
emmaleer
d518ea7927 SkScaledCodec class
This class does scaling by using a scanlineDecoder.
getScanlines and skipScanlines are used for y sampling,
the swizzler is used for x sampling

this class is currently only working for png and jpeg images
I will update other Codec types to work soon

For SkJpegCodec to implement width wise swizzling it now
uses a swizzler. I ran performance tests on this change.
Here are the performance test results:
https://docs.google.com/a/google.com/spreadsheets/d/1D7-Q_GXD_dI68LZO005NNvb8Wq2Ee0wEBEPG72671yw/edit?usp=sharing

BUG=skia:

Committed: https://skia.googlesource.com/skia/+/0944100ac89f797714eeae0cf2875e2335ff52ee

Review URL: https://codereview.chromium.org/1260673002
2015-08-13 13:07:03 -07:00
emmaleer
e5aaa07c35 Revert of SkScaledCodec class (patchset #32 id:620001 of https://codereview.chromium.org/1260673002/ )
Reason for revert:
Segfaulting:
http://build.chromium.org/p/client.skia/builders/Test-Ubuntu-GCC-GCE-CPU-AVX2-x86-Release/builds/1605/steps/dm/logs/stdio

Original issue's description:
> SkScaledCodec class
>
> This class does scaling by using a scanlineDecoder.
> getScanlines and skipScanlines are used for y sampling,
> the swizzler is used for x sampling
>
> this class is currently only working for png and jpeg images
> I will update other Codec types to work soon
>
> For SkJpegCodec to implement width wise swizzling it now
> uses a swizzler. I ran performance tests on this change.
> Here are the performance test results:
> https://docs.google.com/a/google.com/spreadsheets/d/1D7-Q_GXD_dI68LZO005NNvb8Wq2Ee0wEBEPG72671yw/edit?usp=sharing
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/0944100ac89f797714eeae0cf2875e2335ff52ee

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

Review URL: https://codereview.chromium.org/1294593002
2015-08-13 11:44:05 -07:00
emmaleer
0944100ac8 SkScaledCodec class
This class does scaling by using a scanlineDecoder.
getScanlines and skipScanlines are used for y sampling,
the swizzler is used for x sampling

this class is currently only working for png and jpeg images
I will update other Codec types to work soon

For SkJpegCodec to implement width wise swizzling it now
uses a swizzler. I ran performance tests on this change.
Here are the performance test results:
https://docs.google.com/a/google.com/spreadsheets/d/1D7-Q_GXD_dI68LZO005NNvb8Wq2Ee0wEBEPG72671yw/edit?usp=sharing

BUG=skia:

Review URL: https://codereview.chromium.org/1260673002
2015-08-13 11:26:57 -07:00
joshualitt
9c80b5ff59 Move GrRectBatch to GrBWFillRectBatch and make internal
BUG=skia:

Review URL: https://codereview.chromium.org/1294553003
2015-08-13 10:05:51 -07:00
reed
cc1229c9d5 Revert "Revert[4] "move some public headers into private""
This reverts commit 33e00db73d.

BUG=skia:
TBR=
NOTREECHECKS=True

FAILED: /b/build/goma/gomacc ../../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF obj/components/user_manager/user_manager_test_support.fake_user_manager.o.d -DV8_DEPRECATION_WARNINGS -DCLD_VERSION=2 -D_FILE_OFFSET_BITS=64 -DCHROMIUM_BUILD -DCR_CLANG_REVISION=242792-1 -DCOMPONENT_BUILD -DUI_COMPOSITOR_IMAGE_TRANSPORT -DUSE_AURA=1 -DUSE_ASH=1 -DUSE_PANGO=1 -DUSE_CAIRO=1 -DUSE_DEFAULT_RENDER_THEME=1 -DUSE_LIBJPEG_TURBO=1 -DUSE_X11=1 -DIMAGE_LOADER_EXTENSION=1 -DENABLE_WEBRTC=1 -DENABLE_MEDIA_ROUTER=1 -DUSE_PROPRIETARY_CODECS -DENABLE_PEPPER_CDMS -DENABLE_CONFIGURATION_POLICY -DENABLE_NOTIFICATIONS -DENABLE_HIDPI=1 -DENABLE_TOPCHROME_MD=1 -DUSE_UDEV -DDONT_EMBED_BUILD_METADATA -DDCHECK_ALWAYS_ON=1 -DFIELDTRIAL_TESTING_ENABLED -DENABLE_TASK_MANAGER=1 -DENABLE_EXTENSIONS=1 -DENABLE_PLUGINS=1 -DENABLE_SESSION_SERVICE=1 -DENABLE_THEMES=1 -DENABLE_AUTOFILL_DIALOG=1 -DENABLE_BACKGROUND=1 -DENABLE_GOOGLE_NOW=1 -DENABLE_PRINTING=1 -DENABLE_PRINT_PREVIEW=1 -DENABLE_SPELLCHECK=1 -DENABLE_CAPTIVE_PORTAL_DETECTION=1 -DENABLE_APP_LIST=1 -DENABLE_SUPERVISED_USERS=1 -DENABLE_MDNS=1 -DENABLE_SERVICE_DISCOVERY=1 -DV8_USE_EXTERNAL_STARTUP_DATA -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DSAFE_BROWSING_SERVICE -DGTEST_HAS_POSIX_RE=0 -DGTEST_LANG_CXX11=0 -DUNIT_TEST -DGTEST_HAS_RTTI=0 -DUSE_LIBPCI=1 -DUSE_OPENSSL=1 -DUSE_GLIB=1 -DUSE_NSS_CERTS=1 -DOS_CHROMEOS=1 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DWTF_USE_DYNAMIC_ANNOTATIONS=1 -D_DEBUG -D_GLIBCXX_DEBUG=1 -Igen -I../.. -I../../skia/config -I../../testing/gmock/include -I../../testing/gtest/include -Werror -pthread -fno-strict-aliasing -Wall -Wno-unused-parameter -Wno-missing-field-initializers -fvisibility=hidden -pipe -fPIC -Wno-reserved-user-defined-literal -Xclang -load -Xclang /b/build/slave/linux_chromeos/build/src/third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.so -Xclang -add-plugin -Xclang find-bad-constructs -Xclang -plugin-arg-find-bad-constructs -Xclang check-templates -fcolor-diagnostics -B/b/build/slave/linux_chromeos/build/src/third_party/binutils/Linux_x64/Release/bin -Wheader-hygiene -Wno-char-subscripts -Wno-unneeded-internal-declaration -Wno-covered-switch-default -Wstring-conversion -Wno-c++11-narrowing -Wno-deprecated-register -Wno-inconsistent-missing-override -Wno-shift-negative-value -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -m64 -march=x86-64 -O0 -g -funwind-tables -gsplit-dwarf -Wno-undefined-bool-conversion -Wno-tautological-undefined-compare -g0 -fno-exceptions -fno-rtti -fno-threadsafe-statics -fvisibility-inlines-hidden -Wsign-compare -std=gnu++11  -c ../../components/user_manager/fake_user_manager.cc -o obj/components/user_manager/user_manager_test_support.fake_user_manager.o
In file included from ../../components/user_manager/fake_user_manager.cc:5:
In file included from ../../components/user_manager/fake_user_manager.h:12:
In file included from ../../components/user_manager/user.h:14:
In file included from ../../components/user_manager/user_image/user_image.h:12:
In file included from ../../ui/gfx/image/image_skia.h:15:
In file included from ../../ui/gfx/image/image_skia_rep.h:8:
In file included from ../../third_party/skia/include/core/SkBitmap.h:11:
In file included from ../../third_party/skia/include/core/SkColor.h:11:
In file included from ../../third_party/skia/include/core/SkScalar.h:12:
../../third_party/skia/include/core/../private/SkFloatingPoint.h:13:10: fatal error: 'SkTypes.h' file not found
#include "SkTypes.h"

ninja -w dupbuild=err -C /b/build/slave/linux_chromeos/build/src/out/Debug accessibility_unittests accessibility_unittests_run app_list_unittests app_list_unittests_run app_shell_unittests app_shell_unittests_run ash_unittests ash_unittests_run aura_builder aura_unittests aura_unittests_run base_unittests base_unittests_run browser_tests browser_tests_run cacheinvalidation_unittests cacheinvalidation_unittests_run chromeos_unittests chromeos_unittests_run components_unittests components_unittests_run compositor_unittests compositor_unittests_run content_browsertests content_browsertests_run content_unittests content_unittests_run crypto_unittests crypto_unittests_run dbus_unittests device_unittests device_unittests_run display_unittests display_unittests_run events_unittests events_unittests_run extensions_browsertests extensions_browsertests_run extensions_unittests extensions_unittests_run gcm_unit_tests gcm_unit_tests_run gfx_unittests gfx_unittests_run google_apis_unittests google_apis_unittests_run gpu_unittests gpu_unittests_run interactive_ui_tests interactive_ui_tests_run ipc_tests ipc_tests_run jingle_unittests jingle_unittests_run media_unittests media_unittests_run message_center_unittests message_center_unittests_run midi_unittests midi_unittests_run nacl_helper_nonsfi_unittests nacl_loader_unittests nacl_loader_unittests_run net_unittests net_unittests_run ppapi_unittests printing_unittests printing_unittests_run remoting_unittests remoting_unittests_run sandbox_linux_unittests sandbox_linux_unittests_run skia_unittests skia_unittests_run sql_unittests sql_unittests_run sync_unit_tests sync_unit_tests_run ui_base_unittests ui_base_unittests_run ui_chromeos_unittests ui_touch_selection_unittests ui_touch_selection_unittests_run unit_tests unit_tests_run url_unittests url_unittests_run views_unittests wm_unittests wm_unittests_run -j50
ninja: Entering directory `/b/build/slave/linux_chromeos/build/src/out/Debug'

Review URL: https://codereview.chromium.org/1288863002
2015-08-12 18:58:52 -07:00
jvanverth
65bd7ae374 Add gyp support for new GPU backend
Review URL: https://codereview.chromium.org/1287023006
2015-08-12 12:58:13 -07:00
reed
33e00db73d Revert[4] "move some public headers into private"
This reverts commit 9cdcabefa3.

BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1291613007
2015-08-12 12:53:10 -07:00
halcanary
d9e57158eb SkPDF: Move SkFlate into src/pdf (part 1/3) [reland]
Rename to SkDeflate so Chromium builders continue to work

Next, we change remove SkFlate from Chromium build files, then we can delete SkFlate.

Review URL: https://codereview.chromium.org/1285913002
2015-08-12 11:24:40 -07:00
halcanary
cc34c41326 Revert of SkPDF: Move SkFlate into src/pdf (part 1/3) (patchset #1 id:1 of https://codereview.chromium.org/1285913002/ )
Reason for revert:
broke gn ("Duplicate object file")

Original issue's description:
> SkPDF:  Move SkFlate into src/pdf (part 1/3)
>
> Next, we change Chromium build files, then we do the actual move.
>
> Committed: https://skia.googlesource.com/skia/+/e14c1fe04fc72ec9bcf55820b5c65a71d7d0a764

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

Review URL: https://codereview.chromium.org/1289863002
2015-08-12 08:53:04 -07:00
halcanary
e14c1fe04f SkPDF: Move SkFlate into src/pdf (part 1/3)
Next, we change Chromium build files, then we do the actual move.

Review URL: https://codereview.chromium.org/1285913002
2015-08-12 07:39:33 -07:00
egdaniel
4b5472bdb0 Add ability to pass in an optional path to additional unit tests to run.
BUG=skia:

Review URL: https://codereview.chromium.org/1280133004
2015-08-12 06:51:08 -07:00
reed
9cdcabefa3 Revert[3] "move some public headers into private"
This reverts commit 9d20ee57d7.

BUG=skia:
TBR=

failures here: https://codereview.chromium.org/1286103004

Review URL: https://codereview.chromium.org/1290733002
2015-08-12 05:33:12 -07:00
reed
9d20ee57d7 Revert[2] "move some public headers into private"
This reverts commit 4cf9e7e147.

BUG=skia:
TBR=
NOTRY=True

Review URL: https://codereview.chromium.org/1284173002
2015-08-12 04:42:08 -07:00
msarett
3bff4749e4 Hopefully fix ios bots
BUG=skia:

Review URL: https://codereview.chromium.org/1286833002
2015-08-11 14:44:02 -07:00
halcanary
2ccdb636e8 SkPDF: clean up overuse of SK_SUPPORT_PDF
When possible use run-time checks (via SkDocument::CreatePDF)
When PDF is disabled, do not compile tests/PDF*.cpp

Review URL: https://codereview.chromium.org/1278403006
2015-08-11 13:35:12 -07:00
msarett
fcaaadee71 Switching Skia to chromium's libjpeg-turbo
Compile SkJpegCodec and SkImageDecoder_libjpeg with
chromium's libjpeg-turbo.  SkImageDecoder_libjpeg still uses
libjpeg on Android and the Android framework.  SkJpegCodec is
still not compiled on the Android framework.

BUG=skia:

Review URL: https://codereview.chromium.org/1275773004
2015-08-11 13:32:54 -07:00
jvanverth
4d0d81aec2 Add high resolution WallTimer to SampleApp
Gives better than 1 ms results when timing framerate.

Review URL: https://codereview.chromium.org/1288473002
2015-08-11 11:07:07 -07:00
halcanary
8ee06f21a2 SkPDF: allow PDF module to be disabled in DM and SampleApp
To disable PDF:

    GYP_DEFINES='skia_pdf=0' bin/sync-and-gyp
    ninja -C out/Debug dm SampleApp

When disabled, SkDocument::CreatePDF() always returns NULL.

Review URL: https://codereview.chromium.org/1279123007
2015-08-11 10:30:12 -07:00
reed
4cf9e7e147 Revert "move some public headers into private"
This reverts commit eedf0fb204.

BUG=skia:
TBR=
NOTRY=True

Review URL: https://codereview.chromium.org/1270313005
2015-08-11 08:39:18 -07:00
reed
eedf0fb204 move some public headers into private
BUG=skia:

Review URL: https://codereview.chromium.org/1289483002
2015-08-11 07:15:00 -07:00
joshualitt
14205b114a Expand functionality of GrRectBatchFactory with AARects
BUG=skia:

Review URL: https://codereview.chromium.org/1279303002
2015-08-10 11:40:56 -07:00
joshualitt
ecd1a69fbf Create GrRectBatchFactory
BUG=skia:

Review URL: https://codereview.chromium.org/1287433003
2015-08-10 10:08:26 -07:00
joshualitt
9ff6425ce4 move Stroke Rect and AAFill Rect to their own file
BUG=skia:

Review URL: https://codereview.chromium.org/1282723004
2015-08-10 09:03:51 -07:00
scroggo
0df0e43488 Revert of Update libwebp and resume testing scaled webp (patchset #2 id:20001 of https://codereview.chromium.org/1280073002/ )
Reason for revert:
Compile failures, e.g.

http://build.chromium.org/p/client.skia.compile/builders/Build-Ubuntu-GCC-Arm7-Debug-Android_NoNeon/builds/1427/steps/build%20most/logs/stdio

Original issue's description:
> 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.
>
> Fix a warning in config.h
>
> [1] https://code.google.com/p/webp/issues/detail?id=254
>
> BUG=skia:4038
>
> Committed: https://skia.googlesource.com/skia/+/0575d3e6c272744a66ab3281f9871366717df339

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

Review URL: https://codereview.chromium.org/1278173004
2015-08-07 12:53:25 -07:00
scroggo
0575d3e6c2 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.

Fix a warning in config.h

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

BUG=skia:4038

Review URL: https://codereview.chromium.org/1280073002
2015-08-07 12:49:16 -07:00
joshualitt
2771b5617c GrDrawVertices to batches
BUG=skia:

Review URL: https://codereview.chromium.org/1276333004
2015-08-07 12:46:26 -07:00
jvanverth
14b8803b7c Move GrDrawAtlasBatch to separate file
Committed: https://skia.googlesource.com/skia/+/b091c44c33edbad3466601b29d60bc2eaa4453fa

Review URL: https://codereview.chromium.org/1274013003
2015-08-07 12:18:54 -07:00
jvanverth
1694a936f6 Revert of Move GrDrawAtlasBatch to separate file (patchset #1 id:1 of https://codereview.chromium.org/1274013003/ )
Reason for revert:
Build failures

Original issue's description:
> Move GrDrawAtlasBatch to separate file
>
> Committed: https://skia.googlesource.com/skia/+/b091c44c33edbad3466601b29d60bc2eaa4453fa

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

Review URL: https://codereview.chromium.org/1276173003
2015-08-07 11:53:13 -07:00
jvanverth
b091c44c33 Move GrDrawAtlasBatch to separate file
Review URL: https://codereview.chromium.org/1274013003
2015-08-07 11:49:17 -07:00
joshualitt
74417824cd Make folder for batches
BUG=skia:

Review URL: https://codereview.chromium.org/1277233002
2015-08-07 11:42:17 -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
msarett
4ab9d5f1bc Split SkBmpCodec into three separate classes
Will regress behavior on gold on test32bfv4.bmp, where we
will no longer fix transparent decodes.

TODO: Start fixing transparent decodes again, or decide
that we don't want to fix them and remove isTransparent
from SkSwizzler.  I think this may become more clear when I
start implementing the scanline decoder.

BUG=skia:

Review URL: https://codereview.chromium.org/1258863008
2015-08-06 15:34:42 -07:00
scroggo
9ce386a27d Fix color swap for webp 565
When webp decoding to 565, swap the colors so they look right.

BUG=skia:4174

Review URL: https://codereview.chromium.org/1280693003
2015-08-06 11:44:56 -07:00
reed
743087687a remove guard for SrcPtr in drawBitmapRect for android
BUG=skia:
NOTRY=True
TBR=

Review URL: https://codereview.chromium.org/1277963002
2015-08-06 11:25:15 -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
mtklein
b6394746ff Port SkTextureCompression opts to SkOpts
Pretty vanilla translation.  I cleaned up who calls whom a little.
Used to be utils -> opts -> utils, now it's just utils -> opts.

I may follow up with a pass over the NEON code for readability
and to clean up dead code.

This turns on NEON A8->R11EAC conversion for ARMv8.
Unit tests which now hit the NEON code still pass.
I can't find any related bench.

BUG=skia:4117

Review URL: https://codereview.chromium.org/1273103002
2015-08-06 08:17:16 -07:00
robertphillips
d0cf9d831f Remove SK_LEGACY_SKPOINT3_CTORS flag
Cannot land before Blink https://codereview.chromium.org/1274673002/ (Remove reliance on legacy Skia SkPoint3 ctors in FELighting.cpp)

Review URL: https://codereview.chromium.org/1269383003
2015-08-06 07:08:31 -07:00
mtklein
f62833d9c9 Detect MIPS DSP and DSPR2 programattically.
Procedure:

$ platform_tools/android/toolchains/ndk-r10c-mips-darwin_v14/bin/mipsel-linux-android-gcc -dM -E - < /dev/null | sort > vanilla.mips
$ platform_tools/android/toolchains/ndk-r10c-mips-darwin_v14/bin/mipsel-linux-android-gcc -mdsp -dM -E - < /dev/null | sort > dsp.mips
$ platform_tools/android/toolchains/ndk-r10c-mips-darwin_v14/bin/mipsel-linux-android-gcc -mdspr2 -dM -E - < /dev/null | sort > dspr2.mips

$ diff vanilla.mips dsp.mips
239a240,241
> #define __mips_dsp 1
> #define __mips_dsp_rev 1

$ diff vanilla.mips dspr2.mips
239a240,242
> #define __mips_dsp 1
> #define __mips_dsp_rev 2
> #define __mips_dspr2 1

So, defined(__mips_dsp) -> SK_MIPS_HAS_DSP, defined(__mips_dspr2) -> SK_MIPS_HAS_DSPR2.

BUG=skia:

Review URL: https://codereview.chromium.org/1274873002
2015-08-05 14:17:32 -07:00
oysteine
dfcba473b0 Moved common cross-project functionality out from SkTraceEvent.h into SkTraceEventCommon.h
Traditionally, SkTraceEvent.h was manually kept in sync with base/trace_event/trace_event.h, with project-specific parts intermixed, and tended to drift out of sync a lot (mainly in Blink, less so in Skia).

The SkTraceEventCommon.h now has only the cross-project parts, and can be copy-pasted verbatim between projects (it's an identical copy of base/trace_event/trace_event_common.h), meaning SkTraceEvent.h shouldn't go out of sync as it has before.

BUG=skia:

[mtklein mucking around below here]
NOPRESUBMIT=true
CQ_EXCLUDE_TRYBOTS=client.skia.fyi:skia_presubmit-Trybot

Review URL: https://codereview.chromium.org/1270783002
2015-08-05 12:54:40 -07:00
bsalomon
ee14a622b0 Give strokerectbatch a proper home
Review URL: https://codereview.chromium.org/1274763002
2015-08-05 10:34:05 -07:00
mtklein
6c17ca5905 Update yasm .gyp for tweaked ASAN bots.
They're not passing -fsanitize=address anymore, rather
-fsanitize=address,bool,etc,etc,etc...

NOTREECHECKS=true

BUG=skia:

Review URL: https://codereview.chromium.org/1269383002
2015-08-05 08:58:45 -07:00
mtklein
d029ded92d Port morphology to SkOpts.
Nothing too fancy.

Direction enums become enum classes so they don't get all confused.  An
alternative is to create one single Direction enum that both blur and
morphology opts use.

BUG=skia:4117

Review URL: https://codereview.chromium.org/1267343004
2015-08-04 14:09:09 -07:00
halcanary
9f8754f591 Remove experimental/PdfViewer
Motivation: maintaining this code doesn't seem worth the time,
since no one seems to be using it.  If someone wants to use it
in the future, just revert this CL.

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

Review URL: https://codereview.chromium.org/1240093004
2015-08-04 13:53:14 -07:00
scroggo
1c005e4a38 Create a scanline decoder without creating a codec
Prior to this CL, if a client wanted to decode scanlines, they had to
create an SkCodec in order to get an SkScanlineDecoder. This introduces
complications if input data is not easily shared between the two
objects.

Instead, add methods to SkScanlineDecoder for creating a new one from
input data, and remove the creation functions from SkCodec.

Update DM and tests.

Review URL: https://codereview.chromium.org/1267583002
2015-08-04 09:24:45 -07:00
mtklein
dce5ce4276 Port SkBlurImage opts to SkOpts.
+268 -535 lines

I also rearranged the code a little bit to encapsulate itself better,
mostly replacing static helper functions with lambdas.  This also
let me merge the SSE2 and SSE4.1 code paths.

BUG=skia:4117

Review URL: https://codereview.chromium.org/1264103004
2015-08-04 08:49:21 -07:00
robertphillips
fae010266f Remove IGNORE_ROT_AA_RECT_OPT flag
It looks like the positive version was added (SHADER_AA_FILL_RECT) but the negative version wasn't removed.

Review URL: https://codereview.chromium.org/1271903003
2015-08-04 08:04:29 -07:00
reed
e00368018d remove flags that control no code
BUG=skia:

Review URL: https://codereview.chromium.org/1259653004
2015-08-03 14:44:32 -07:00
reed
4dea94f621 remove getdevice guard for android
BUG=skia:
NOTRY=True

Review URL: https://codereview.chromium.org/1266363002
2015-08-03 11:45:34 -07:00
reed
c2e6827952 remove now-dead flags
BUG=skia:

Review URL: https://codereview.chromium.org/1258963005
2015-08-01 07:03:20 -07:00
mtklein
490b61569d Port SkXfermode opts to SkOpts.h
Renames Sk4pxXfermode.h to SkXfermode_opts.h,
and refactors it a tiny bit internally.

This moves xfermode optimization from being "compile-time everywhere but NEON"
to simply "runtime everywhere".  I don't anticipate any effect on perf or
correctness.

BUG=skia:4117

Review URL: https://codereview.chromium.org/1264543006
2015-07-31 11:50:27 -07:00
mtklein
7eb0945af2 Port SkUtils opts to SkOpts.
With this new arrangement, the benefits of inlining sk_memset16/32 have changed.

On x86, they're not significantly different, except for small N<=10 where the inlined code is significantly slower.
On ARMv7 with NEON, our custom code is still significantly faster for N>10 (up to 2x faster).  For small N<=10 inlining is still significantly faster.
On ARMv7 without NEON, our custom code is still ridiculously faster (up to 10x) than inlining for N>10, though for small N<=10 inlining is still a little faster.

We were not using the NEON memset16 and memset32 procs on ARMv8.  At first blush, that seems to be an oversight, but if so it's an extremely lucky one.  The ARMv8 code generation for our memset16/32 procs is total garbage, leaving those methods ~8x slower than just inlining the memset, using the compiler's autovectorization.

So, no need to inline any more on x86, and still inline for N<=10 on ARMv7.  Always inline for ARMv8.

BUG=skia:4117

Review URL: https://codereview.chromium.org/1270573002
2015-07-31 10:46:50 -07:00
reed
96a52c8c64 remove drawimagerect flags, as skia no longer respects them
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1262333006
2015-07-31 08:49:11 -07:00
msarett
b46e5e2033 Rename SkCodec_libbmp to SkBmpCodec
BUG=skia:

Review URL: https://codereview.chromium.org/1254963006
2015-07-30 11:36:40 -07:00
mtklein
8317a1832f Lay groundwork for SkOpts.
This doesn't really do anything yet.  It's just the CPU detection code, skeleton new .cpp files, and a few little .gyp tweaks.

BUG=skia:4117

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

Review URL: https://codereview.chromium.org/1255193002
2015-07-30 07:30:16 -07:00
bungeman
3ac6b7551d Remove SK_BUILD_FOR SDL, BREW, and PALM.
SDL isn't an OS anyway, it's just a library views can use. Remaining
support for Brew was removed some time ago, and there are currently
no uses of SK_BUILD_FOR_PALM.

Review URL: https://codereview.chromium.org/1268573002
2015-07-29 13:37:27 -07:00
mtklein
e88b1fb7a5 Move non-trivial constructors out-of-line.
There is more than one way to skin this SkPathPriv.h cat.

These constructors are large enough that they probably shouldn't have
been inlined like this anyway.

BUG=skia:4126

Review URL: https://codereview.chromium.org/1253963004
2015-07-29 13:14:05 -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
joshualitt
aa2f65818d Adding debug SkScalerContext which returns random mask formats
TBR=reed@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/1260473004
2015-07-29 10:14:58 -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
joshualitt
b542bae1f5 Rename GrInOrderDrawBuffer to GrBufferedDrawTarget
BUG=skia:

Review URL: https://codereview.chromium.org/1261033002
2015-07-28 09:58:39 -07:00
mtklein
fd8ed69447 Move SkTHash.h to include/private.
include/views/SkOSWindow_Win.h includes it.

To move SkTHash.h to include/private, SkChecksum.h needs to go there too.  To move SkChecksum.h to include/private, SkTLogic needs to go there too.

This adds a bunch of -Iinclude/private to tools.gyp I missed in the last CL.

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

BUG=skia:4126

Review URL: https://codereview.chromium.org/1260613006
2015-07-28 09:54:52 -07:00
mtklein
cd1f2daf44 add -Iinclude/private anywhere we have -Isrc/core
I'll be moving headers from src/core to include/private, so this guarantees
that anyone who was finding them via -Isrc/core can now find them via
-Iinclude/private.

This is purely mechanical, mostly to preserve my sanity, so it's likely
(harmless) overkill.

Chromium's GYP and GN builds already set -Iinclude/private for Skia builds.

BUG=skia:4126

Review URL: https://codereview.chromium.org/1265443002
2015-07-28 08:55:14 -07:00
mtklein
56b78a7a2a Revert of Lay groundwork for SkOpts. (patchset #3 id:40001 of https://codereview.chromium.org/1255193002/)
Reason for revert:
Chromium doesn't call SkGraphics::Init().  This setup won't work.

Original issue's description:
> Lay groundwork for SkOpts.
>
> This doesn't really do anything yet.  It's just the CPU detection code, skeleton new .cpp files, and a few little .gyp tweaks.
>
> BUG=skia:4117
>
> Committed: https://skia.googlesource.com/skia/+/ce2c5055cee5d5d3c9fc84c1b3eeed4b4d84a827

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

Review URL: https://codereview.chromium.org/1261743002
2015-07-27 12:03:23 -07:00
mtklein
ce2c5055ce Lay groundwork for SkOpts.
This doesn't really do anything yet.  It's just the CPU detection code, skeleton new .cpp files, and a few little .gyp tweaks.

BUG=skia:4117

Review URL: https://codereview.chromium.org/1255193002
2015-07-27 10:52:33 -07:00
Brian Salomon
4239fc2f69 Remove skia_arch_width, fold into skia_arch_type.
DOCS_PREVIEW= https://skia.org/?cl=1228553010

BUG=skia:4042
R=borenet@google.com, mtklein@google.com

Review URL: https://codereview.chromium.org/1228553010
2015-07-27 09:10:36 -04:00
wangyix
cef14bf9ce Added GrGLBlend.h|cpp with helper function AppendPorterDuffBlend() in preparation for SkComposeShader gpu backend
BUG=skia:

Review URL: https://codereview.chromium.org/1254833003
2015-07-24 13:48:26 -07:00
msarett
a56884c17f Fix Android x86 compile on mac
It appears I failed to fully disable it on the first attempt.

BUG=skia:

Review URL: https://codereview.chromium.org/1249083004
2015-07-23 11:57:13 -07:00
borenet
243406e580 Add skia_use_android_framework_defines GYP_DEFINE
BUG=skia:4082

Review URL: https://codereview.chromium.org/1243383002
2015-07-22 13:29:25 -07:00
msarett
551369163f Fix Android framework build
The Android framework was failing on conditions in
libjpeg-turbo.gyp, even though libjpeg-turbo is listed
in dependencies! for the framework (maybe because I
forgot to add export_dependent_settings!).  This is fixed
by rearranging the gyp file.

BUG=skia:

Review URL: https://codereview.chromium.org/1249003002
2015-07-22 09:08:28 -07:00
hendrikw
10b371c6e3 ANGLE deps roll
If we ever want to allow the command buffer as a skia gles2 backend,
we need a more up to date version of ANGLE, specifically there are
4 defines that differ between newer and older versions of ANGLE which
we use in skia, I've updated these in this change.

I'm not quite sure if what I've done for the 'angle_path' is correct,
I tried setting it to a path relative to skia, and to '<(DEPTH)', both
of which do not compile correctly, only '../' worked.

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

Review URL: https://codereview.chromium.org/1244843003
2015-07-21 14:50:08 -07:00
bungeman
b7069e9c1f Compile with VS2015.
Visual Studio 2015 has additional warnings around noexcept and
disabling exceptions, which can be worked around with the
(undocumented) _HAS_EXCEPTIONS macro.

Visual Studio 2013 and 2015 have roundf in math.h, so use it to
avoid extra work and casts.

We avoid using cmath, as it undefs isfinite on gcc, but Visual Studio
2015 no longer provides overloads of copysign from math.h (which is
actually correct). As a result, use copysignf (which is available in
math.h in 2013 and 2015) directly.

Review URL: https://codereview.chromium.org/1244173005
2015-07-21 14:14:30 -07:00
hendrikw
cd94d7341f Revert of skia: ANGLE deps roll (patchset #1 id:1 of https://codereview.chromium.org/1244843003/)
Reason for revert:
Compile error that the try bots didn't catch :(

Original issue's description:
> ANGLE deps roll
>
> If we ever want to allow the command buffer as a skia gles2 backend,
> we need a more up to date version of ANGLE, specifically there are
> 4 defines that differ between newer and older versions of ANGLE which
> we use in skia, I've updated these in this change.
>
> I'm not quite sure if what I've done for the 'angle_path' is correct,
> I tried setting it to a path relative to skia, and to '<(DEPTH)', both
> of which do not compile correctly, only '../' worked.
>
> Committed: https://skia.googlesource.com/skia/+/db0b1e796ddbd08e6be8a666537318b1c0e2ce56

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

Review URL: https://codereview.chromium.org/1245223007
2015-07-21 14:06:10 -07:00
hendrikw
db0b1e796d ANGLE deps roll
If we ever want to allow the command buffer as a skia gles2 backend,
we need a more up to date version of ANGLE, specifically there are
4 defines that differ between newer and older versions of ANGLE which
we use in skia, I've updated these in this change.

I'm not quite sure if what I've done for the 'angle_path' is correct,
I tried setting it to a path relative to skia, and to '<(DEPTH)', both
of which do not compile correctly, only '../' worked.

Review URL: https://codereview.chromium.org/1244843003
2015-07-21 13:18:27 -07:00
msarett
cf2a6a47e4 Reenable yasm for Android x86 and x86-64 on Linux host
It turns out that gyp (kind of) has support for cross
compiling with a different host and target.  We simply
need to specify CC_host and CC_target instead of CC.

Making this change allows us to compile yasm on a Linux
host for Android.

We run into problems on Mac because
the linker on a Mac host requires different command line
arguments than the linker on the Android target.  In
looking through the code for gyp itself and speaking to
Ben, it doesn't appear to me that gyp supports passing
different arguments to host and target linkers.

I would imagine that we would have similar problems on
Windows.

Below is a link to a CL that would fix this issue in gyp.
It looks like it has been dropped for a long time.
Thanks to Ben for this link!
https://chromiumcodereview.appspot.com/10795044/

Also I'm adding a link to the build instructions for Chrome
(thanks again Ben).  It looks like they only support
building for Android from Linux.
https://code.google.com/p/chromium/wiki/AndroidBuildInstructions

My next steps are:
1) Getting in touch with Torne or someone else with gyp to
see if people are aware of this issue or interested in
fixing it.
2) Deciding if skia should care about this issue.
3) Deciding if skia should work around this issue.

It'd be really great to hear your thoughts on (2) and (3).
My first thought is that we shouldn't care because, as
long as we always compile the production copy of skia for
Android on Linux, we will get the fast code.  Is this
a valid conclusion?  Is there a way to write Android apps
on Mac that accidentally use the slower code?

If we do care, there are workarounds:
For Mac, we can check in a yasm binary - it's a little
smaller than the one I am deleting in this CL :-/
For Windows, we *might* be able to use the yasm.exe binary
already in externals (we get this from DEPS because this is
how chromium uses yasm on Windows).
Are there other platforms that we care about?

Let me know what you think!

BUG=skia:4028
DOCS_PREVIEW= https://skia.org/?cl=1239333002

Review URL: https://codereview.chromium.org/1239333002
2015-07-21 12:01:48 -07:00
joshualitt
259fbf1916 Add sanity check to GrAtlasTextBlob
BUG=skia:

Review URL: https://codereview.chromium.org/1250693002
2015-07-21 11:39:35 -07:00
joshualitt
374b2f7cea rename BitmapTextBlob and move it to its own file
BUG=skia:

Review URL: https://codereview.chromium.org/1249663002
2015-07-21 08:05:03 -07:00
mtklein
54f313ccb8 Clean up dead xfermode opts code.
Now that SK_SUPPORT_LEGACY_XFERMODES is unused, tons of code becomes dead.

Nothing is needed in opts/ anymore for x86.
We still do runtime NEON detection, which just duplicates Sk4pxXfermode.

TBR=reed@google.com

BUG=skia:

Review URL: https://codereview.chromium.org/1230023011
2015-07-20 07:14:19 -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
joshualitt
9ec0d4342d Removing GrTemplates.h
BUG=skia:

Review URL: https://codereview.chromium.org/1233923004
2015-07-17 06:40:29 -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
reed
6fb0b6779e guard to remove DrawBitmapRectFlags
BUG=skia:

Review URL: https://codereview.chromium.org/1235393003
2015-07-16 06:10:02 -07:00