Enabling Perlin Noise on Android
I enabled the Perlin Noise shader on Android after doing some minor modifications to the shader, specifically for Android (and #ifdefed for Android, to make sure none of this affects other platforms).
For Tegra devices (Nexus 7, Xoom), a precision issue related to the color values read from textures caused the noise to read the wrong indices and produce bad noise. I fixed this by adding a founding of the values read by simply doing the equivalent of "colorValue = floor(colorValue * 255.0) / 255.0" to make sure we retrieve the colors that were written in the texture originally.
For non-Tegra devices (Nexus 10), dealing with values in the order of 4096.0 was problematic without using the "highp" precision setting. To solve this, a few variables were given the high precision setting.
Since both fixes don't seem to do considerable harm to the platforms that are not being targetted, I left both fixes on all android devices for now.
I also reduced the Perlin noise gm so that it takes less time to test it on the Xoom (Original time was about 20 seconds, this shold take less than 10, hopefully)
BUG=
R=senorblanco@google.com, bsalomon@google.com, sugoi@google.com, senorblanco@chromium.org
Author: sugoi@chromium.org
Review URL: https://chromiumcodereview.appspot.com/16818013
git-svn-id: http://skia.googlecode.com/svn/trunk@9637 2bbb7eff-a529-9590-31e7-b0007b416f81
Replace SkTDArray with SkTArray and use SkSTArray when
the probable array size is known.
In a couple of places (spans, chases) the arrays are
constructed using insert() so SkTArrays can't be used for
now.
Also, add an optimization to cubic subdivide if either end
is zero or one.
BUG=
Review URL: https://codereview.chromium.org/16951017
git-svn-id: http://skia.googlecode.com/svn/trunk@9635 2bbb7eff-a529-9590-31e7-b0007b416f81
SkImageDecoder_CG.cpp:
If a non opaque bitmap was decoded, and the caller wants
unpremultiplied, unpremultiply the colors.
Always use the RGB colorspace, since the other colorspaces
do not match the desired bitmap format.
ImageDecodingTest:
Allow for a difference of 1 in each color component when comparing
the result of premultiplying the unpremultiplied decode with the
premultiplied decode, since I found an image (in WEBP format) where
the unpremultiplied colors did not compare perfectly in my comparison.
R=reed@google.com
Review URL: https://codereview.chromium.org/17084012
git-svn-id: http://skia.googlecode.com/svn/trunk@9628 2bbb7eff-a529-9590-31e7-b0007b416f81
Currently they cannot be used directly by Skia, but
the pixels can be used elsewhere.
SkImageDecoder:
Add functions to require unpremultiplied output
and query the presence of the requirement
SkImageDecoder_libpng:
SkImageDecoder_libwebp:
SkImageDecoder_WIC:
Respect the requirement for unpremultiplied output.
TODO: Fix SkImageDecoder_CG.
SkScaledBitmapSampler:
Add procs to skip premultiplication and a boolean
parameter to use those procs.
ImageDecodingTest:
Test unpremultiplied bitmap decoding.
SampleUnpremul:
Add a sample which allows visually comparing between the
unpremultiplied version (copied into a premultiplied bitmap,
since drawing unpremultiplied is not currently supported)
and a premultiplied version of image files.
gm.h:
Add a getter for the resource path, so Samples can use it.
As of patch set 13, https://codereview.chromium.org/16816016/
and https://codereview.chromium.org/16983004/, which were
approved separately.
R=reed@google.com
Review URL: https://codereview.chromium.org/16410009
git-svn-id: http://skia.googlecode.com/svn/trunk@9612 2bbb7eff-a529-9590-31e7-b0007b416f81
SkDebugCanvas & friends are useful beyond the Qt debugger app - Chromium's picture inspector (in development) is at the point where it could take advantage of it.
This patch moves SkDrawCommand, SkDebugCanvas & SkObjectParser from trunk/debugger to trunk/src/utils (since several tools already use these, this seems appropriate), and makes SkDrawCommand & SkDebugCanvas' symbols visible externally (SK_API).
R=reed@google.com
Review URL: https://codereview.chromium.org/16638014
git-svn-id: http://skia.googlecode.com/svn/trunk@9598 2bbb7eff-a529-9590-31e7-b0007b416f81
The unpremul/remul code has been placed behind a gUseUnpremul global, which is default false. The non-unpremul path uses a min() to keep the colours to valid premult values.
Note: This change will require new baselines for the arithmode and xfermodeimagefilter GMs.
R=reed@google.com
Review URL: https://codereview.chromium.org/16034013
git-svn-id: http://skia.googlecode.com/svn/trunk@9555 2bbb7eff-a529-9590-31e7-b0007b416f81