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

Side by Side Diff: src/image/SkImage_Raster.cpp

Issue 305483005: remove SkBitmap::asImageInfo (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/image/SkImagePriv.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "SkImage_Base.h" 8 #include "SkImage_Base.h"
9 #include "SkImagePriv.h" 9 #include "SkImagePriv.h"
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 SkBitmap src; 126 SkBitmap src;
127 if (!fBitmap.extractSubset(&src, subset)) { 127 if (!fBitmap.extractSubset(&src, subset)) {
128 return false; 128 return false;
129 } 129 }
130 return src.copyTo(dst, src.colorType()); 130 return src.copyTo(dst, src.colorType());
131 } 131 }
132 } 132 }
133 133
134 const void* SkImage_Raster::onPeekPixels(SkImageInfo* infoPtr, 134 const void* SkImage_Raster::onPeekPixels(SkImageInfo* infoPtr,
135 size_t* rowBytesPtr) const { 135 size_t* rowBytesPtr) const {
136 SkImageInfo info; 136 const SkImageInfo info = fBitmap.info();
137 if (!fBitmap.asImageInfo(&info) || !fBitmap.getPixels()) { 137 if ((kUnknown_SkColorType == info.colorType()) || !fBitmap.getPixels()) {
138 return NULL; 138 return NULL;
139 } 139 }
140 *infoPtr = info; 140 *infoPtr = info;
141 *rowBytesPtr = fBitmap.rowBytes(); 141 *rowBytesPtr = fBitmap.rowBytes();
142 return fBitmap.getPixels(); 142 return fBitmap.getPixels();
143 } 143 }
144 144
145 bool SkImage_Raster::getROPixels(SkBitmap* dst) const { 145 bool SkImage_Raster::getROPixels(SkBitmap* dst) const {
146 *dst = fBitmap; 146 *dst = fBitmap;
147 return true; 147 return true;
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 } 189 }
190 190
191 SkImage* SkNewImageFromPixelRef(const SkImageInfo& info, SkPixelRef* pr, 191 SkImage* SkNewImageFromPixelRef(const SkImageInfo& info, SkPixelRef* pr,
192 size_t rowBytes) { 192 size_t rowBytes) {
193 return SkNEW_ARGS(SkImage_Raster, (info, pr, rowBytes)); 193 return SkNEW_ARGS(SkImage_Raster, (info, pr, rowBytes));
194 } 194 }
195 195
196 SkPixelRef* SkBitmapImageGetPixelRef(SkImage* image) { 196 SkPixelRef* SkBitmapImageGetPixelRef(SkImage* image) {
197 return ((SkImage_Raster*)image)->getPixelRef(); 197 return ((SkImage_Raster*)image)->getPixelRef();
198 } 198 }
OLDNEW
« no previous file with comments | « src/image/SkImagePriv.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698