Commit Graph

16846 Commits

Author SHA1 Message Date
djsollen
54416de523 Update DM to allow Src's to have optional options.
Review URL: https://codereview.chromium.org/1059513002
2015-04-03 07:24:48 -07:00
scroggo
0a7e69cb9b Get rid of leaks in SkCodec::NewFromStream.
SkCodec::NewFromStream claims to delete the passed in SkStream on
failure. This allows the caller to pass an SkStream to the function
and not worry about deleting it depending on the return value.

Most of our SkCodecs did not honor this contract though. Update them
to delete the stream on failure. Further, update SkCodec::NewFromStream
to delete the stream if it did not match any subclass, and delete the
SkCodec if we decided to return NULL because it was too big.

Add a test which tests streams which represent the beginnings of
supported format types but do not contain enough data to create an
SkCodec. The interesting part of the test is when we run it on ASAN,
which will report that we leaked something without the other changes.

BUG=skia:3257

Review URL: https://codereview.chromium.org/1058873006
2015-04-03 07:22:22 -07:00
mtklein
3d626834b4 New names for SkPMFloat methods.
BUG=skia:

Review URL: https://codereview.chromium.org/1055123002
2015-04-03 07:05:20 -07:00
djsollen
2ab9000b3f Prevent DM crash in the PDF sink when src width/height are zero.
Review URL: https://codereview.chromium.org/1061493002
2015-04-03 06:38:31 -07:00
mtklein
a156a8ffbe Use switch operator[](int) to kth<int>() so we can use vget_lane.
#floats

BUG=skia:
BUG=skia:3592

