Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1835)

Unified Diff: Source/platform/graphics/ImageFrameGenerator.h

Issue 141483004: Optimization for image decoding using Skia discardable memory (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: done Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/platform/graphics/ImageFrameGenerator.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/ImageFrameGenerator.h
diff --git a/Source/platform/graphics/ImageFrameGenerator.h b/Source/platform/graphics/ImageFrameGenerator.h
index 8e2eae43295cd34434dbed38b17f46f081becb7f..2f7d49be02e2bbe1313ccfa37c0d7fe5301ff66f 100644
--- a/Source/platform/graphics/ImageFrameGenerator.h
+++ b/Source/platform/graphics/ImageFrameGenerator.h
@@ -86,13 +86,14 @@ public:
bool hasAlpha(size_t);
private:
+ class ExternalMemoryAllocator;
friend class ImageFrameGeneratorTest;
friend class DeferredImageDecoderTest;
// For testing. |factory| will overwrite the default ImageDecoder creation logic if |factory->create()| returns non-zero.
void setImageDecoderFactory(PassOwnPtr<ImageDecoderFactory> factory) { m_imageDecoderFactory = factory; }
// For testing.
- SkBitmap::Allocator* allocator() const { return m_allocator.get(); }
- void setAllocator(PassOwnPtr<SkBitmap::Allocator> allocator) { m_allocator = allocator; }
+ SkBitmap::Allocator* allocator() const { return m_discardableAllocator.get(); }
+ void setAllocator(PassOwnPtr<SkBitmap::Allocator> allocator) { m_discardableAllocator = allocator; }
// These methods are called while m_decodeMutex is locked.
const ScaledImageFragment* tryToLockCompleteCache(const SkISize& scaledSize, size_t index);
@@ -112,7 +113,8 @@ private:
bool m_decodeFailedAndEmpty;
Vector<bool> m_hasAlpha;
size_t m_decodeCount;
- OwnPtr<SkBitmap::Allocator> m_allocator;
+ OwnPtr<SkBitmap::Allocator> m_discardableAllocator;
+ OwnPtr<ExternalMemoryAllocator> m_externalAllocator;
OwnPtr<ImageDecoderFactory> m_imageDecoderFactory;
« no previous file with comments | « no previous file | Source/platform/graphics/ImageFrameGenerator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698