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

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

Issue 536003002: Hide fields in SkImageInfo (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix qt Created 6 years, 3 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 | « src/core/SkBitmapDevice.cpp ('k') | src/core/SkCanvas.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 2011 Google Inc. 2 * Copyright 2011 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 "SkBitmapCache.h" 8 #include "SkBitmapCache.h"
9 #include "SkBitmapProcState.h" 9 #include "SkBitmapProcState.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 } 266 }
267 SkMipMapCache::Add(fOrigBitmap, fCurrMip); 267 SkMipMapCache::Add(fOrigBitmap, fCurrMip);
268 } 268 }
269 269
270 SkScalar levelScale = SkScalarInvert(SkScalarSqrt(scaleSqd)); 270 SkScalar levelScale = SkScalarInvert(SkScalarSqrt(scaleSqd));
271 SkMipMap::Level level; 271 SkMipMap::Level level;
272 if (fCurrMip->extractLevel(levelScale, &level)) { 272 if (fCurrMip->extractLevel(levelScale, &level)) {
273 SkScalar invScaleFixup = level.fScale; 273 SkScalar invScaleFixup = level.fScale;
274 fInvMatrix.postScale(invScaleFixup, invScaleFixup); 274 fInvMatrix.postScale(invScaleFixup, invScaleFixup);
275 275
276 SkImageInfo info = fOrigBitmap.info(); 276 const SkImageInfo info = fOrigBitmap.info().makeWH(level.fWidth, lev el.fHeight);
277 info.fWidth = level.fWidth;
278 info.fHeight = level.fHeight;
279 // todo: if we could wrap the fCurrMip in a pixelref, then we could just install 277 // todo: if we could wrap the fCurrMip in a pixelref, then we could just install
280 // that here, and not need to explicitly track it ourselves. 278 // that here, and not need to explicitly track it ourselves.
281 fScaledBitmap.installPixels(info, level.fPixels, level.fRowBytes); 279 fScaledBitmap.installPixels(info, level.fPixels, level.fRowBytes);
282 fBitmap = &fScaledBitmap; 280 fBitmap = &fScaledBitmap;
283 fFilterLevel = SkPaint::kLow_FilterLevel; 281 fFilterLevel = SkPaint::kLow_FilterLevel;
284 return true; 282 return true;
285 } 283 }
286 } 284 }
287 285
288 return false; 286 return false;
(...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after
1008 } else { 1006 } else {
1009 size >>= 2; 1007 size >>= 2;
1010 } 1008 }
1011 1009
1012 if (fFilterLevel != SkPaint::kNone_FilterLevel) { 1010 if (fFilterLevel != SkPaint::kNone_FilterLevel) {
1013 size >>= 1; 1011 size >>= 1;
1014 } 1012 }
1015 1013
1016 return size; 1014 return size;
1017 } 1015 }
OLDNEW
« no previous file with comments | « src/core/SkBitmapDevice.cpp ('k') | src/core/SkCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698