Review URL: https://codereview.chromium.org/1059743002
2015-04-03 06:16:13 -07:00
reed
aa4c7a7042 remove useless benches
The colorfilter is applied to a single (paint's) color, so the bench does not
measure the filter at all, but simply the blit of a color.

BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1055383002
2015-04-02 20:31:17 -07:00
reed
92dabe7421 Exclusion and Difference modes using Sk4f
Before:
   7M	1	15.3ms	15.5ms	15.8ms	17.2ms	4%	▁█▄▁▇▂▁▁▂▁	8888	Xfermode_Exclusion
   7M	1	16.5ms	17.1ms	17.3ms	18.8ms	5%	▁█▃█▃▂▂▃▂▂	8888	Xfermode_Difference

After:
   7M	1	9.06ms	9.34ms	9.42ms	10.4ms	4%	▁▁▅▄█▁▂▁▂▃	8888	Xfermode_Exclusion
   7M	1	10.5ms	10.9ms	11ms	12ms	5%	▃▁▆█▂▁▅▂▁▃	8888	Xfermode_Difference

TBR=mtklein@google.com

Review URL: https://codereview.chromium.org/1060493002
2015-04-02 19:19:14 -07:00
reed
f8f5478f92 impl Multiply mode using Sk4f
Before:
   7M	1	14.4ms	14.8ms	15.4ms	17.5ms	7%	▆█▅▅▂▁▁▁▂▁	8888	Xfermode_Multiply

After:
   7M	1	12ms	12.1ms	12.5ms	14.1ms	6%	▃█▇▂▁▂▁▁▂▁	8888	Xfermode_Multiply

TBR=mtklein@google.com

Review URL: https://codereview.chromium.org/1056003002
2015-04-02 17:13:22 -07:00
mtklein
fb806dd27d Revert of Try ARMv7 and NEON for Daisy. (patchset #1 id:1 of https://codereview.chromium.org/1054233002/)
Reason for revert:
whatever compiler we're using can't handle array subscripts for neon vectors

Original issue's description:
> 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

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

Review URL: https://codereview.chromium.org/1058173002
2015-04-02 15:41:25 -07:00
Mike Klein
a121c0ee6b 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

Review URL: https://codereview.chromium.org/1054233002
2015-04-02 18:32:54 -04:00
Mike Klein
a41699271f back to plain arm for the night
It's looking like the previous CL did not fix the Daisy bot GMs,
even though that's still the only bit of code I can find that was
ignoring color order.  Puzzled.  Reverting arm_version=7 for now.

BUG=skia:1843

Review URL: https://codereview.chromium.org/1051423002
2015-04-02 17:35:25 -04:00
rmistry
0f05443bf1 Add documentation for tree sheriffs
BUG=skia:
NOTRY=true
DOCS_PREVIEW= https://skia.org/?cl=1057883002

Review URL: https://codereview.chromium.org/1057883002
2015-04-02 13:31:09 -07:00
scroggo
2102799419 Test SkCodec to kIndex8 in nanobench.
BUG=skia:3257
BUG=skia:3475

Review URL: https://codereview.chromium.org/1051973002
2015-04-02 13:22:38 -07:00
scroggo
028a4135aa Add a method to read a stream without advancing it.
Add a virtual method on SkStream which will do a "peek" some bytes, so
that those bytes are read, but the next call to read will be
unaffected.

Implement peek for SkMemoryStream, where the implementation is simple
and obvious.

Implement peek on SkFrontBufferedStream.

Add tests.

Motivated by decoding streams which cannot be rewound.

TBR=reed@google.com

BUG=skia:3257

Review URL: https://codereview.chromium.org/1044953002
2015-04-02 13:19:51 -07:00
reed
f92ace90d8 experimental speedup some xfermodes with Sk4f
Old:
   7M	1	11.1ms	11.3ms	11.3ms	11.6ms	1%	▅▄▂▂▁▁▄▄█▇	8888	Xfermode_Screen
   7M	1	10.7ms	10.9ms	10.9ms	11.1ms	1%	▄▄▄▇▃▁█▄▂▅	8888	Xfermode_Modulate
   7M	1	7.86ms	8.03ms	8ms	8.18ms	1%	█▇▅▁▃▃▂▃▆▅	8888	Xfermode_Plus
   7M	1	14.6ms	14.8ms	14.8ms	15.1ms	1%	▄█▆▅▄▁▁▆▄▆	8888	Xfermode_Xor
   7M	1	13ms	13.5ms	13.4ms	13.8ms	2%	▅▃▇▁█▂▃▅▃▅	8888	Xfermode_DstATop
   7M	1	13.1ms	13.4ms	13.3ms	13.6ms	1%	▄▁▁▆▅▄▇▆█▂	8888	Xfermode_SrcATop

New:
   7M	1	6.99ms	7.19ms	7.4ms	8.98ms	8%	▁▂▁▃▂█▁▂▂▂	8888	Xfermode_Screen
   7M	1	5.27ms	5.46ms	5.46ms	5.89ms	3%	▁▁▅▁▂█▄▃▄▃	8888	Xfermode_Modulate
   7M	1	6.8ms	7.04ms	7.27ms	8.53ms	8%	▂▁█▁▁▂▂▂▂▇	8888	Xfermode_Plus
   7M	1	9ms	9.2ms	9.33ms	10.5ms	5%	▁█▃▁▂▁▁▁▅▂	8888	Xfermode_Xor
   7M	1	8.34ms	8.57ms	8.73ms	10.6ms	8%	▁▁▁▂▂▂▂▂▂█	8888	Xfermode_DstATop
   7M	1	8.38ms	8.62ms	8.91ms	10.3ms	8%	▁▃▁▂▇▂▁▂▁█	8888	Xfermode_SrcATop

Need to define SK_SUPPORT_LEGACY_SCALAR_XFERMODES in chrome to suppress change (see https://codereview.chromium.org/1054083002/)

Review URL: https://codereview.chromium.org/1043413002
2015-04-02 12:46:24 -07:00
Mike Klein
3f55eed73f I suspect S32A_D565_Opaque_neon for Daisy problems.
I don't see any color-order handling logic in the 32-bit code.

BUG=skia:1843

CQ_EXCLUDE_TRYBOTS=client.skia.compile:Build-Win-MSVC-x86-Debug-Trybot,Build-Win-MSVC-x86_64-Debug-Trybot
R=mtklein@google.com

Review URL: https://codereview.chromium.org/1051683003
2015-04-02 15:41:49 -04:00
bungeman
b1e1472bd5 Add test font for large glyphs.
This font contains two glyphs, one for 'a' and one for 'A'. The em size
is 128, and the 'a' fits in this. The big 'A', however, is ~3000 in
in each direction.

Review URL: https://codereview.chromium.org/1016153002
2015-04-02 12:18:38 -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
mtklein
07342361a3 SkPMFloat: fewer internal this->isValid() assertions.
Each of these conversion functions now only asserts is output is valid.
  For SkPMColor -> SkPMFloat, we assert isValid().
  For SkPMFloat -> SkPMColor, we SkPMColorAssert.

 #floats

BUG=skia:
BUG=skia:3592

Review URL: https://codereview.chromium.org/1055093002
2015-04-02 11:21:11 -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
mtklein
83c6459228 Make Daisy ARMv7.
This should be a ~noop as far as gold.skia.org goes.
After this, I'll try out NEON.

BUG=skia:1843

Review URL: https://codereview.chromium.org/1056793004
2015-04-02 10:24:23 -07:00
mtklein
cb49c07b73 tidy up chromeos_setup.sh
- remove unused alex
- streamline Link's config
- remove misleading Daisy config:
  1) armv7=1 does nothing.  We meant to type arm_version=7 here.
  2) arm_neon=1 does nothing unless arm_version == 7.
  3) arm_thumb=0 is the default when arm_version <= 7.
  4) skia_arch_width=32 is the default when skia_arch_type=arm.

