summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhalcanary@google.com <halcanary@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-12-05 18:31:42 +0000
committerhalcanary@google.com <halcanary@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-12-05 18:31:42 +0000
commita10662e47e520014f5aad5ce162edb8c9a81c2db (patch)
treeeb174127bddc3776bd9e5772cceac18b380c5158
parentbb499be8aaa7a79f1004db7aa264850a74de8a85 (diff)
downloadgyp-a10662e47e520014f5aad5ce162edb8c9a81c2db.tar.gz
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/gyp@12515 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r--SampleApp.gyp2
-rw-r--r--core.gypi14
-rw-r--r--dm.gyp2
-rw-r--r--gm.gyp2
-rw-r--r--images.gyp1
-rw-r--r--public_headers.gypi4
-rw-r--r--tests.gyp2
-rw-r--r--tools.gyp8
8 files changed, 16 insertions, 19 deletions
diff --git a/SampleApp.gyp b/SampleApp.gyp
index c2f0950..16a5c30 100644
--- a/SampleApp.gyp
+++ b/SampleApp.gyp
@@ -12,6 +12,8 @@
'include_dirs' : [
'../src/core',
'../src/effects', #needed for BlurMask.h
+ '../src/images',
+ '../src/lazy',
'../gm', # needed to pull gm.h
'../samplecode', # To pull SampleApp.h and SampleCode.h
'../src/pipe/utils', # For TiledPipeController
diff --git a/core.gypi b/core.gypi
index 4bb4d51..69e8a56 100644
--- a/core.gypi
+++ b/core.gypi
@@ -71,6 +71,7 @@
'<(skia_src_path)/core/SkDevice.cpp',
'<(skia_src_path)/core/SkDeviceLooper.cpp',
'<(skia_src_path)/core/SkDeviceProfile.cpp',
+ '<(skia_src_path)/lazy/SkDiscardableMemoryPool.cpp',
'<(skia_src_path)/lazy/SkDiscardablePixelRef.cpp',
'<(skia_src_path)/core/SkDither.cpp',
'<(skia_src_path)/core/SkDraw.cpp',
@@ -307,19 +308,6 @@
'<(skia_include_path)/core/SkXfermode.h',
# Lazy decoding:
- '<(skia_include_path)/lazy/SkBitmapFactory.h',
- '<(skia_include_path)/lazy/SkImageCache.h',
- '<(skia_include_path)/lazy/SkLruImageCache.h',
- '<(skia_include_path)/lazy/SkPurgeableImageCache.h',
-
- '<(skia_src_path)/lazy/SkBitmapFactory.cpp',
- '<(skia_src_path)/lazy/SkLazyPixelRef.h',
- '<(skia_src_path)/lazy/SkLazyPixelRef.cpp',
- '<(skia_src_path)/lazy/SkLruImageCache.cpp',
- '<(skia_src_path)/lazy/SkPurgeableMemoryBlock.h',
- '<(skia_src_path)/lazy/SkPurgeableMemoryBlock_common.cpp',
- '<(skia_src_path)/lazy/SkPurgeableImageCache.cpp',
-
'<(skia_src_path)/lazy/SkCachingPixelRef.cpp',
'<(skia_src_path)/lazy/SkCachingPixelRef.h',
diff --git a/dm.gyp b/dm.gyp
index 7d8d5d8..8fa59c5 100644
--- a/dm.gyp
+++ b/dm.gyp
@@ -9,6 +9,8 @@
'include_dirs': [
'../dm',
'../gm',
+ '../src/images',
+ '../src/lazy',
'../src/core',
'../src/effects',
'../src/pipe/utils/',
diff --git a/gm.gyp b/gm.gyp
index bc70e16..a543aca 100644
--- a/gm.gyp
+++ b/gm.gyp
@@ -29,6 +29,8 @@
'type': 'executable',
'include_dirs' : [
'../src/core',
+ '../src/images',
+ '../src/lazy',
'../src/effects',
'../src/pipe/utils/',
'../src/utils/',
diff --git a/images.gyp b/images.gyp
index e16a41f..6cc8965 100644
--- a/images.gyp
+++ b/images.gyp
@@ -38,6 +38,7 @@
'../src/images/bmpdecoderhelper.h',
'../src/images/SkDecodingImageGenerator.cpp',
+ '../src/images/SkDecodingImageGenerator.h',
'../src/images/SkForceLinking.cpp',
'../src/images/SkImageDecoder.cpp',
'../src/images/SkImageDecoder_FactoryDefault.cpp',
diff --git a/public_headers.gypi b/public_headers.gypi
index b209e71..45114e8 100644
--- a/public_headers.gypi
+++ b/public_headers.gypi
@@ -297,10 +297,6 @@
'views/SkOSWindow_Unix.h',
'views/SkWidget.h',
'views/SkOSWindow_Win.h',
- 'lazy/SkBitmapFactory.h',
- 'lazy/SkImageCache.h',
- 'lazy/SkPurgeableImageCache.h',
- 'lazy/SkLruImageCache.h',
],
},
}
diff --git a/tests.gyp b/tests.gyp
index aa228c5..ed1d077 100644
--- a/tests.gyp
+++ b/tests.gyp
@@ -33,7 +33,6 @@
'../tests/ARGBImageEncoderTest.cpp',
'../tests/AtomicTest.cpp',
'../tests/BitmapCopyTest.cpp',
- '../tests/BitmapFactoryTest.cpp',
'../tests/BitmapGetColorTest.cpp',
'../tests/BitmapHasherTest.cpp',
'../tests/BitmapHeapTest.cpp',
@@ -56,6 +55,7 @@
'../tests/DeferredCanvasTest.cpp',
'../tests/DequeTest.cpp',
'../tests/DeviceLooperTest.cpp',
+ '../tests/DiscardableMemoryPool.cpp',
'../tests/DocumentTest.cpp',
'../tests/DrawBitmapRectTest.cpp',
'../tests/DrawPathTest.cpp',
diff --git a/tools.gyp b/tools.gyp
index b6086d5..04d4e3f 100644
--- a/tools.gyp
+++ b/tools.gyp
@@ -211,6 +211,9 @@
'../tools/render_pictures_main.cpp',
],
'include_dirs': [
+ '../src/core',
+ '../src/images',
+ '../src/lazy',
'../src/pipe/utils/',
],
'dependencies': [
@@ -232,6 +235,7 @@
'../tools/PictureBenchmark.cpp',
],
'include_dirs': [
+ '../src/core/',
'../bench',
'../src/lazy/',
],
@@ -258,7 +262,9 @@
'../src/pipe/utils/SamplePipeControllers.cpp',
],
'include_dirs': [
- '../src/core/',
+ '../src/core',
+ '../src/images',
+ '../src/lazy',
'../src/pipe/utils/',
'../src/utils/',
],