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

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

Issue 105933003: support scaledimagecache instantiable using discardablememory (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebase Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/core/SkScaledImageCache.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 /* 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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 140
141 SkConvolutionProcs simd; 141 SkConvolutionProcs simd;
142 sk_bzero(&simd, sizeof(simd)); 142 sk_bzero(&simd, sizeof(simd));
143 this->platformConvolutionProcs(&simd); 143 this->platformConvolutionProcs(&simd);
144 144
145 if (!SkBitmapScaler::Resize(&fScaledBitmap, 145 if (!SkBitmapScaler::Resize(&fScaledBitmap,
146 fOrigBitmap, 146 fOrigBitmap,
147 SkBitmapScaler::RESIZE_BEST, 147 SkBitmapScaler::RESIZE_BEST,
148 dest_width, 148 dest_width,
149 dest_height, 149 dest_height,
150 simd)) { 150 simd,
151 SkScaledImageCache::GetAllocator())) {
151 // we failed to create fScaledBitmap, so just return and let 152 // we failed to create fScaledBitmap, so just return and let
152 // the scanline proc handle it. 153 // the scanline proc handle it.
153 return false; 154 return false;
154 155
155 } 156 }
156 fScaledCacheID = SkScaledImageCache::AddAndLock(fOrigBitmap, 157 fScaledCacheID = SkScaledImageCache::AddAndLock(fOrigBitmap,
157 invScaleX, 158 invScaleX,
158 invScaleY, 159 invScaleY,
159 fScaledBitmap); 160 fScaledBitmap);
160 } 161 }
(...skipping 821 matching lines...) Expand 10 before | Expand all | Expand 10 after
982 } else { 983 } else {
983 size >>= 2; 984 size >>= 2;
984 } 985 }
985 986
986 if (fFilterLevel != SkPaint::kNone_FilterLevel) { 987 if (fFilterLevel != SkPaint::kNone_FilterLevel) {
987 size >>= 1; 988 size >>= 1;
988 } 989 }
989 990
990 return size; 991 return size;
991 } 992 }
OLDNEW
« no previous file with comments | « no previous file | src/core/SkScaledImageCache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698