OLD | NEW |
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 "SkSurface_Base.h" | 8 #include "SkSurface_Base.h" |
9 #include "SkImagePriv.h" | 9 #include "SkImagePriv.h" |
10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 if (size64 > kMaxTotalSize) { | 161 if (size64 > kMaxTotalSize) { |
162 return NULL; | 162 return NULL; |
163 } | 163 } |
164 | 164 |
165 size_t size = (size_t)size64; | 165 size_t size = (size_t)size64; |
166 void* pixels = sk_malloc_throw(size); | 166 void* pixels = sk_malloc_throw(size); |
167 if (NULL == pixels) { | 167 if (NULL == pixels) { |
168 return NULL; | 168 return NULL; |
169 } | 169 } |
170 | 170 |
171 SkAutoTUnref<SkPixelRef> pr(SkNEW_ARGS(SkMallocPixelRef, (pixels, size, NULL
, true))); | 171 SkAutoTUnref<SkPixelRef> pr(SkNEW_ARGS(SkMallocPixelRef, (info, pixels, size
, NULL, true))); |
172 return SkNEW_ARGS(SkSurface_Raster, (info, pr, rowBytes)); | 172 return SkNEW_ARGS(SkSurface_Raster, (info, pr, rowBytes)); |
173 } | 173 } |
OLD | NEW |