Commit Graph

2612 Commits

Author SHA1 Message Date
bsalomon
bed83a66f5 Don't draw if SkShader::asNewFragmentProcessor fails.
BUG=chromium:473156

Review URL: https://codereview.chromium.org/1089063002
2015-04-15 14:18:34 -07:00
msarett
e16b04aa60 SkJpegCodec
Enables basic decoding for jpegs

Includes rewinding

565, YUV, and Jpeg encoding are not yet implemented

BUG=skia:3257

Review URL: https://codereview.chromium.org/1076923002
2015-04-15 07:32:20 -07:00
joshualitt
9e36c1a930 Start canonicalizing color for all A8 textblobs
BUG=skia:

Review URL: https://codereview.chromium.org/1076593002
2015-04-14 12:17:27 -07:00
robertphillips
f5ac972207 Add GM to exercise high quality anisotropic scaling
High quality anisotropic is an interesting edge case for the gpu backend. For scales that are both minimizing and maximizing Ganesh falls back to MipMaps which can turn out too blurry.

BUG=472864

Review URL: https://codereview.chromium.org/1058133003
2015-04-14 08:19:01 -07:00
halcanary
86e5ab6338 GM: add fadefilter gm
BUG=470083

Review URL: https://codereview.chromium.org/1081173002
2015-04-14 06:25:19 -07:00
reed
51985e3f5e setDrawFilter needs to trigger any deferred saves
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1077353002
2015-04-11 08:04:56 -07:00
mtklein
c5e0891029 Replace NEON assembly memset16 and memset32 with intrinsic versions.
According to bench/MemsetBench.cpp, I've got them somewhere between 10% slower
and a percent or two faster than the old assembly.

BUG=skia:

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

Review URL: https://codereview.chromium.org/1075003002
2015-04-10 06:24:58 -07:00
joshualitt
d0b5c33fda Adding draw looper gm for textblobs
BUG=skia:

Review URL: https://codereview.chromium.org/1067853002
2015-04-10 06:17:26 -07:00
msarett
438b2adefb ***Disables swizzles to 565.
We may want to enable swizzles to 565
for images that are encoded in a format
similar to 565, however, we do not want
to take images that decode naturally to
kN32 and then convert them to 565.

***Enable swizzles to kIndex_8.  For images
encoded in a color table format, we suggest
that they be decoded to kIndex_8.  When we
decode, we only allow conversion to kIndex_8
if it matches the suggested color type (except
wbmp which seems good as is).

***Modify dm to test images that decode to
kIndex_8.

BUG=skia:3257
BUG=skia:3440

Review URL: https://codereview.chromium.org/1055743003
2015-04-09 12:43:10 -07:00
mtklein
a67572ff91 Remove ARM assembly memsets.
Step 1 of a zillion in the quest for NEON on iOS,
and step 1 of a different zillion in the Great Assembly Purge.

ios, arm, arm64, arm_v7, arm_v7_neon all build.

BUG=skia:

Review URL: https://codereview.chromium.org/1072063002
2015-04-09 09:16:28 -07:00
jvanverth
8ed3b9a386 Rename DistanceFieldTextureEffect.{cpp,h}
BUG=skia:

Review URL: https://codereview.chromium.org/1073473005
2015-04-09 08:00:49 -07:00
robertphillips
e275fdf812 Add GM to repro crbug.com/472795
This CL also adds a new parameter to SkBitmapSource which gives the user control of the filter quality.

BUG=472795

Review URL: https://codereview.chromium.org/1072603002
2015-04-09 06:47:12 -07:00
joshualitt
b7133bed55 Adding a cache + memory pool for GPU TextBlobs
BUG=skia:

Review URL: https://codereview.chromium.org/1055843002
2015-04-08 09:08:31 -07:00
joshualitt
f1f8895cbe add realloc method to SkAutoSTMalloc
BUG=skia:

Review URL: https://codereview.chromium.org/1069013002
2015-04-08 07:33:33 -07:00
mtklein
649e045170 Add a bench to measure SkPictureRecorder constant overhead.
BUG=chromium:470553

Review URL: https://codereview.chromium.org/1061633002
2015-04-03 13:25:13 -07:00
djsollen
b2a6fe7976 Enable both static and dynamically linked libpng
All platforms except android are configured to use the statically linked copy
of libpng. Android uses the system provided dynamic copy for SkImageDecoder
and the static copy for SkCodec. The exception being android framework builds
that currently use the dynamic copy everywhere.

This CL also enables NEON optimizations for libpng.

Review URL: https://codereview.chromium.org/1058823002
2015-04-03 12:35:27 -07:00
mtklein
ac813d8a12 Try ARMv7 and NEON for Daisy.
I think Daisy's color order problems are in non-NEON ARM assembly.
NEON might actually be fine.

BUG=skia:1843

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

CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Ubuntu-GCC-Arm7-Debug-CrOS_Daisy-Trybot,Build-Ubuntu-GCC-Arm7-Debug-Android_Neon-Trybot,Build-Ubuntu-GCC-Arm7-Debug-Android-Trybot,Build-Ubuntu-GCC-Arm64-Debug-Android-Trybot

