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

Unified Diff: src/lazy/SkLazyPixelRef.cpp

Issue 54363008: move SkImage::ColorType into SkColorType (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 1 month 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 | « src/lazy/SkLazyPixelRef.h ('k') | src/ports/SkImageDecoder_empty.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/lazy/SkLazyPixelRef.cpp
diff --git a/src/lazy/SkLazyPixelRef.cpp b/src/lazy/SkLazyPixelRef.cpp
index 59df15fc42b3e878dc7e42f671e327a05cc8a7e4..c2ca041b41da71e372be13cbc9c0cc4591440046 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);
« no previous file with comments | « src/lazy/SkLazyPixelRef.h ('k') | src/ports/SkImageDecoder_empty.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698