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

Side by Side Diff: src/core/SkBitmapProcState.cpp

Issue 27530003: check of fScaledBitmap failed to lock (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 2 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 | « no previous file | 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 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #include "SkBitmapProcState.h" 8 #include "SkBitmapProcState.h"
9 #include "SkColorPriv.h" 9 #include "SkColorPriv.h"
10 #include "SkFilterProc.h" 10 #include "SkFilterProc.h"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 // the scanline proc handle it. 152 // the scanline proc handle it.
153 return false; 153 return false;
154 154
155 } 155 }
156 fScaledCacheID = SkScaledImageCache::AddAndLock(fOrigBitmap, 156 fScaledCacheID = SkScaledImageCache::AddAndLock(fOrigBitmap,
157 invScaleX, 157 invScaleX,
158 invScaleY, 158 invScaleY,
159 fScaledBitmap); 159 fScaledBitmap);
160 } 160 }
161 fScaledBitmap.lockPixels(); // wonder if Resize() should have locked thi s 161 fScaledBitmap.lockPixels(); // wonder if Resize() should have locked thi s
162 if (!fScaledBitmap.getPixels()) {
163 // TODO: find out how this can happen, and add a unittest to exercis e
164 // inspired by BUG=chromium:295895
165 return false;
166 }
167
162 fBitmap = &fScaledBitmap; 168 fBitmap = &fScaledBitmap;
163 169
164 // set the inv matrix type to translate-only; 170 // set the inv matrix type to translate-only;
165 fInvMatrix.setTranslate(fInvMatrix.getTranslateX() / fInvMatrix.getScale X(), 171 fInvMatrix.setTranslate(fInvMatrix.getTranslateX() / fInvMatrix.getScale X(),
166 fInvMatrix.getTranslateY() / fInvMatrix.getScale Y()); 172 fInvMatrix.getTranslateY() / fInvMatrix.getScale Y());
167 173
168 // no need for any further filtering; we just did it! 174 // no need for any further filtering; we just did it!
169 fFilterLevel = SkPaint::kNone_FilterLevel; 175 fFilterLevel = SkPaint::kNone_FilterLevel;
170 return true; 176 return true;
171 } 177 }
(...skipping 796 matching lines...) Expand 10 before | Expand all | Expand 10 after
968 } else { 974 } else {
969 size >>= 2; 975 size >>= 2;
970 } 976 }
971 977
972 if (fFilterLevel != SkPaint::kNone_FilterLevel) { 978 if (fFilterLevel != SkPaint::kNone_FilterLevel) {
973 size >>= 1; 979 size >>= 1;
974 } 980 }
975 981
976 return size; 982 return size;
977 } 983 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698