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

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

Issue 1368393003: add hard-coded limit for tmp allocations when HQ image scaling (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update dox Created 5 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
« no previous file with comments | « no previous file | src/core/SkConvolver.h » ('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 2015 Google Inc. 2 * Copyright 2015 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 "SkBitmapScaler.h" 8 #include "SkBitmapScaler.h"
9 #include "SkBitmapFilter.h" 9 #include "SkBitmapFilter.h"
10 #include "SkConvolver.h" 10 #include "SkConvolver.h"
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 // Convolve into the result. 238 // Convolve into the result.
239 SkBitmap result; 239 SkBitmap result;
240 result.setInfo(SkImageInfo::MakeN32(SkScalarCeilToInt(destSubset.width()), 240 result.setInfo(SkImageInfo::MakeN32(SkScalarCeilToInt(destSubset.width()),
241 SkScalarCeilToInt(destSubset.height()), 241 SkScalarCeilToInt(destSubset.height()),
242 source.alphaType())); 242 source.alphaType()));
243 result.allocPixels(allocator, nullptr); 243 result.allocPixels(allocator, nullptr);
244 if (!result.readyToDraw()) { 244 if (!result.readyToDraw()) {
245 return false; 245 return false;
246 } 246 }
247 247
248 BGRAConvolve2D(sourceSubset, static_cast<int>(source.rowBytes()), 248 if (!BGRAConvolve2D(sourceSubset, static_cast<int>(source.rowBytes()),
249 !source.isOpaque(), filter.xFilter(), filter.yFilter(), 249 !source.isOpaque(), filter.xFilter(), filter.yFilter(),
250 static_cast<int>(result.rowBytes()), 250 static_cast<int>(result.rowBytes()),
251 static_cast<unsigned char*>(result.getPixels()), 251 static_cast<unsigned char*>(result.getPixels()),
252 convolveProcs, true); 252 convolveProcs, true)) {
253 return false;
254 }
253 255
254 *resultPtr = result; 256 *resultPtr = result;
255 resultPtr->lockPixels(); 257 resultPtr->lockPixels();
256 SkASSERT(resultPtr->getPixels()); 258 SkASSERT(resultPtr->getPixels());
257 return true; 259 return true;
258 } 260 }
259 261
OLDNEW
« no previous file with comments | « no previous file | src/core/SkConvolver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698