Review URL: https://codereview.chromium.org/1054233002
2015-04-03 08:27:37 -07:00
joshualitt
eef5b3eb12 BUG=skia:
Review URL: https://codereview.chromium.org/1031423002
2015-04-03 08:07:26 -07:00
borenet
4808757d7a Remove all code related to NaCl
BUG=skia:3600
DOCS_PREVIEW= https://skia.org/?cl=1036283002

Review URL: https://codereview.chromium.org/1036283002
2015-04-02 12:16:36 -07:00
bsalomon
c9c3e62b4e Add constant color GrFP.
Committed: https://skia.googlesource.com/skia/+/dfbbec436cbcacc3270d4b28357c8393e67d6494

Review URL: https://codereview.chromium.org/978713002
2015-04-02 11:12:09 -07:00
mtklein
2d33a1d0b0 Streamline Thumb config.
Enable Thumb2 iff ARM v7.  (We don't turn it on today for ARM <v7, and ARM v8 doesn't support it.)

BUG=skia:

Review URL: https://codereview.chromium.org/1054993002
2015-04-02 10:47:57 -07:00
bsalomon
599ea40cec Revert of Add constant color GrFP. (patchset #10 id:180001 of https://codereview.chromium.org/978713002/)
Reason for revert:
Revert while investigating assertions.

Original issue's description:
> Add constant color GrFP.
>
> Committed: https://skia.googlesource.com/skia/+/dfbbec436cbcacc3270d4b28357c8393e67d6494

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

Review URL: https://codereview.chromium.org/1055023002
2015-04-02 08:33:54 -07:00
bsalomon
dfbbec436c Add constant color GrFP.
Review URL: https://codereview.chromium.org/978713002
2015-04-01 14:54:57 -07:00
joshualitt
1d89e8d1a4 move Atlas Text Context to its own file
BUG=skia:

Review URL: https://codereview.chromium.org/1045723010
2015-04-01 12:40:54 -07:00
scroggo
60869a42a1 Add timing SkCodec to nanobench.
CodecBench:
Add new class for timing using SkCodec.

DecodingBench:
Include creating a decoder inside the loop. This is to have a better
comparison against SkCodec. SkCodec's factory function does not
necessarily read the same amount as SkImageDecoder's, so in order to
have a meaningful comparison, read the entire stream from the
beginning. Also for comparison, create a new SkStream from the
SkData each time.
Add a debugging check to make sure we have an SkImageDecoder.
Add include guards.

nanobench.cpp:
Decode using SkCodec.
When decoding using SkImageDecoder, exclude benches where we decoded
to a different color type than requested. SkImageDecoder may decide to
decode to a different type, in which case the name is misleading.

TODOs:
Now that we ignore color types that do not match the desired
color type, we should add Index8. This also means calling the more
complex version of getPixels so CodecBench can support kIndex8.

BUG=skia:3257

Review URL: https://codereview.chromium.org/1044363002
2015-04-01 12:09:17 -07:00
djsollen
1865900525 Revert of Enable both static and dynamically linked libpng (patchset #4 id:60001 of https://codereview.chromium.org/1032253003/)
Reason for revert:
breaking the nexus_9 and ios builds.

Original issue's description:
> Enable both static and dynamically linked libpng
>
> All platforms except android are configured to use the statically linked copy of libpng.  Android uses the system provided dynamic copy for SkImageDecoder and the static copy for SkCodec. The exception being android framework builds that currently use the dynamic copy everywhere.
>
> This CL also enables NEON optimizations for libpng.
>
> Committed: https://skia.googlesource.com/skia/+/2469c999518e7b0063d35e9e2eb074a0477c21ac

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

Review URL: https://codereview.chromium.org/1050183002
2015-04-01 11:20:12 -07:00
djsollen
2469c99951 Enable both static and dynamically linked libpng
All platforms except android are configured to use the statically linked copy of libpng.  Android uses the system provided dynamic copy for SkImageDecoder and the static copy for SkCodec. The exception being android framework builds that currently use the dynamic copy everywhere.

This CL also enables NEON optimizations for libpng.

Review URL: https://codereview.chromium.org/1032253003
2015-04-01 10:33:55 -07:00
msarett
8c8f22a3bb Creating a new wrapper for gif decoder
BUG=skia:3257
BUG=skia:3534

Review URL: https://codereview.chromium.org/1022673011
2015-04-01 06:58:48 -07:00
mtklein
4a9426f0fa Sketch SkFunction
Let's start with baby steps in case some bot can't handle this.
I have left many TODOs, most of which I know how to do if this
looks feasible and useful.

BUG=skia:

Review URL: https://codereview.chromium.org/1049223003
2015-03-31 14:24:27 -07:00
joshualitt
7c3a2f834e BitmapTextBatch and BitmapTextBlob
BUG=skia:

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

Review URL: https://codereview.chromium.org/1011403004
2015-03-31 13:32:05 -07:00
halcanary
37c46cad21 SkPDF: Factor SkPDFCatalog into SkPDFObjNumMap and SkPDFSubstituteMap
Motivation: Keep separate features separate.  Also, future
linearization work will need to have several objNumMap
objects share a substituteMap.  Also "catalog" has a
specific meaning in PDF.  This catalog did not map to that
catalog.

-   Modify SkPDFObject::emitObject and SkPDFObject::addResources
    interface to requiore SkPDFObjNumMap and SkPDFSubstituteMap.
-   SkPDFObjNumMap const in SkPDFObject::emitObject.
-   Remove SkPDFCatalog.cpp/.h
-   Modify SkDocument_PDF.cpp to use new functions
-   Fold in SkPDFStream::populate
-   Fold in SkPDFBitmap::emitDict
-   Move SkPDFObjNumMap and SkPDFSubstituteMap to SkPDFTypes.h
-   Note (via assert) that SkPDFArray & SkPDFDict don't need to
    check substitutes.
-   Remove extra space from SkPDFDict serialization.
-   SkPDFBitmap SkPDFType0Font SkPDFGraphicState SkPDFStream
    updated to new interface.
-   PDFPrimitivesTest updated for new interface.

BUG=skia:3585

Review URL: https://codereview.chromium.org/1049753002
2015-03-31 12:30:20 -07:00
joshualitt
c03391e792 Revert of BitmapTextBatch and BitmapTextBlob (patchset #18 id:360001 of https://codereview.chromium.org/1011403004/)
Reason for revert:
Breaks a unit test on mac

Original issue's description:
> BitmapTextBatch and BitmapTextBlob
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/eed1dae04932483579b02c10f0706127d3f5d984

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

Review URL: https://codereview.chromium.org/1050633002
2015-03-31 11:33:08 -07:00
joshualitt
eed1dae049 BitmapTextBatch and BitmapTextBlob
BUG=skia:

Review URL: https://codereview.chromium.org/1011403004
2015-03-31 11:04:53 -07:00
bungeman
5c9fa2844c Add option to embed font data into executable.
Some tools would like to be built with all resources embedded.
This change makes it possible to build a font manager which
uses font data embedded into the executable.

Review URL: https://codereview.chromium.org/1015723004
2015-03-30 12:53:48 -07:00
msarett
9b3edef75d Silence giflib warning on mac
BUG=skia:3601

Review URL: https://codereview.chromium.org/1046923004
2015-03-30 11:59:36 -07:00
mtklein
c9adb05b64 Refactor Sk2x<T> + Sk4x<T> into SkNf<N,T> and SkNi<N,T>
The primary feature this delivers is SkNf and SkNd for arbitrary power-of-two N.  Non-specialized types or types larger than 128 bits should now Just Work (and we can drop in a specialization to make them faster).  Sk4s is now just a typedef for SkNf<4, SkScalar>; Sk4d is SkNf<4, double>, Sk2f SkNf<2, float>, etc.

This also makes implementing new specializations easier and more encapsulated.  We're now using template specialization, which means the specialized versions don't have to leak out so much from SkNx_sse.h  and SkNx_neon.h.

This design leaves us room to grow up, e.g to SkNf<8, SkScalar> == Sk8s, and to grown down too, to things like SkNi<8, uint16_t> == Sk8h.

To simplify things, I've stripped away most APIs (swizzles, casts, reinterpret_casts) that no one's using yet.  I will happily add them back if they seem useful.

You shouldn't feel bad about using any of the typedef Sk4s, Sk4f, Sk4d, Sk2s, Sk2f, Sk2d, Sk4i, etc.  Here's how you should feel:
  - Sk4f, Sk4s, Sk2d: feel awesome
  - Sk2f, Sk2s, Sk4d: feel pretty good

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

BUG=skia:3592

Review URL: https://codereview.chromium.org/1048593002
2015-03-30 10:50:27 -07:00
msarett
6d0e7b2031 WIP: Added support for giflib, updated jpeg and png
BUG=skia:3257

Committed: https://skia.googlesource.com/skia/+/255dcd11992ebe74eb54202c48cf5394d33a8ce6

Review URL: https://codereview.chromium.org/1038863003
2015-03-30 07:52:52 -07:00
borenet
00c95098c3 Revert of WIP: Added support for giflib, updated jpeg and png (patchset #8 id:260001 of https://codereview.chromium.org/1038863003/)
Reason for revert:
Trying out revert to see if it fixes Android bots.

Original issue's description:
> WIP: Added support for giflib, updated jpeg and png
>
> BUG=skia:3257
>
> Committed: https://skia.googlesource.com/skia/+/255dcd11992ebe74eb54202c48cf5394d33a8ce6

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

Review URL: https://codereview.chromium.org/1048713003
2015-03-30 05:51:49 -07:00
tomhudson
573ae01295 Move HWUI boilerplate into utils/android
Duplicate code from the HWUI backends for DM and nanobench
moves into a single place, saving a hundred lines or more of
cut-and-paste.

There's some indication that this increases the incidence of
SkCanvas "Unable to find device for layer." warnings, but no
clear degradation in test results.

R=djsollen@google.com,mtklein@google.com
BUG=skia:3589

Review URL: https://codereview.chromium.org/1036303002
2015-03-27 12:22:01 -07:00
msarett
255dcd1199 WIP: Added support for giflib, updated jpeg and png
BUG=skia:3257

Review URL: https://codereview.chromium.org/1038863003
2015-03-27 12:17:00 -07:00
halcanary
a096d7a6d0 SkCodec: add wbmp class
Review URL: https://codereview.chromium.org/1006583005
2015-03-27 12:16:53 -07:00
reed
a644116c33 Revert of Make the canvas draw looper setup update the canvas save count (patchset #1 id:1 of https://codereview.chromium.org/1034033004/)
Reason for revert:
makes internalSave and internalSaveLayer inconsistent. Need to find a different solution.

Original issue's description:
> Make the canvas draw looper setup update the canvas save count
>
> Image filter in a paint would leave save count in wrong state
> for normal draws. This could be observed through the canvas
> references during the draw call. An example of this is
> inspecting the canvas during a draw looper.
>
> patch from issue 993863002 at patchset 20001 (http://crrev.com/993863002#ps20001)
>
> BUG=skia:
> TBR=kkinnunen@nvidia.com
>
> Committed: https://skia.googlesource.com/skia/+/fd3a91e1fc4de69611b5297f624a1cd65db4ced1

TBR=kkinnunen@nvidia.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1037653004
2015-03-26 13:40:09 -07:00
reed
fd3a91e1fc Make the canvas draw looper setup update the canvas save count
Image filter in a paint would leave save count in wrong state
for normal draws. This could be observed through the canvas
references during the draw call. An example of this is
inspecting the canvas during a draw looper.

patch from issue 993863002 at patchset 20001 (http://crrev.com/993863002#ps20001)

BUG=skia:
TBR=kkinnunen@nvidia.com

Review URL: https://codereview.chromium.org/1034033004
2015-03-26 13:29:56 -07:00
tomhudson
d968a6f29e Android HWUI backend Nanobench
Uses filtering canvas from utils/android, shared with DM.
Follow-up plans in https://skbug.com/3589, https://skbug.com/3595

R=djsollen@google.com

Review URL: https://codereview.chromium.org/1029423010
2015-03-26 11:28:06 -07:00
egdaniel
384181c810 Add support for using alternative backends (like DirectX) when creating a GrGpu.
BUG=skia:

Review URL: https://codereview.chromium.org/1038643002
2015-03-26 09:09:41 -07:00
caryclark
54359294a7 cumulative pathops patch
Replace the implicit curve intersection with a geometric curve intersection. The implicit intersection proved mathematically unstable and took a long time to zero in on an answer.

Use pointers instead of indices to refer to parts of curves. Indices required awkward renumbering.

Unify t and point values so that small intervals can be eliminated in one pass.

Break cubics up front to eliminate loops and cusps.

Make the Simplify and Op code more regular and eliminate arbitrary differences.

Add a builder that takes an array of paths and operators.

Delete unused code.

BUG=skia:3588
R=reed@google.com

Review URL: https://codereview.chromium.org/1037573004
2015-03-26 07:52:43 -07:00
fmalita
65cdb57ae8 Add a paint filter utility canvas (SkPaintFilterCanvas)
Introduce a paint filter proxy base class as a SkDrawFilter replacement,
and convert SkDebugCanvas to use the new approach.

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

Review URL: https://codereview.chromium.org/1032173002
2015-03-26 07:24:48 -07:00
scroggo
230d4ac701 Use a wrapper for SkDebugf in SkCodec.
It can be silenced or not with one flag.
Always print when building for the android framework.

Also remove the meaningless define of override to override.

BUG=skia:3257

Review URL: https://codereview.chromium.org/1032093004
2015-03-26 07:15:55 -07:00
mtklein
dee3df930b Add a go-fast button to Skia GYP configs.
./gyp_skia -Dskia_fast=1 will
  - always optimize for the current machine as much as possible
  - drop the frame pointer
  - optimize floating point arithmetic ignoring IEEE compliance

This allows things like 3-argument VEX prefix SSE instructions and
NEON autovectorization, and can give some seriously helpful clues
about how to rearrange floating point math for speed.

I've been having trouble with LTO linking, so I'll leave that out for now.

I don't think we should set up bots with this mode.  -ffast-math means
I'm forced to run DM with --match ~Blend ~Path ~Rect ~Math ~Scalar
~Matrix ~Point before it passes, which is a disconcerting chunk of tests
to disable (including all of PathOps).

BUG=skia:

Review URL: https://codereview.chromium.org/1036533003
2015-03-26 05:30:44 -07:00
mtklein
36352bf5e3 C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla}
NOPRESUBMIT=true

BUG=skia:
DOCS_PREVIEW= https://skia.org/?cl=1037793002

Review URL: https://codereview.chromium.org/1037793002
2015-03-25 18:17:32 -07:00
bungeman
05035d43e7 Remove sfnt dependency from xps gyp tartget.
The xps gyp target depends on skia_lib, which in turn contains
the sfnt target (and re-exports it settings). As a result, it
should not separately depend on the sfnt target. This currently
isn't causing issues because the sfnt target is mostly header only,
but any code in it may be duplicated.

Review URL: https://codereview.chromium.org/1038693003
2015-03-25 14:48:05 -07:00
halcanary
d4714af018 SkPDF SkPDFObject::addResources signature simplified
-   SkPDFcatalog keeps a ordered list of object pointers
-   Elimiante SkTSet template class
-   SkPDFObject::addResources signature changes

BUG=skia:3585

Review URL: https://codereview.chromium.org/1038523004
2015-03-25 13:23:13 -07:00
halcanary
2f7ebcb424 SkPDF: eliminate skpdfpage class
BUG=skia:3585

Review URL: https://codereview.chromium.org/1007083004
2015-03-25 12:45:28 -07:00
halcanary
a43b41538a SkPDF: merge skdocument_pdf and skpdfdocument
BUG=skia:3585

Review URL: https://codereview.chromium.org/1034793002
2015-03-25 12:15:04 -07:00
scroggo
05245900bf Add scanline decoding to SkCodec.
Add an interface for decoding scanlines, and implement that interface
in the PNG decoder.

Use a separate method to determine whether an image that used a type
with alpha was actually opaque.

SkScanlineDecoder.h:
New interface for decoding scanlines.

SkCodec.h:
Add getScanlineDecoder.
Add a virtual function (with non-virtual caller) for determining
whether the image truly had alpha. The client can call this to
determine if the image was actually opaque if it reported having alpha.
Remove code to sneakily change the passed in alpha type.

SkCodec_libpng.*:
Split up code onGetPixels into helper functions that can be shared with
the scanline decoder.
Implement scanline decoding.
Implement onReallyHasAlpha.

SkSwizzler.*:
Add a new SrcConfig as a default, which is invalid.
Add a function for setting fDstRow directly.
Assert fDstRow is not NULL.

BUG=skia:3257

Review URL: https://codereview.chromium.org/1010903003
2015-03-25 11:11:52 -07:00
scroggo
3e5622764a Add copyright headers to remaining gyp files.
Prevents some PRESUBMIT errors.

TBR=mtklein@google.com

Review URL: https://codereview.chromium.org/1035523003
2015-03-25 10:22:41 -07:00
scroggo
648ac53ea3 Add copyright to gyp/codec.gyp.
Review URL: https://codereview.chromium.org/1023673010
2015-03-25 07:16:13 -07:00
msarett
9bde918754 Enabling ico decoding with use of png and bmp decoders
BUG=skia:3257

NOPRESUBMIT=true

Review URL: https://codereview.chromium.org/1011343003
2015-03-25 05:27:48 -07:00
reed
0dc4dd6dda Revert of pathops version two (patchset #16 id:150001 of https://codereview.chromium.org/1002693002/)
Reason for revert:
ASAN investigation

Original issue's description:
> pathops version two
>
> R=reed@google.com
>
> marked 'no commit' to attempt to get trybots to run
>
> TBR=reed@google.com
>
> Committed: https://skia.googlesource.com/skia/+/ccec0f958ffc71a9986d236bc2eb335cb2111119

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

Review URL: https://codereview.chromium.org/1029993002
2015-03-24 13:55:33 -07:00
tomhudson
7aa846c683 Revert of Enabling ico decoding with use of png and bmp decoders (patchset #10 id:280001 of https://codereview.chromium.org/1011343003/)
Reason for revert:
Reverting on suspicion of massive bot failures - possible command line too long?

Original issue's description:
> Enabling ico decoding with use of png and bmp decoders
>
> BUG=skia:3257
>
> Committed: https://skia.googlesource.com/skia/+/15bfd075d38e4422a477e22940d06a137f66cc97

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

Review URL: https://codereview.chromium.org/1022843005
2015-03-24 13:47:41 -07:00
tomhudson
48dc6dc52e Switch DM to use utils/android/SkAndroidSDKCanvas
Use (better) paint filter shared with nanobench, instead
of custom implementation.

R=djsollen@google.com

Review URL: https://codereview.chromium.org/1036523002
2015-03-24 12:46:40 -07:00
msarett
15bfd075d3 Enabling ico decoding with use of png and bmp decoders
BUG=skia:3257

Review URL: https://codereview.chromium.org/1011343003
2015-03-24 12:24:27 -07:00
senorblanco
8c24d453a2 Move SkMatrixImageFilter.h into src/core.
Callers in Blink have been updated to call
SkImageFilter::CreateMatrixFilter() instead.

BUG=skia:3568

Review URL: https://codereview.chromium.org/1013753013
2015-03-24 07:51:30 -07:00
caryclark
ccec0f958f pathops version two
R=reed@google.com

marked 'no commit' to attempt to get trybots to run

TBR=reed@google.com

Review URL: https://codereview.chromium.org/1002693002
2015-03-24 07:28:17 -07:00
tomhudson
f7edcdedb6 Both DM and nanobench need this, so moving the duplicated code to
one common spot. (It's incomplete, and has had bugs, so it's not
like we can confidently write once, copy-paste, and not maintain
again.)

Because SkPathEffect::exposedInAndroidJavaAPI() only builds in the
Android Framework, we might want to make all this code Framework-only?

R=djsollen@google.com,mtklein@google.com

Review URL: https://codereview.chromium.org/1021823003
2015-03-23 12:51:20 -07:00
halcanary
db0dcc7436 PDF: remove last use of SkPDFImage
Add a GM.

BUG=skia:255

Review URL: https://codereview.chromium.org/950633003
2015-03-20 12:31:52 -07:00
scroggo
3614f123e8 Make android framework depend on SkCodec.
This results in exporting include/codec so the framework can use it.

Review URL: https://codereview.chromium.org/1020903002
2015-03-20 11:20:03 -07:00
reed
1b600d3446 Revert of PDF: remove last use of SkPDFImage (patchset #5 id:120001 of https://codereview.chromium.org/950633003/)
Reason for revert:
static void draw(SkCanvas* canvas,
                 const SkPaint& p,
                 const SkBitmap& src,
                 SkColorType colorType,
                 const char text[]) {
    SkASSERT(src.colorType() == colorType);
    canvas->drawBitmap(src, 0.0f, 0.0f);
    canvas->drawText(text, strlen(text), 0.0f, 12.0f, p);
}

This assert is firing, at least on macs, where all images get decoded into 32bit at the moment.

Original issue's description:
> PDF: remove last use of SkPDFImage
>
> Add a GM.
>
> BUG=skia:255
>
> Committed: https://skia.googlesource.com/skia/+/86ad8d643624a55b02e529100bbe4e2940115fa1

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

Review URL: https://codereview.chromium.org/1024113002
2015-03-20 10:03:36 -07:00
halcanary
86ad8d6436 PDF: remove last use of SkPDFImage
Add a GM.

BUG=skia:255

Review URL: https://codereview.chromium.org/950633003
2015-03-20 09:10:56 -07:00
senorblanco
d4bb991df8 Add a new GM to show problems with shear/rotate CTM w/ image filters.
Review URL: https://codereview.chromium.org/1028663002
2015-03-20 08:54:32 -07:00
senorblanco
8c874eee94 Move SkMatrixImageFilter into core, and add a factory fn for it.
BUG=skia:

Review URL: https://codereview.chromium.org/1011273003
2015-03-20 06:38:17 -07:00
mtklein
bbecae0832 Sk2x
This adds an API, an SSE impl, a portable impl, and some tests for Sk2f/Sk2d/Sk2s.

BUG=skia:

Review URL: https://codereview.chromium.org/1025463002
2015-03-19 10:44:27 -07:00
dml
78acf96a67 Indexed PNG decoding: Ensure color table is large enough that the bit depth of the image will not allow reads beyond its end.
BUG=skia:3440
R=rmistry@google.com, scroggo@google.com

Committed: https://skia.googlesource.com/skia/+/493c1ce1cd406ef28683203146274154783452ce

Review URL: https://codereview.chromium.org/948163002
2015-03-18 06:03:30 -07:00
bungeman
d709ea8d14 Remove SkLONGLONG.
All users now define SkLONGLONG.
This fixes a long outstanding TODO now that int64_t is required.

BUG=skia:179

Review URL: https://codereview.chromium.org/1000933003
2015-03-17 07:23:39 -07:00
scroggo
cdeca44619 Revert "Indexed PNG decoding: Ensure color table is large enough that the bit depth of the image will not allow reads beyond its end."
This reverts commit 493c1ce1cd.

NOTRY=true
NOTREECHECKS=true
TBR=egdaniel@google.com,dml@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/1014553003
2015-03-17 05:25:54 -07:00
Leon Scroggins III
493c1ce1cd Indexed PNG decoding: Ensure color table is large enough that the bit depth of the image will not allow reads beyond its end.
BUG=skia:3440
R=rmistry@google.com, scroggo@google.com

Review URL: https://codereview.chromium.org/948163002
2015-03-17 08:14:07 -04:00
scroggo
9552662e9f Option for SkCodec to treat dst as all zeroes.
This recreates SkImageDecoder's feature to skip writing zeroes for
SkCodec.

Review URL: https://codereview.chromium.org/980903002
2015-03-17 05:02:17 -07:00
bsalomon
6f7f2012ee Move GrAutoLocaleSetter to new file and fix issue with null locale
TBR=egdaniel@google.com
NOTREECHECKS=true

Review URL: https://codereview.chromium.org/1002623004
2015-03-16 14:00:52 -07:00
reed
ee1c2bc5e4 remove unneeded flags
BUG=skia:

Review URL: https://codereview.chromium.org/1010063002
2015-03-16 13:55:48 -07:00
msarett
741143878b Revert "Revert of fix for invalid for loop syntax broke build (patchset #1 id:1 of https://codereview.chromium.org/1007373003/)"
This reverts commit d18475854c.

Revert "Revert "Implementation of image decoding for bmp files, in accordance with the new API.""

This reverts commit dfdec78a5d.

BUG=skia:

TBR=

Review URL: https://codereview.chromium.org/1016443003
2015-03-16 11:55:18 -07:00
msarett
dfdec78a5d Revert "Implementation of image decoding for bmp files, in accordance with the new API."
This reverts commit 3675874468.

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

Review URL: https://codereview.chromium.org/1012873002
2015-03-16 11:07:02 -07:00
msarett
3675874468 Implementation of image decoding for bmp files, in accordance with the new API.
Currently decodes to opaque and unpremul.

Tested on local test suite.

BUG=skia:3257

Review URL: https://codereview.chromium.org/947283002
2015-03-16 08:27:53 -07:00
joshualitt
5bf99f1ca8 Creation of GrBatchAtlas and Distancefieldpathrenderer batch
BUG=skia:

Review URL: https://codereview.chromium.org/975303005
2015-03-13 11:47:42 -07:00
mtklein
172b45518a Clean up SkDynamicAnnotations.
Unprotected reads -> relaxed reads.
    Unprotected write -> relaxed write.

The only unprotected write we had was in SkTraceEvent, which it looks like we nabbed from Chrome at some point and changed only to silence TSAN.  Chrome's version uses AtomicWord / NoBarrier_Load / NoBarrier_Store, which boils down to the same as here, intptr_t / relaxed load / relaxed store.

This leaves one place where we're lying a bit to TSAN, in include/core/SkLazyPtr.h where we're doing a data-dependent consume load.  We're telling TSAN it's consume, but telling any other compiler to compile it as relaxed, given how they all upgrade consume to acquire.  This eliminates a barrier for us on ARM.  How do you guys deal with this?  Just use a consume memory order, take the hit, and hope compilers get smarter one day?

BUG=chromium:465721

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

Review URL: https://codereview.chromium.org/996763002
2015-03-12 05:27:46 -07:00
mtklein
a0d7b7bf62 delete dead code
BUG=skia:

Review URL: https://codereview.chromium.org/1003493002
2015-03-11 12:17:00 -07:00
mtklein
22712569a5 Clean up poppler code.
We're not actually using it.

BUG=skia:3362
DOCS_PREVIEW= https://skia.org/?cl=1002493002

Review URL: https://codereview.chromium.org/1002493002
2015-03-11 11:55:14 -07:00
dml
f45796ee0e Fix a memory leak when decoding corrupted indexed PNGs.
Commit to branch refs/heads/png-leak

BUG=skia:3457

Committed: https://skia.googlesource.com/skia/+/561a1ca9559a1ea7589ab93350124284fcef3315

Review URL: https://codereview.chromium.org/951663002
2015-03-11 11:12:54 -07:00
egdaniel
86e31a1980 Allow user to pass in a path for extra dependencies for gpu
BUG=skia:

Review URL: https://codereview.chromium.org/986363002
2015-03-09 09:40:42 -07:00
mtklein
82966b5eed Revert of For consistency, use our homebrew zlib everywhere possible. (patchset #6 id:100001 of https://codereview.chromium.org/971673005/)
Reason for revert:
Reverting in case this is the cause of the non-Windows failures.

Original issue's description:
> For consistency, use our homebrew zlib everywhere possible.
>
> This switches when we build our own zlib from "just Windows" to "everyone, but
> not Android framework of course".
>
> I tested this by building DM for my Mac and for an Android bot config.
> It took minor tweaks to the GYP to get ARM builds working.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/5a8f2257b0b0f954fb74f65e7ea3ada772ed9240

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

Review URL: https://codereview.chromium.org/989873002
2015-03-07 07:47:51 -08:00
reed
8371b7e8ef Revert of Fix a memory leak when decoding corrupted indexed PNGs. (patchset #2 id:20001 of https://codereview.chromium.org/951663002/)
Reason for revert:
speculative revert due to many failures in tree

Original issue's description:
> Fix a memory leak when decoding corrupted indexed PNGs.
> Commit to branch refs/heads/png-leak
>
> BUG=skia:3457
>
> Committed: https://skia.googlesource.com/skia/+/561a1ca9559a1ea7589ab93350124284fcef3315

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

Review URL: https://codereview.chromium.org/980203005
2015-03-07 06:05:51 -08:00
dml
561a1ca955 Fix a memory leak when decoding corrupted indexed PNGs.
Commit to branch refs/heads/png-leak

BUG=skia:3457

Review URL: https://codereview.chromium.org/951663002
2015-03-06 16:25:28 -08:00
mtklein
5a8f2257b0 For consistency, use our homebrew zlib everywhere possible.
This switches when we build our own zlib from "just Windows" to "everyone, but
not Android framework of course".

I tested this by building DM for my Mac and for an Android bot config.
It took minor tweaks to the GYP to get ARM builds working.

BUG=skia:

Review URL: https://codereview.chromium.org/971673005
2015-03-06 16:15:16 -08:00
tomhudson
cdf34cdfb9 We had zero coverage for SkDrawFilter. This new GM draws two rectangles.
If SkDrawFilter is working, they will not match (have different colors
and one will be blurred). If SkDrawFilter is broken, they will match.

R=scroggo@google.com

Review URL: https://codereview.chromium.org/984883003
2015-03-06 06:15:20 -08:00
djsollen
961707f384 Remove SkPorterDuff now that Android has been updated.
BUG=skia:3178

Review URL: https://codereview.chromium.org/983743003
2015-03-05 12:42:29 -08:00
robertphillips
193ea935b0 Split GrTargetCommands into its own files
Review URL: https://codereview.chromium.org/979493002
2015-03-03 12:40:50 -08:00
scroggo
f9b31ebc79 Return to building libpng_static off of Android.
Fixes the fix in https://codereview.chromium.org/971243003/, to
build places that are not Android.

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

Review URL: https://codereview.chromium.org/973863002
2015-03-03 09:39:58 -08:00
scroggo
3b234f737b Build the Android version of PNG on Android.
Fixes Android build failures.

Android builds a custom version of libpng (instead of the one
determined by skia_libpng_static) which supplies extra needed
functions.

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

Review URL: https://codereview.chromium.org/971243003
2015-03-03 09:34:58 -08:00
halcanary
47ef4d5d93 XPS, DM: add SkDocument::CreateXPS
-   SkDocument::CreateXPS() function added, returns NULL on non-Windows OS.

-   DM: (Windows only) an XPSSink is added, fails on non-Windows OS

-   DM: Common code for PDFSink::draw and XPSSink::draw are factored into
    draw_skdocument static function.

-   SkDocument_XPS (Windows only) implementation of SkDocument via
    SkXPSDevice.

-   SkDocument_XPS_None (non-Windows) returns NULL for
    SkDocument::CreateXPS().

-   gyp/xps.gyp refactored.

-   SkXPSDevice::drawTextOnPath removed (see http://crrev.com/925343003 )

-   SkXPSDevice::drawPath supports conics via SkAutoConicToQuads.

Review URL: https://codereview.chromium.org/963953002
2015-03-03 09:13:09 -08:00
scroggo
f24f2247c2 Add SkCodec, including PNG implementation.
DM:
Add a flag to use SkCodec instead of SkImageDecoder.

SkCodec:
Base class for codecs, allowing creation from an SkStream or an SkData.
An SkCodec, on creation, knows properties of the data like its width and height. Further calls can be used to generate the image.
TODO: Add scanline iterator

SkPngCodec:
New decoder for png. Wraps libpng. The code has been repurposed from SkImageDecoder_libpng.
TODO: Handle other destination colortypes
TODO: Substitute the transpose color
TODO: Allow silencing warnings
TODO: Use RGB instead of filler?
TODO: sRGB

SkSwizzler:
Simplified version of SkScaledSampler. Unlike the sampler, this object does no sampling.
TODO: Implement other swizzles.

Requires a gclient sync to pull down libpng.

BUG=skia:3257

Committed: https://skia.googlesource.com/skia/+/ca358852b4fed656d11107b2aaf28318a4518b49
(and then reverted)

Review URL: https://codereview.chromium.org/930283002
2015-03-03 08:59:20 -08:00
halcanary
c2574f3657 Revert of XPS, DM: add SkDocument::CreateXPS (patchset #8 id:310001 of https://codereview.chromium.org/963953002/)
Reason for revert:
breaking iOS build.

Original issue's description:
> XPS, DM: add SkDocument::CreateXPS
>
> -   SkDocument::CreateXPS() function added, returns NULL on non-Windows OS.
>
> -   DM: (Windows only) an XPSSink is added, fails on non-Windows OS
>
> -   DM: Common code for PDFSink::draw and XPSSink::draw are factored into
>     draw_skdocument static function.
>
> -   SkDocument_XPS (Windows only) implementation of SkDocument via
>     SkXPSDevice.
>
> -   SkDocument_XPS_None (non-Windows) returns NULL for
>     SkDocument::CreateXPS().
>
> -   gyp/xps.gyp refactored.
>
> -   SkXPSDevice::drawTextOnPath removed (see http://crrev.com/925343003 )
>
> -   SkXPSDevice::drawPath supports conics via SkAutoConicToQuads.
>
> NOPRESUBMIT=true
>
> Committed: https://skia.googlesource.com/skia/+/00d39bcbfc8394a9b48b86b04ab06ec19091fa43

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

Review URL: https://codereview.chromium.org/978443002
2015-03-03 08:34:14 -08:00