The skyline Rectanizer tracks the leading silhouette of the
currently packed rects and tries to fit the next rectangle
on top of that. This gives slightly better packing behavior
than the current log2 scheme.
Also shrank the size of the plots, which increases their
number from 18 to 32 and gives better cache behavior (fewer
purges and uploads).
R=bsalomon@google.com
Author: jvanverth@google.com
Review URL: https://codereview.chromium.org/25584002
git-svn-id: http://skia.googlecode.com/svn/trunk@11577 2bbb7eff-a529-9590-31e7-b0007b416f81
To dodge the problem, call computeBounds when creating the global empty path
ref.
There's still another race here, which is that we can race to create the empty
path ref in the first place. As written we can conceivably allocate an
arbitrary number of empty path refs, one of which ends up pointed to by the
global variable at the end.
I've punted on fixing this for now because 1) tsan has not complained yet; 2) I
think it can be fixed by the same approach as we can fix the memsets in
25415003, so I want to wait to see how that review goes
first.
BUG=
R=reed@google.com, robertphillips@google.com
Author: mtklein@google.com
Review URL: https://codereview.chromium.org/25745003
git-svn-id: http://skia.googlecode.com/svn/trunk@11576 2bbb7eff-a529-9590-31e7-b0007b416f81
These guys are not heavily contended nor speed critical. No need for atomics,
plus this makes tsan stop complaining (correctly) about reading fNextIndex
unsafely in onEnd.
I took a look at failCount/fFailCount, which I think is safely atomic and quite
conveniently so: It's never read until all the threads which could possibly
increment it have terminated (except for the one where it was created,
obviously). We could guard it with a mutex too, but maybe we can let this one
slide.
BUG=
R=bungeman@google.com
Author: mtklein@google.com
Review URL: https://codereview.chromium.org/25357002
git-svn-id: http://skia.googlecode.com/svn/trunk@11561 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
Replace the current constructor for creating an
SkPicturePlayback to a factory. In the factory,
check for incorrect data that would result in an invalid
playback. If the playback is invalid, return NULL, and
return NULL from SkPicture's factory as well.
Update SkTimedPicture(Playback) as well.
BUG=skia:1672
R=caryclark@google.com
Review URL: https://codereview.chromium.org/24826002
git-svn-id: http://skia.googlecode.com/svn/trunk@11554 2bbb7eff-a529-9590-31e7-b0007b416f81
Adds a 'hasVertexCode' method to GrEffect and a 'fHasVertexCode' field
to GrGLProgramDesc::KeyHeader. Also adds a GrVertexEffect class that
effects have to inherit from in order to set the 'hasVertexCode' flag
and be able to emit vertex code, and updates the existing effects to
use it as needed.
R=bsalomon@google.com
Author: cdalton@nvidia.com
Review URL: https://codereview.chromium.org/23653059
git-svn-id: http://skia.googlecode.com/svn/trunk@11537 2bbb7eff-a529-9590-31e7-b0007b416f81
Extracts a GrCustomCoordsTextureEffect class from
GrSimpleTextureEffect. This way there are no effects that can
conditionally require a vertex shader. They either always need one or
never do. Also removes kCustom_CoordsType from the CoordsType enum in
GrEffect (that enum is really only meant for coords provided by the
framework), and updates GrSimpleTextureEffect::TestCreate to make the
effect with position as well, instead of just local coords.
R=bsalomon@google.com
Author: cdalton@nvidia.com
Review URL: https://codereview.chromium.org/24018007
git-svn-id: http://skia.googlecode.com/svn/trunk@11531 2bbb7eff-a529-9590-31e7-b0007b416f81
android_ninja {tests,bench,gm,bench_pictures,render_pictures} all build and run
fine. They build so fast I thought maybe they were broken.
Note that android_ninja with no argument is failing:
ninja: Entering directory `out/config/android-arm_v7_thumb/Debug'
ninja: error: 'lib.target/libSampleApp.so', needed by 'android/libs/armeabi-v7a/libSampleApp.so', missing and no known rule to make it
Will look into this.
BUG=
R=djsollen@google.com
Committed: https://code.google.com/p/skia/source/detail?r=11525
Review URL: https://codereview.chromium.org/24833002
git-svn-id: http://skia.googlecode.com/svn/trunk@11527 2bbb7eff-a529-9590-31e7-b0007b416f81
android_ninja {tests,bench,gm,bench_pictures,render_pictures} all build and run
fine. They build so fast I thought maybe they were broken.
Note that android_ninja with no argument is failing:
ninja: Entering directory `out/config/android-arm_v7_thumb/Debug'
ninja: error: 'lib.target/libSampleApp.so', needed by 'android/libs/armeabi-v7a/libSampleApp.so', missing and no known rule to make it
Will look into this.
BUG=
R=djsollen@google.com
Review URL: https://codereview.chromium.org/24833002
git-svn-id: http://skia.googlecode.com/svn/trunk@11525 2bbb7eff-a529-9590-31e7-b0007b416f81