DescriptionAdd Options to SkDecodingImageGenerator, simplify API.
Motivation: We want to remove redundant classes from Skia. To
that end we want to remove SkImageRef and its subclasses and
replace their uses with SkDiscardablePixelRef +
SkDecodingImageGenerator. Since Android uses SkImageRef, we need
to make sure that SkDecodingImageGenerator allows all of the
settings that Android exposes in BitmapFactory.Options.
To that end, we have created an Options struct for the
SkDecodingImageGenerator which lets the client of the generator set
sample size, dithering, and bitmap config.
We have made the SkDecodingImageGenerator constructor private
and replaced the SkDecodingImageGenerator::Install functions
with a SkDecodingImageGenerator::Create functions (one for
SkData and one for SkStream) which now take a
SkDecodingImageGenerator::Options struct.
Also added a ImageDecoderOptions test which loops through a list
of sets of options and tries them on a set of 5 small encoded
images.
Also updated several users of SkDecodingImageGenerator::Install to
follow new call signature - gm/factory.cpp, LazyDecodeBitmap.cpp,
and PictureTest.cpp, CachedDecodingPixelRefTest.cpp.
We also added a new ImprovedBitmapFactory Test which simulates the
exact function that Android will need to modify to use this,
installPixelRef() in BitmapFactory.
R=reed@google.com, scroggo@google.com
Committed: https://code.google.com/p/skia/source/detail?r=12744
Committed: https://code.google.com/p/skia/source/detail?r=12855
Patch Set 1 #
Total comments: 24
Patch Set 2 : extensive refactor #Patch Set 3 : 1 #
Total comments: 17
Patch Set 4 : rebase, verified builds #Patch Set 5 : changes from scroggo #Patch Set 6 : whitespace #Patch Set 7 : rebase #
Total comments: 2
Patch Set 8 : rebase, comments #
Total comments: 9
Patch Set 9 : rebase to remove binaries #Patch Set 10 : changes from reed #
Total comments: 6
Patch Set 11 : test samplesize only on android/linux #Patch Set 12 : rebase on 116423006 #Patch Set 13 : final rebase #Patch Set 14 : better reporting in unit tests #Patch Set 15 : compile on windows #Patch Set 16 : one more thing to check #Patch Set 17 : final #Patch Set 18 : rebase again #Patch Set 19 : rebased #
Messages
Total messages: 21 (0 generated)
|