I'd just fix this to make Daisy arm_version=7 and arm_neon=1 (and
arm_thumb=1, which I'm going to separately make the default for
arm_version=7), but there are known color-order bugs with our
NEON procs that would make Daisy start pushing bad images to
Gold.  Going to take baby steps here...

BUG=skia:1843

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

CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Ubuntu-GCC-Arm7-Debug-CrOS_Daisy-Trybot

Review URL: https://codereview.chromium.org/1051253002
2015-04-02 09:27:57 -07:00
joshualitt
dbd3593e0b Rename GrBitmapTextContextB to GrAtlasTextContext
BUG=skia:

Review URL: https://codereview.chromium.org/1050173002
2015-04-02 09:19:04 -07:00
mtklein
192945e92e Revert of tidy up chromeos_setup.sh (patchset #1 id:1 of https://codereview.chromium.org/1051253002/)
Reason for revert:
arm_thumb not defined

Original issue's description:
> tidy up chromeos_setup.sh
>
> - remove unused alex
> - streamline Link's config
> - remove misleading Daisy config:
>   1) armv7=1 does nothing.  We meant to type arm_version=7 here.
>   2) arm_neon=1 does nothing unless arm_version == 7.
>   3) arm_thumb=0 is the default when arm_version <= 7.
>   4) skia_arch_width=32 is the default when skia_arch_type=arm.
>
> I'd just fix this to make Daisy arm_version=7 and arm_neon=1 (and
> arm_thumb=1, which I'm going to separately make the default for
> arm_version=7), but there are known color-order bugs with our
> NEON procs that would make Daisy start pushing bad images to
> Gold.  Going to take baby steps here...
>
> BUG=skia:1843
>
> Committed: https://skia.googlesource.com/skia/+/3c2809bc612f4a265770914f860d214c9665dc4a

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

