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

Side by Side Diff: src/lazy/SkBitmapFactory.cpp

Issue 68973005: Expand pixelref to return SkImageInfo and rowbytes (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: new convention: require SkImageInfo in constructor Created 7 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkBitmapFactory.h" 8 #include "SkBitmapFactory.h"
9 9
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 dst->setConfig(config, info.fWidth, info.fHeight, target.fRowBytes, info.fAl phaType); 62 dst->setConfig(config, info.fWidth, info.fHeight, target.fRowBytes, info.fAl phaType);
63 63
64 // fImageCache and fCacheSelector are mutually exclusive. 64 // fImageCache and fCacheSelector are mutually exclusive.
65 SkASSERT(NULL == fImageCache || NULL == fCacheSelector); 65 SkASSERT(NULL == fImageCache || NULL == fCacheSelector);
66 66
67 SkImageCache* cache = NULL == fCacheSelector ? fImageCache : fCacheSelector- >selectCache(info); 67 SkImageCache* cache = NULL == fCacheSelector ? fImageCache : fCacheSelector- >selectCache(info);
68 68
69 if (cache != NULL) { 69 if (cache != NULL) {
70 // Now set a new LazyPixelRef on dst. 70 // Now set a new LazyPixelRef on dst.
71 SkAutoTUnref<SkLazyPixelRef> lazyRef(SkNEW_ARGS(SkLazyPixelRef, 71 SkAutoTUnref<SkLazyPixelRef> lazyRef(SkNEW_ARGS(SkLazyPixelRef,
72 (data, fDecodeProc, cach e))); 72 (info, data, fDecodeProc, cache)));
73 dst->setPixelRef(lazyRef); 73 dst->setPixelRef(lazyRef);
74 return true; 74 return true;
75 } else { 75 } else {
76 dst->allocPixels(); 76 dst->allocPixels();
77 target.fAddr = dst->getPixels(); 77 target.fAddr = dst->getPixels();
78 return fDecodeProc(data->data(), data->size(), &info, &target); 78 return fDecodeProc(data->data(), data->size(), &info, &target);
79 } 79 }
80 } 80 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698