diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-11-01 13:46:54 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-11-01 13:46:54 +0000 |
commit | 2bd8b8100529c96c81c30f749f672f4caf775b04 (patch) | |
tree | 5a7468a4570ecf07a7089afbfbfeebb5c773555c /src/lazy | |
parent | 05d56ebbf385c8723c9bed3409739055afa3b073 (diff) |
move SkImage::ColorType into SkColorType
objective -- move clients over to SkImage
tasks
- use SkImageInfo instead of SkBitmap::Config
- add support for colortables to SkImage
- add drawImage to SkCanvas
- return SkImage from readPixels
This CL works towards the first task
R=robertphillips@google.com
Review URL: https://codereview.chromium.org/54363008
git-svn-id: http://skia.googlecode.com/svn/trunk@12077 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/lazy')
-rw-r--r-- | src/lazy/SkBitmapFactory.cpp | 2 | ||||
-rw-r--r-- | src/lazy/SkLazyPixelRef.cpp | 18 | ||||
-rw-r--r-- | src/lazy/SkLazyPixelRef.h | 2 |
3 files changed, 11 insertions, 11 deletions
diff --git a/src/lazy/SkBitmapFactory.cpp b/src/lazy/SkBitmapFactory.cpp index 5464851402..1bbb6f0de7 100644 --- a/src/lazy/SkBitmapFactory.cpp +++ b/src/lazy/SkBitmapFactory.cpp @@ -48,7 +48,7 @@ bool SkBitmapFactory::installPixelRef(SkData* data, SkBitmap* dst) { return false; } - SkImage::Info info; + SkImageInfo info; if (!fDecodeProc(data->data(), data->size(), &info, NULL)) { return false; } diff --git a/src/lazy/SkLazyPixelRef.cpp b/src/lazy/SkLazyPixelRef.cpp index 59df15fc42..c2ca041b41 100644 --- a/src/lazy/SkLazyPixelRef.cpp +++ b/src/lazy/SkLazyPixelRef.cpp @@ -68,7 +68,7 @@ SkLazyPixelRef::~SkLazyPixelRef() { fImageCache->unref(); } -static size_t ComputeMinRowBytesAndSize(const SkImage::Info& info, size_t* rowBytes) { +static size_t ComputeMinRowBytesAndSize(const SkImageInfo& info, size_t* rowBytes) { *rowBytes = SkImageMinRowBytes(info); Sk64 safeSize; @@ -80,9 +80,9 @@ static size_t ComputeMinRowBytesAndSize(const SkImage::Info& info, size_t* rowBy return safeSize.is32() ? safeSize.get32() : 0; } -const SkImage::Info* SkLazyPixelRef::getCachedInfo() { +const SkImageInfo* SkLazyPixelRef::getCachedInfo() { if (fLazilyCachedInfo.fWidth < 0) { - SkImage::Info info; + SkImageInfo info; fErrorInDecoding = !fDecodeProc(fData->data(), fData->size(), &info, NULL); if (fErrorInDecoding) { return NULL; @@ -94,7 +94,7 @@ const SkImage::Info* SkLazyPixelRef::getCachedInfo() { /** Returns bitmap->getPixels() on success; NULL on failure */ -static void* decode_into_bitmap(SkImage::Info* info, +static void* decode_into_bitmap(SkImageInfo* info, SkBitmapFactory::DecodeProc decodeProc, size_t* rowBytes, SkData* data, @@ -122,7 +122,7 @@ void* SkLazyPixelRef::lockScaledImageCachePixels() { SkASSERT(!fErrorInDecoding); SkASSERT(NULL == fImageCache); SkBitmap bitmap; - const SkImage::Info* info = this->getCachedInfo(); + const SkImageInfo* info = this->getCachedInfo(); if (info == NULL) { return NULL; } @@ -147,7 +147,7 @@ void* SkLazyPixelRef::lockScaledImageCachePixels() { return pixels; } else { // Cache has been purged, must re-decode. - void* pixels = decode_into_bitmap(const_cast<SkImage::Info*>(info), + void* pixels = decode_into_bitmap(const_cast<SkImageInfo*>(info), fDecodeProc, &fRowBytes, fData, &bitmap); if (NULL == pixels) { @@ -204,7 +204,7 @@ void* SkLazyPixelRef::lockImageCachePixels() { SkASSERT(fData != NULL && fData->size() > 0); if (NULL == target.fAddr) { - const SkImage::Info* info = this->getCachedInfo(); + const SkImageInfo* info = this->getCachedInfo(); if (NULL == info) { SkASSERT(SkImageCache::UNINITIALIZED_ID == fCacheId); return NULL; @@ -262,7 +262,7 @@ SkData* SkLazyPixelRef::onRefEncodedData() { return fData; } -static bool init_from_info(SkBitmap* bm, const SkImage::Info& info, +static bool init_from_info(SkBitmap* bm, const SkImageInfo& info, size_t rowBytes) { SkBitmap::Config config = SkImageInfoToBitmapConfig(info); if (SkBitmap::kNo_Config == config) { @@ -284,7 +284,7 @@ bool SkLazyPixelRef::onDecodeInto(int pow2, SkBitmap* bitmap) { return false; } - SkImage::Info info; + SkImageInfo info; // Determine the size of the image in order to determine how much memory to allocate. // FIXME: As an optimization, only do this part once. fErrorInDecoding = !fDecodeProc(fData->data(), fData->size(), &info, NULL); diff --git a/src/lazy/SkLazyPixelRef.h b/src/lazy/SkLazyPixelRef.h index c7fbd7be65..f8a16d1689 100644 --- a/src/lazy/SkLazyPixelRef.h +++ b/src/lazy/SkLazyPixelRef.h @@ -77,7 +77,7 @@ private: SkScaledImageCache::ID* fScaledCacheId; }; size_t fRowBytes; - SkImage::Info fLazilyCachedInfo; + SkImageInfo fLazilyCachedInfo; #if LAZY_CACHE_STATS static int32_t gCacheHits; |