Review URL: https://codereview.chromium.org/1059443002
2015-04-02 09:02:12 -07:00
mtklein
3c2809bc61 tidy up chromeos_setup.sh
- remove unused alex
- streamline Link's config
- remove misleading Daisy config:
  1) armv7=1 does nothing.  We meant to type arm_version=7 here.
  2) arm_neon=1 does nothing unless arm_version == 7.
  3) arm_thumb=0 is the default when arm_version <= 7.
  4) skia_arch_width=32 is the default when skia_arch_type=arm.

I'd just fix this to make Daisy arm_version=7 and arm_neon=1 (and
arm_thumb=1, which I'm going to separately make the default for
arm_version=7), but there are known color-order bugs with our
NEON procs that would make Daisy start pushing bad images to
Gold.  Going to take baby steps here...

BUG=skia:1843

Review URL: https://codereview.chromium.org/1051253002
2015-04-02 08:52:36 -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
borenet
11106f196e Skip desk_baidu skp on Valgrind bot
This has been running for 16 hours:
https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-Valgrind/builds/12/

BUG=skia:3506

Review URL: https://codereview.chromium.org/1056883002
2015-04-02 07:24:03 -07:00
reed
c6e13d7342 pass legal premul values to bitmap -- do we still need this GM?
BUG=skia:

Review URL: https://codereview.chromium.org/1052083004
2015-04-02 05:43:09 -07:00
senorblanco
d0d37cace0 Implement approx-match support in image filter saveLayer() offscreen.
Currently, the GPU-side image filter implementation creates
exact-match textures for the offscreen backing stores for
saveLayer().  This is because several filters have GPU
implementations which depend on the texture coordinates
being 0..1.

The fix is three-fold:

1) Store the actual requested size in the SkGpuDevice, so
that when wrapping it in an SkBitmap for passing to
filterImage(), we can give it the original size.
2) Fix the filters (SkMagnifierImageFilter,
SkLightingImageFilter, SkMatrixConvolutionImageFilter,
SkMatrixImageFilter) whose GPU implementation depends on
0..1 texture coordinates.
3) Remove the exception for GPU-side image filters in
SkCanvas::internalSaveLayer().

For the lighting filters, there were two bugs which were
cancelling each other out: the sobel filter matrix was
being computed upside down, but then we'd negate the
resulting normal. This worked fine in the exact-match case,
but in the approx-match case we'd sample garbage along
the edge pixels. Also, we never implemented the edge pixels
according to spec in the GPU case. It requires a
different fragment shader for each edge of the nine-patch,
which meant we couldn't use asFragmentProcessor(), and had
to implement the drawing via a filterImageGPU() override.
In order to avoid polluting the public API, I inserted a
new base class, SkLightingImageFilterInternal above
Sk[Diffuse|Specular]LightingImageFilter to handle the
implementation.

For the SkMatrixConvolutionImageFilter, it seems the
GLSL clamp() function occasionally returns values outside
the clamped range, resulting in access of garbage
texels even in GL_NEAREST. The fix here is to clamp to a
rect inset by half a texel. There was also a bug in
the unpremultiply step when fConvolveAlpha is false.

For SkMatrixImageFilter, the fix was to make the generic
draw path be more careful about when to use texture domain.
If the bitmap already has a texture, use texture domain
if the srcRect is smaller than the entire texture (not
the entire bitmap).

N.B.: this change will cause some minor pixel diffs in the
GPU results of the following GMs (and possibly more):
matriximagefilter, matrixconvolution, imagefiltersscaled,
lighting, imagemagnifier, filterfastbounds,
complexclip_aa_Layer_invert, complexclip_aa_layer,
complexclip_bw_layer_invert, complexclip_bw_layer.

BUG=skia:3532

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

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

Committed: https://skia.googlesource.com/skia/+/46112cf2a7c7307f1c9eebb5f881cbda15aa460c

Review URL: https://codereview.chromium.org/1034733002
2015-04-02 04:54:57 -07:00
fmalita
160ebb2bfa [SkDebugger] Flatten drawPicture ops
Add two drawPicture bracketing ops (BeginDrawPicture, EndDrawPicture) to
replace the current DrawPicture op, and flatten picture contents.

