History log of /external/skia/gm/factory.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
bcbc1788b478b1e54079318ad073e8490aa66fae 18-Jun-2014 tfarina <tfarina@chromium.org> Refactor how we handle resources path in Tests.

This idea emerged while doing https://codereview.chromium.org/321723002/
(commit 880914c35c8f7fc2e9c57134134c883baf66e538).

BUG=None
TEST=make tests && out/Debug/tests
R=mtklein@google.com

Author: tfarina@chromium.org

Review URL: https://codereview.chromium.org/346453002
/external/skia/gm/factory.cpp
f539318f0d3dba743ec1886d5d9df0fb1be628a1 10-Jun-2014 tfarina <tfarina@chromium.org> Cleanup: Get rid of make_isize() function from gm.h.

This helper function is not necessary.

The same thing can be achieved by using SkISize::Make() provided by
SkTSize API.

BUG=skia:2645
TEST=make dm && out/Debug/dm
R=robertphillips@google.com, reed@google.com

Author: tfarina@chromium.org

Review URL: https://codereview.chromium.org/326523002
/external/skia/gm/factory.cpp
880914c35c8f7fc2e9c57134134c883baf66e538 09-Jun-2014 tfarina <tfarina@chromium.org> Reland "Clean up Test's resourcePath code."

This relands commit 91359bed48bc006a4319da86eb26db3b2e6d4afb (Clean up
Test's resourcePath code."

BUG=None
TEST=make dm && out/Debug/dm
R=mtklein@google.com

Author: tfarina@chromium.org

Review URL: https://codereview.chromium.org/321723002
/external/skia/gm/factory.cpp
91359bed48bc006a4319da86eb26db3b2e6d4afb 08-Jun-2014 mtklein <mtklein@google.com> Revert of Clean up Test's resourcePath code. (https://codereview.chromium.org/319473003/)

Reason for revert:
Some benchmarks are written in a way that makes this change unsafe (e.g. const char* resPath = GetResourcePath().c_str(); in SkipZeroesBench) and Valgrind and ASAN caught that. We can try again after a more careful cleanup of GetResourcePath().

Original issue's description:
> Clean up resourcePath code.
>
> 1) Make the implementation of SetResourcePath/GetResourcePath of GM and SkBenchmark match with the one in Test.
> 2) Make gResourcePath a static pointer to const char and move it inside the classes.
>
> BUG=None
> TEST=make tests && out/Debug/tests
> make gm && out/Debug/gm
> make bench && out/Debug/bench
> R=mtklein@google.com
>
> Committed: https://skia.googlesource.com/skia/+/52e4f413ffe2d281f9e90ff2147db08083ffcba7

R=tfarina@chromium.org
TBR=tfarina@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=None

Author: mtklein@google.com

Review URL: https://codereview.chromium.org/320733002
/external/skia/gm/factory.cpp
52e4f413ffe2d281f9e90ff2147db08083ffcba7 08-Jun-2014 tfarina <tfarina@chromium.org> Clean up resourcePath code.

1) Make the implementation of SetResourcePath/GetResourcePath of GM and SkBenchmark match with the one in Test.
2) Make gResourcePath a static pointer to const char and move it inside the classes.

BUG=None
TEST=make tests && out/Debug/tests
make gm && out/Debug/gm
make bench && out/Debug/bench

R=mtklein@google.com

Author: tfarina@chromium.org

Review URL: https://codereview.chromium.org/319473003
/external/skia/gm/factory.cpp
2d970b5128f7270cd01a93e4ce68d0c3ea67ac71 27-May-2014 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> hide discardable factory from public imagegenerator api

BUG=skia:
R=halcanary@google.com, scroggo@google.com, djsollen@google.com

Author: reed@google.com

Review URL: https://codereview.chromium.org/295243006

git-svn-id: http://skia.googlecode.com/svn/trunk@14889 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/gm/factory.cpp
cf2f00872c559c892bb4b466bf678c7667490cce 04-Apr-2014 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> SkDiscardableMemoryPool to abstract class

Motivation - we want to keep our public headers small.

R=scroggo@google.com, reed@google.com

Author: halcanary@google.com

Review URL: https://codereview.chromium.org/223403012

git-svn-id: http://skia.googlecode.com/svn/trunk@14063 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/gm/factory.cpp
3d50ea1b87132833d7eab38964f40315ba553205 02-Jan-2014 halcanary@google.com <halcanary@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Add 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

