SkImage calls functions on SkImageDecoder and SkImageEncoder. This
is desired behavior, and it is also desired to include SkImage as
a part of core. In order to keep core from depending on images,
update SkImageDecoder_empty.cpp to implement all of SkImageDecoder
and SkImageEncoder. This file will be built by chrome (in
https://codereview.chromium.org/15960015).
Move force_linking from SkImageDecoder.cpp to its own file. It must
be called to force linking with the image decoders if desired. Call
the function in tools that need it:
sk_image
render_pictures
render_pdfs
sk_hello
filter
bench_pictures
debugger
SkImageDecoder:
Derive from SkNoncopyable, instead of duplicating its
hiding of constructors.
skhello:
Return rather than trying to write a null SkData to the stream.
Revert "Hamfistedly removed core dependence on images"
(commit 0f05f682a90bc125323677abf3476e1027d174f5) and
"Move SkImage::encode to SkImage_Codec.cpp."
(commit 83e47a954d0bf65439f3d9c0c93213063dd70da3.)
These two commits were temporary fixes that this change
cleans up.
SkSnapshot.cpp:
Check for a NULL encoder returned by SkImageEncoder::Create.
BUG=https://code.google.com/p/skia/issues/detail?id=1275R=djsollen@google.com, robertphillips@google.com
Review URL: https://codereview.chromium.org/15806010
git-svn-id: http://skia.googlecode.com/svn/trunk@9364 2bbb7eff-a529-9590-31e7-b0007b416f81
--tests is the only mandatory argument.
If you used to run this:
rebaseline.py aaclip bigmatrix
Run this instead:
rebaseline.py --tests aaclip bigmatrix
That's the only change you NEED to make.
And then, if you WANT to specify --configs, --subdirs, etc. you CAN.
R=senorblanco@chromium.org
Review URL: https://codereview.chromium.org/15675010
git-svn-id: http://skia.googlecode.com/svn/trunk@9348 2bbb7eff-a529-9590-31e7-b0007b416f81
SkOSFile:
Added class SkOSPath with functions for
modifying strings representing path names.
OSPathTest.cpp:
Test of the new utilities.
factory.cpp:
Use SkPathJoin.
gmmain and gm_expectations:
Use SkOSPath::SkPathJoin instead of a local version.
skimage_main.cpp:
Use the new location of SkPathJoin and SkBasename.
R=epoger@google.com
Review URL: https://codereview.chromium.org/15747004
git-svn-id: http://skia.googlecode.com/svn/trunk@9277 2bbb7eff-a529-9590-31e7-b0007b416f81
This change gives more flexibility to the implementation of
EncodeBitmap to prefer calling refEncodedData, doing its own
encode, or even doing both and making a decision about which
to use.
The new function signature also allows the implementation to
tell the ordered write buffer whether to store the pixel offset,
in the case where the encoded bitmap represents the larger
bitmap, or to ignore the pixel offset, in the case where the
implementation only encoded the subset that is used.
Requires changes to chromium to use the new function signature.
(https://codereview.chromium.org/15496006/)
SkPicture:
New API for EncodeBitmap.
SkOrderedReadBuffer:
Ifdef'd out addition of reading the offset.
SkOrderedWriteBuffer:
Never call refEncodedData. Allow the user to call that from their
EncodeBitmap function, if desired.
This addresses https://code.google.com/p/skia/issues/detail?id=1239
Add in ifdef'd out code to record the offset.
PictureTest and PictureRenderer:
Implement the new definition of EncodeBitmap. Also update the name
of the function to meet coding style guidelines.
BUG=https://code.google.com/p/skia/issues/detail?id=1239R=reed@google.com
Review URL: https://codereview.chromium.org/15489004
git-svn-id: http://skia.googlecode.com/svn/trunk@9226 2bbb7eff-a529-9590-31e7-b0007b416f81
If the expectation file exists, but the particular file being
decoded has no expectation, report a failure.
This is more appropriate since the intended use is that an
expectation will be created for each file. Without an expectation,
we cannot know whether the decoder has changed.
R=epoger@google.com
Review URL: https://codereview.chromium.org/15094011
git-svn-id: http://skia.googlecode.com/svn/trunk@9122 2bbb7eff-a529-9590-31e7-b0007b416f81
Add tests in skimage to perform region decoding. Write out a
PNG of the region as well as a bitmap obtained with extractSubset
for comparison.
Rename decodeRegion to decodeSubset, so it will not be confused
with SkRegion. (Leave a function called decodeRegion which calls
decodeSubset.)
Clean up some comments.
Use png_set_interlaced_pass instead of modifying pass directly.
Make some changes to region decoding to fix problems I discovered
during testing:
Only call getAddr within a valid range.
Check for a NULL fInputStream.
Return a boolean for whether cropBitmap succeeded.
In cropBitmap, do not attempt to draw to a bitmap to an Index8
bitmap, which crashes. Use extractSubset instead.
Remove an assert.
R=djsollen@google.com
Review URL: https://codereview.chromium.org/14567011
git-svn-id: http://skia.googlecode.com/svn/trunk@8996 2bbb7eff-a529-9590-31e7-b0007b416f81
Previously, each tool that wanted to use image decoders
but did not specifically reference them had to create a
dummy function that references them in order to ensure
they are not stripped by the linker.
Instead of making each tool reference each image decoder,
do it once in SkImageDecoder.cpp. Now each tool will have
image decoders linked in, assuming it includes the images
project.
This fixes a bug where SKPs with encoded data could not
be read by bench_ or render_pictures.
R=djsollen@google.com, robertphillips@google.com
Review URL: https://codereview.chromium.org/14678003
git-svn-id: http://skia.googlecode.com/svn/trunk@8941 2bbb7eff-a529-9590-31e7-b0007b416f81
skimage_main.cpp:
More changes in the interest of testing our decoders.
force_all_opaque before writing PNG files.
Test reencoding the image to its original type (if possible), and
then test redecoding it (to make sure the encoding was successful).
Add an option to turn off this behavior.
Merge decodeFileAndWrite with decodeFile.
SkImageDecoder:
Add kUnknown_Type to SkImageEncoder::Types.
Add a static function to get the Format of an SkStream.
In getFormatName(), remove an incorrect assert.
When calling the flavor of DecodeStream that returns the Format,
check the stream if the decoder returns kUnknown_Format.
BUG=https://code.google.com/p/skia/issues/detail?id=1241
Review URL: https://codereview.chromium.org/14363003
git-svn-id: http://skia.googlecode.com/svn/trunk@8862 2bbb7eff-a529-9590-31e7-b0007b416f81
In SkCommandLineFlags, if the client sets a default value
of multiple arguments (e.g. "arg0 arg1 ..."), set
the actual defaults to all of those arguments separately
(i.e. an array with [0] == "arg0", [1] == "arg1", ...),
rather than as one string (i.e. [0] == "arg0 arg1 ...").
Remove the hack that worked around this bug.
Also move the increasingly complicated implementation of
SkFlagInfo::CreateStringFlag into the cpp file.
BUG=https://code.google.com/p/skia/issues/detail?id=1237
Review URL: https://codereview.chromium.org/14366034
git-svn-id: http://skia.googlecode.com/svn/trunk@8845 2bbb7eff-a529-9590-31e7-b0007b416f81
Build SkImageDecoder_libgif in images project and link against
libgif on linux.
Ensure that the GIF decoder is used in skimage.
Requires a new dependency on libgif-dev when building on linux.
Review URL: https://codereview.chromium.org/14029011
git-svn-id: http://skia.googlecode.com/svn/trunk@8627 2bbb7eff-a529-9590-31e7-b0007b416f81
Allow passing files or folders on the command line.
Group the output to show all successes together, all failures
together, etc.
When writing a new png, do not make its file type ".png.png"
if the original was a png.
Force linking for JPEG decoder.
Use SkCommandLineFlags.
Review URL: https://codereview.chromium.org/14089002
git-svn-id: http://skia.googlecode.com/svn/trunk@8615 2bbb7eff-a529-9590-31e7-b0007b416f81