Review URL: https://codereview.chromium.org/1048383002
2015-04-01 20:58:37 -07:00
rmistry
82973dbf4f Revert of Implement approx-match support in image filter saveLayer() offscreen. (patchset #31 id:590001 of https://codereview.chromium.org/1034733002/)
Reason for revert:
Spoke to Stephen about this. Reverting because failing debug builds:

https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Mac10.9-Clang-MacMini6.2-GPU-HD4000-x86_64-Debug/builds/51
https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Ubuntu-GCC-ShuttleA-GPU-GTX660-x86_64-Debug/builds/54

Original issue's description:
> Implement approx-match support in image filter saveLayer() offscreen.
>
> Currently, the GPU-side image filter implementation creates
> exact-match textures for the offscreen backing stores for
> saveLayer().  This is because several filters have GPU
> implementations which depend on the texture coordinates
> being 0..1.
>
> The fix is three-fold:
>
> 1) Store the actual requested size in the SkGpuDevice, so
> that when wrapping it in an SkBitmap for passing to
> filterImage(), we can give it the original size.
> 2) Fix the filters (SkMagnifierImageFilter,
> SkLightingImageFilter, SkMatrixConvolutionImageFilter,
> SkMatrixImageFilter) whose GPU implementation depends on
> 0..1 texture coordinates.
> 3) Remove the exception for GPU-side image filters in
> SkCanvas::internalSaveLayer().
>
> For the lighting filters, there were two bugs which were
> cancelling each other out: the sobel filter matrix was
> being computed upside down, but then we'd negate the
> resulting normal. This worked fine in the exact-match case,
> but in the approx-match case we'd sample garbage along
> the edge pixels. Also, we never implemented the edge pixels
> according to spec in the GPU case. It requires a
> different fragment shader for each edge of the nine-patch,
> which meant we couldn't use asFragmentProcessor(), and had
> to implement the drawing via a filterImageGPU() override.
> In order to avoid polluting the public API, I inserted a
> new base class, SkLightingImageFilterInternal above
> Sk[Diffuse|Specular]LightingImageFilter to handle the
> implementation.
>
> For the SkMatrixConvolutionImageFilter, it seems the
> GLSL clamp() function occasionally returns values outside
> the clamped range, resulting in access of garbage
> texels even in GL_NEAREST. The fix here is to clamp to a
> rect inset by half a texel. There was also a bug in
> the unpremultiply step when fConvolveAlpha is false.
>
> For SkMatrixImageFilter, the fix was to make the generic
> draw path be more careful about when to use texture domain.
> If the bitmap already has a texture, use texture domain
> if the srcRect is smaller than the entire texture (not
> the entire bitmap).
>
> N.B.: this change will cause some minor pixel diffs in the
> GPU results of the following GMs (and possibly more):
> matriximagefilter, matrixconvolution, imagefiltersscaled,
> lighting, imagemagnifier, filterfastbounds,
> complexclip_aa_Layer_invert, complexclip_aa_layer,
> complexclip_bw_layer_invert, complexclip_bw_layer.
>
> BUG=skia:3532
>
> Committed: https://skia.googlesource.com/skia/+/b97dafefe63ea0a1bbce8e8b209f4920983fb8b9
>
> Committed: https://skia.googlesource.com/skia/+/f5f8518fe0bbd2703e4ffc1b11ad7b4312ff7641
>
> Committed: https://skia.googlesource.com/skia/+/46112cf2a7c7307f1c9eebb5f881cbda15aa460c

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

