This change removes sk_stdint.h since it is only needed for vs2008 and earlier.
This change removes SK_MMAP_SUPPORT define since it is no longer used.
This change removes the stdio.h include from SkTypes.h since on many systems
this is a very large header, few Skia files actually use it, it is
available everywhere standard, and SkDebugf should be used instead.
After this change there is no need for external users to put Skia's
include/config into their own list of includes, saving the headache
of having two header files of the same name and sometimes getting the
wrong one depending on include order.
R=bsalomon@google.com, djsollen@google.com
Review URL: https://codereview.chromium.org/27044002
git-svn-id: http://skia.googlecode.com/svn/trunk@11738 2bbb7eff-a529-9590-31e7-b0007b416f81
Only implemented for PNG.
Add a getter and setter, and sets the default to false in the
constructor. Also copies the setting in copyFieldsToOther.
Fix an indpendent bug where fDitherImage was not being copied in
copyFieldsToOther.
In SkScaledBitmapSampler::begin, consolidate the settings passed in
by passing a const reference to the decoder. The decoder can be
referenced for its settings of dither, unpremultiplied, and now
skipping writing zeroes. Update callers to use the new API. In png
decoder, rather than passing around a pointer to an initial
read of getDitherImage, and potentially changing it, look at the
field on the decoder itself, and modify it directly. This is a
change in behavior - now if that same decoder is used to decode
a different image, the dither setting has changed. I think this is
okay because A) the typical use case is to use a new decoder for
each decode, B) we do not make any promises that a decode does not
change the decoder and C) it makes the code in SkScaledBitmapSampler
much cleaner.
In SkScaledBitmapScampler, add new row procs for skipping zeroes. Now
that choosing the row proc has five dimensions (src config, dst config,
dither, skip writing zeroes, unpremultiplied), use a new method: each
src/dst combination has a function for choosing the right proc depending
on the decoder.
SkScaledBitmapScampler::RowProc is now public for convenience.
Remove Sample_Gray_D8888_Unpremul, which is effectively no different
from Sample_Gray_D8888.
In cases where unpremultiplied was trivial, such as 565 and when
sampling from gray, decoding may now succeed.
Add a benchmark (currently disabled) for comparing the speed of skipping
writing zeroes versus not skipping. For this particular image, which is
mostly transparent pixels, normal decoding took about 3.6 milliseconds,
while skipping zeroes in the decode took only about 2.5 milliseconds
(this is on a Nexus 4). Presumably it would be slower on an image
with a small amount of transparency, but there will be no slowdown
for an image which reports that it has no transparency.
In SkImageRef_ashmem, always skip writing zeroes, since ashmem
memory is guaranteed to be initialized to 0.
Add a flag to skip writing zeroes in skimage.
Add a regression test for choosing the rowproc to ensure I did not
change any behavior accidentally.
BUG=skia:1661
R=reed@google.com
Review URL: https://codereview.chromium.org/24269006
git-svn-id: http://skia.googlecode.com/svn/trunk@11558 2bbb7eff-a529-9590-31e7-b0007b416f81
I'm seeing basically no difference between malloc + bzero and calloc on my desktop, but on a Galaxy Nexus calloc is never slower, and significantly faster once the allocation size becomes large, both for allocation and for _reading_.
BUG=skia:1662
R=reed@google.com
Review URL: https://codereview.chromium.org/24251008
git-svn-id: http://skia.googlecode.com/svn/trunk@11414 2bbb7eff-a529-9590-31e7-b0007b416f81
This is a patch by Andrei Parvu <parvu@adobe.com> (Adobe CLA signer).
Original CL/review: https://codereview.chromium.org/24078006/
GM:lumamode will need rebaselining after landing this.
---
In order to use CSS luminance masking, we need to be able to create an
instance of SkLumaXfermode which can receive a kSrcOver mode, and applies
that mode after converting the source using the luminance-to-alpha
coefficients.
BUG=289420
R=reed@google.com
Review URL: https://codereview.chromium.org/23710053
git-svn-id: http://skia.googlecode.com/svn/trunk@11312 2bbb7eff-a529-9590-31e7-b0007b416f81
This CL changes our convergence logic from
- did the last run take more than x milliseconds?
to
- did the last run take more x milliseconds and are the last two runs within y% of each other?
There's also now an upper limit where we bail out with an error if we haven't yet met the convergence criteria. Keeping the lower bound is important for benches where the constant overhead is much larger than the work done in the loop; without it we'll see T(1 loop) == T(2 loops) and converge way too early.
This CL also exposed that DeferredCanvasBench had a bug: it was running N^2 loops when we told it to run N. (My fault.)
I threw in a couple other linty changes that I'd be happy to split off.
BUG=
R=robertphillips@google.com
Review URL: https://codereview.chromium.org/23536046
git-svn-id: http://skia.googlecode.com/svn/trunk@11267 2bbb7eff-a529-9590-31e7-b0007b416f81
Obviously these are all currently function pointers of type T(*)(P) for various
T and P. In bench refactoring, I'm trying to register a function pointer of
type T(*)(), which can't be done as is (passing P=void doesn't work). This
also lets us register things like primitives, which is conceivable useful.
BUG=
R=reed@google.com, scroggo@google.com
Review URL: https://codereview.chromium.org/23453031
git-svn-id: http://skia.googlecode.com/svn/trunk@11082 2bbb7eff-a529-9590-31e7-b0007b416f81