Review URL: https://codereview.chromium.org/93703004

git-svn-id: http://skia.googlecode.com/svn/trunk@12855 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/gm/factory.cpp
1ad518bf38184ae820f31f9b79dfb4e4daf5841a 18-Dec-2013 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Revert of https://codereview.chromium.org/93703004/
Reason for revert: Test failures

R=scroggo@google.com, djsollen@google.com, reed@google.com, halcanary@google.com
TBR=djsollen@google.com, halcanary@google.com, reed@google.com, scroggo@google.com
NOTREECHECKS=true
NOTRY=true

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/103753007

git-svn-id: http://skia.googlecode.com/svn/trunk@12747 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/gm/factory.cpp
d665dc4c100f73272422dd17b4dd2c5d57a6b6de 18-Dec-2013 halcanary@google.com <halcanary@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Add 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

Review URL: https://codereview.chromium.org/93703004

git-svn-id: http://skia.googlecode.com/svn/trunk@12744 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/gm/factory.cpp
2c7c7ee47d75e7815ea8db05e924ab55958cb402 05-Dec-2013 halcanary@google.com <halcanary@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Big Cleanup: SkBitmapFactory, SkLazyPixelRef, SkImageCache

Removed SkBitmapFactory since no clients were using it. New cache
selection mechanism can simply pass a SkDiscardableMemory::Factory
into the SkDiscardablePixelRef if non-default SkDiscardableMemory
should be used. Removed BitmapFactoryTest.

SkDiscardableMemory::Factory interface. Android will need this
functionality in the future inside their BitmapFactory.

Removed SkLazyPixelRef, since it's functionality is now subsumed into
SkDiscardablePixelRef. Removed LazyPixelRef test.

Modified SkDiscardablePixelRef to optionally allow it to use a
SkDiscardableMemory::Factory. This tiny change makes it a replacement
for SkLazyPixelRef. This functioanlity is also necessary for moving
Android over to SkDiscardablePixelRef from SkImageRef in a later CL.
Added a test for this.

SkDecodingImageGenerator::Install can optionally pass a factory in to
SkDiscardablePixelRef.

Removed SkImageCache, SkLruImageCache, and SkPurgeableImageCache.
This functionality can be handled much more cleanly by
SkDiscardableMemory.

New SkDiscardableMemoryPool class to replace SkLruImageCache. In a
later CL, we will replace SkImageRef_GlobalPool (used by android) as
well. This is a concrete implementation of
SkDiscardableMemory::Factory. Added a test for this.

modified gm/factory.cpp to remove dependnce on SkBitmapFactory +
SkLruImageCache. Now uses SkDecodingImageGenerator +
SkDiscardablePixelRef + SkDiscardableMemoryPool.

SkImageDecoder::Target replaces SkBitmapFactory::Target. The
DecodeMemoryToTarget function may disappear in the future.

Moved SkLazyCachingPixelRef::DecodeProc replaces
SkBitmapFactory::DecodeProc. This is a short term change, since
another CL changes SkLazyCachingPixelRef to use SkImageGenerator
instead of DecodeProc.

Modified DrawBitmapRectTest to use SkDiscardablePixelRef instead of
SkLazyPixelRef.

tools/LazyDecodeBitmap.cpp now uses SkDecodingImageGenerator +
SkDiscardablePixelRef instead of a SkBitmapFactory.

bench_pictures uses the Global SkDiscardableMemoryPool instead of a
global gLruImageCache.

R=reed@google.com, scroggo@google.com

Review URL: https://codereview.chromium.org/103033002

git-svn-id: http://skia.googlecode.com/svn/trunk@12515 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/gm/factory.cpp
805df1aa1ddba876e6d18f9d2207d04c09415f9d 16-Aug-2013 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Fixes for factory GM.

Skip cross process pipe playback in gm/factory.cpp. Add a new flag to
gm.h to skip only this form of pipe playback.

In gmmain.cpp, use a bitmap encoder function for serialization that
stores the encoded data if present, and use a bitmap decoder on
deserialization. This allows gm/factory to work through serialization.
Also respect the new pipe skipping flag.

BUG=https://code.google.com/p/skia/issues/detail?id=1231
R=borenet@google.com

Author: scroggo@google.com

Review URL: https://chromiumcodereview.appspot.com/23192004

