skia2/tools/PictureRenderingFlags.h
scroggo@google.com bb281f7f96 Improvements/additions to SkImageCache/SkLazyPixelRef.
SkPurgeableImageCache:
New image cache that uses virtual memory to store the pixels. Combines
features of SkAshmemImageCache (which has been removed) with SkPurgeableMemoryBlock, which has android and Mac versions.

SkImageCache:
Modified the API. pinCache now returns a status out parameter which
states whether the pinned memory retained the old data. This allows
allocAndPinCache to only be used for allocations.
Add a new debug only interface to purge unpinned data.
Updates to documentation, clarifying behavior.
Changed CachedStatus to MemoryStatus

SkLruImageCache:
Implement the new function purgeAllUnpinnedCaches and change implementation
of pinCache for the new behavior.

SkLazyPixelRef:
Rewrite onLockPixels to account for the new behavior of pinCache.

BitmapFactoryTest:
Test the new SkPurgeableImageCache.
Write tests which directly test the SkImageCaches.
Create a larger bitmap, since some of the SkImageCaches are designed
to handle large bitmaps.

bench_ and render_pictures:
Consolidate lazy_decode_bitmap into one function.
Allow using a flag to specify using the purgeable image cache.
Clean up some #includes.

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

git-svn-id: http://skia.googlecode.com/svn/trunk@8207 2bbb7eff-a529-9590-31e7-b0007b416f81
2013-03-18 21:37:39 +00:00

34 lines
902 B
C++

/*
* Copyright 2013 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef PICTURE_RENDERING_FLAGS
#define PICTURE_RENDERING_FLAGS
class SkString;
namespace sk_tools {
class PictureRenderer;
}
enum PictureTool {
kBench_PictureTool,
kRender_PictureTool,
};
/**
* Uses SkFlags to parse the command line, and returns a PictureRenderer
* reflecting the flags used. Assumes that SkFlags::ParseCommandLine has
* been called.
* @param error If there is an error or warning, it will be stored in error.
* @param tool Which tool is being used.
* @return PictureRenderer A PictureRenderer with the settings specified
* on the command line, or NULL if the command line is invalid.
*/
sk_tools::PictureRenderer* parseRenderer(SkString& error, PictureTool tool);
#endif // PICTURE_RENDERING_FLAGS