Review URL: https://codereview.chromium.org/1057693002
2015-04-01 15:53:13 -07:00
rmistry
fd40a249d8 Revert of Fix GLSL error on Android. (patchset #2 id:20001 of https://codereview.chromium.org/1053873002/)
Reason for revert:
Spoke to Stephan about this. Reverting because failing debug builds:

https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Mac10.9-Clang-MacMini6.2-GPU-HD4000-x86_64-Debug/builds/51
https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Ubuntu-GCC-ShuttleA-GPU-GTX660-x86_64-Debug/builds/54

Original issue's description:
> Fix GLSL error on Android.
>
> BUG=skia:
> TBR=bsalomon
> NOTREECHECKS=true
> NOTRY=true
>
> Committed: https://skia.googlesource.com/skia/+/f90cd8e0e39af02c3826c80366efa3c06e88f642

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

Review URL: https://codereview.chromium.org/1056713002
2015-04-01 15:51:34 -07:00
senorblanco
f90cd8e0e3 Fix GLSL error on Android.
BUG=skia:
TBR=bsalomon
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1053873002
2015-04-01 15:13:29 -07:00
bsalomon
dfbbec436c Add constant color GrFP.
Review URL: https://codereview.chromium.org/978713002
2015-04-01 14:54:57 -07:00
scroggo
081a8a4f84 nanobench does not need to handle failed rewind.
Now that all SkCodecs can rewind (assuming the stream is rewindable),
we do not need to special case it.

Pointed out by Derek in the code review that added this.

TBR=djsollen

Review URL: https://codereview.chromium.org/1058633002
2015-04-01 14:34:40 -07:00
senorblanco
46112cf2a7 Implement approx-match support in image filter saveLayer() offscreen.
Currently, the GPU-side image filter implementation creates
exact-match textures for the offscreen backing stores for
saveLayer().  This is because several filters have GPU
implementations which depend on the texture coordinates
being 0..1.

The fix is three-fold:

1) Store the actual requested size in the SkGpuDevice, so
that when wrapping it in an SkBitmap for passing to
filterImage(), we can give it the original size.
2) Fix the filters (SkMagnifierImageFilter,
SkLightingImageFilter, SkMatrixConvolutionImageFilter,
SkMatrixImageFilter) whose GPU implementation depends on
0..1 texture coordinates.
3) Remove the exception for GPU-side image filters in
SkCanvas::internalSaveLayer().

For the lighting filters, there were two bugs which were
cancelling each other out: the sobel filter matrix was
being computed upside down, but then we'd negate the
resulting normal. This worked fine in the exact-match case,
but in the approx-match case we'd sample garbage along
the edge pixels. Also, we never implemented the edge pixels
according to spec in the GPU case. It requires a
different fragment shader for each edge of the nine-patch,
which meant we couldn't use asFragmentProcessor(), and had
to implement the drawing via a filterImageGPU() override.
In order to avoid polluting the public API, I inserted a
new base class, SkLightingImageFilterInternal above
Sk[Diffuse|Specular]LightingImageFilter to handle the
implementation.

For the SkMatrixConvolutionImageFilter, it seems the
GLSL clamp() function occasionally returns values outside
the clamped range, resulting in access of garbage
texels even in GL_NEAREST. The fix here is to clamp to a
rect inset by half a texel. There was also a bug in
the unpremultiply step when fConvolveAlpha is false.

For SkMatrixImageFilter, the fix was to make the generic
draw path be more careful about when to use texture domain.
If the bitmap already has a texture, use texture domain
if the srcRect is smaller than the entire texture (not
the entire bitmap).

N.B.: this change will cause some minor pixel diffs in the
GPU results of the following GMs (and possibly more):
matriximagefilter, matrixconvolution, imagefiltersscaled,
lighting, imagemagnifier, filterfastbounds,
complexclip_aa_Layer_invert, complexclip_aa_layer,
complexclip_bw_layer_invert, complexclip_bw_layer.

BUG=skia:3532

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

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

Review URL: https://codereview.chromium.org/1034733002
2015-04-01 14:17:14 -07:00
mtklein
b41f05787e That last CL subverted the purpose of the test. Put it back how it was.
BUG=skia:

Review URL: https://codereview.chromium.org/1055633003
2015-04-01 13:36:23 -07:00
halcanary
c79a391a38 DM: JSON output adds process_max_resident_set_size_MB
Review URL: https://codereview.chromium.org/917943002
2015-04-01 13:31:34 -07:00
halcanary
be27a118c2 SkPDF: SkPDFGraphicState Lookup hashtabled
In Release, running `dm --src skp --config pdf`, I get a
speedup of about 1.2%.

SkPDFGraphicState class:
-   Holds the subset of SkPaint that maps to a PDF Graphics
    State
-   These fields are easily comparable, making hashtable
    comparisons easy.

SkPDFCanon:
-   findGraphicState() takes a SkPDFGraphicState, not a SkPaint
-   fGraphicStateRecords is a SkHashSet, not a SkTDArray

SkPDFGraphicState:
-   mode_for_pdf() replaces logic inside equivalent(), but is
    only called once per lookup.
-   emitObject() no longer modifies the SkPDFGraphicState to
    cache the SkPDFDict stucture.  (Since it is de-duped,
    this get no speedup).
-   Static Functions that don't use the canon return a plain
    SkPDFDict now.  No need for fPopulated.

SkTHash.h
-   SkHashSet::forall added

SkPDFDevice; SkPDFShader
-   Updated for new SkPDFGraphicState interface.

BUG=skia:3585

Review URL: https://codereview.chromium.org/1046293002
2015-04-01 13:31:19 -07:00
mtklein
03e5161bed Implicit constructors for SkFunction are much more readable.
BUG=skia:

Review URL: https://codereview.chromium.org/1052663004
2015-04-01 13:08:50 -07:00
jvanverth
21deace8ef Emulate distance field gamma fix by making glyphs thicker or thinner
The idea here is that we determine the 0.5 crossover for each
row in the gamma table, then invert the mapping to determine
which point that maps to in the original range [-.65,
.65]. That gives us a change in the apparent width of the
glyph that closely corresponds to the change produced by the gamma fix.

BUG=skia:2933

Review URL: https://codereview.chromium.org/1042373002
2015-04-01 12:43:48 -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
djsollen
48c3534541 Update the Android scripts to refresh device names and capabilities.
Review URL: https://codereview.chromium.org/1054633002
2015-04-01 12:15:39 -07:00
msarett
68b204e61c Ico test with embedded png
BUG=skia:3257

Review URL: https://codereview.chromium.org/1054673002
2015-04-01 12:09:22 -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
joshualitt
2b6acb4ed5 Switch to one single bitmap text blob cache allocation
BUG=skia:

Review URL: https://codereview.chromium.org/1041953002
2015-04-01 11:30:28 -07:00
mtklein
74415278ce Constructor and call argument forwarding for SkFunction.
BUG=skia:

Review URL: https://codereview.chromium.org/1050113003
2015-04-01 11:26:31 -07:00
scroggo
5842154480 SkCodec::onGetScanlineDecoder must call rewind.
This mirrors the behavior in onGetPixels, and allows the implementation
to share code for handling calls to rewindIfNeeded.

This also fixes a bug where getScanlineDecoder was calling
rewindIfNeeded and treating the result as a bool.

In SkPngCodec, factor out the code to call rewindIfNeeded, and call it
in both onGetPixels and onGetScanlineDecoder.

Update the test to include testing the scanline decoder. Rename "gen"
to "codec" now that it must be an SkCodec.

BUG=skia:3257

Depends on https://codereview.chromium.org/1048423003/ (DIFFERENT ISSUE).

Review URL: https://codereview.chromium.org/1050893002
2015-04-01 11:25:20 -07:00
mtklein
fb8307c6b7 Add SkTHashSet::find()
BUG=skia:

Review URL: https://codereview.chromium.org/1058553002
2015-04-01 11:21:27 -07:00