git-svn-id: http://skia.googlecode.com/svn/trunk@10786 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/gm/factory.cpp
ccd7afb6fb2df9774e57fb4d7f62f9504cabf03e 28-May-2013 scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Reland 'Add path utils, plus a test for it.'

Build SkPathJoin and SkBasename on windows also.

Previous CL did not build on Windows because the two functions were
accidentally placed inside an ifdef that did not include windows.
Move the functions to the top of the file, and add a comment by the
endif for clarity.

Previously reviewed at https://codereview.chromium.org/15747004/

Review URL: https://codereview.chromium.org/15740024

git-svn-id: http://skia.googlecode.com/svn/trunk@9295 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/gm/factory.cpp
dbbcaa8983c866187cdca6944717a72461bc8037 24-May-2013 scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Revert "Add path utils, plus a test for it."

This reverts commit d172374b46cae0bd5d7c024b9848f5bdafcc6a16.

This CL broke on Windows.

Review URL: https://codereview.chromium.org/15986004

git-svn-id: http://skia.googlecode.com/svn/trunk@9278 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/gm/factory.cpp
1bee03704408fad8df334f6193267774bb21231b 24-May-2013 scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Add path utils, plus a test for it.

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
/external/skia/gm/factory.cpp
9711e446676e6bf84b3fff916fd1d7537933a110 24-Apr-2013 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Move MMap to SkData.

R=reed@google.com

Author: bungeman@google.com

Review URL: https://chromiumcodereview.appspot.com/14336003

git-svn-id: http://skia.googlecode.com/svn/trunk@8848 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/gm/factory.cpp
a560d00ba5005ded8094a307ca41365bdf47cd50 04-Mar-2013 scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Provide an option in bench_pictures to count pixel ram.

In SkLruImageCache, provide an option to keep all pixels, and document
the new behavior.

In gm/factory.cpp, set the budget for the Lru image cache to 1, to
retain (basically) the old behavior.

BUG=https://code.google.com/p/skia/issues/detail?id=1010

Review URL: https://codereview.chromium.org/12378075

git-svn-id: http://skia.googlecode.com/svn/trunk@7972 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/gm/factory.cpp
f8d7d2731318cdf510ab68e6b3f5ec68ab22c8e2 22-Feb-2013 scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Create SkLazyPixelRef which performs lazy decoding.

The new pixel ref behaves similarly to SkImageRef, with some key differences:
It does not depend on the images project.
It requires an SkImageCache, which handles allocation and caching of the pixel
memory.
It takes a function signature for decoding which decodes into already allocated
pixel memory rather than into an SkBitmap.

Add two implementations of SkImageCache: SkLruImageCache and SkAshmemImageCache.

Replace SkSerializationHelpers::DecodeBitmap with SkPicture::InstallPixelRefProc,
and update sites that referenced it.

SkBitmapFactory now sets the pixel ref to a new object of the new
class SkLazyPixelRef, provided it has an SkImageCache for caching.

Provide an option to do lazy decodes in render_pictures and bench_pictures.

SkPicture:
Eliminate the default parameters in the constructor.
If a proc for decoding bitmaps is installed, use it to decode any encoded
data in subpictures.
When parsing deserializing subpictures, check for success.
When serializing subpictures, pass the picture's bitmap encoder to the
subpicture's call to serialize.

Update BitmapFactoryTest to test its new behavior.

BUG=https://code.google.com/p/skia/issues/detail?id=1008
BUG=https://code.google.com/p/skia/issues/detail?id=1009

Review URL: https://codereview.appspot.com/7060052

git-svn-id: http://skia.googlecode.com/svn/trunk@7835 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/gm/factory.cpp
9f686f3639ff87e6d28b4ffcc42feebeca90f8d8 29-Nov-2012 scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Create a factory to decode an SkBitmap from an SkData.

Add a test and a GM for the factory, and a PNG file for it to decode.
The PNG file is copyright-free, obtained from
http://openclipart.org/detail/29213/paper-plane-by-ddoo

In cmykjpeg, do not attempt to decode in the constructor, since it
currently crashes on Mac (if you provide the correct resource path).
Even when we fix this crash there is no need to do it in the
constructor, since we create all of the gms in order to
get their names (to determine whether to run them).

Review URL: https://codereview.appspot.com/6847122

git-svn-id: http://skia.googlecode.com/svn/trunk@6618 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/gm/factory.cpp