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

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

Issue 1528383004: Remove SkImageMinRowBytes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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
« no previous file with comments | « src/image/SkImagePriv.h ('k') | tests/ImageFrom565Bitmap.cpp » ('j') | 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 "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 30 matching lines...) Expand all
41 41
42 if (kUnknown_SkColorType == info.colorType()) { 42 if (kUnknown_SkColorType == info.colorType()) {
43 return false; 43 return false;
44 } 44 }
45 45
46 const bool needsCT = kIndex_8_SkColorType == info.colorType(); 46 const bool needsCT = kIndex_8_SkColorType == info.colorType();
47 if (needsCT != hasColorTable) { 47 if (needsCT != hasColorTable) {
48 return false; 48 return false;
49 } 49 }
50 50
51 if (rowBytes < SkImageMinRowBytes(info)) { 51 if (rowBytes < info.minRowBytes()) {
52 return false; 52 return false;
53 } 53 }
54 54
55 size_t size = info.getSafeSize(rowBytes); 55 size_t size = info.getSafeSize(rowBytes);
56 if (0 == size) { 56 if (0 == size) {
57 return false; 57 return false;
58 } 58 }
59 59
60 if (minSize) { 60 if (minSize) {
61 *minSize = size; 61 *minSize = size;
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 // pixelref since the caller might call setImmutable() themselves 285 // pixelref since the caller might call setImmutable() themselves
286 // (thus changing our state). 286 // (thus changing our state).
287 if (fBitmap.isImmutable()) { 287 if (fBitmap.isImmutable()) {
288 bitmap->setInfo(fBitmap.info(), fBitmap.rowBytes()); 288 bitmap->setInfo(fBitmap.info(), fBitmap.rowBytes());
289 bitmap->setPixelRef(fBitmap.pixelRef(), fBitmap.pixelRefOrigin()); 289 bitmap->setPixelRef(fBitmap.pixelRef(), fBitmap.pixelRefOrigin());
290 return true; 290 return true;
291 } 291 }
292 } 292 }
293 return this->INHERITED::onAsLegacyBitmap(bitmap, mode); 293 return this->INHERITED::onAsLegacyBitmap(bitmap, mode);
294 } 294 }
OLDNEW
« no previous file with comments | « src/image/SkImagePriv.h ('k') | tests/ImageFrom565Bitmap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698