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

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

Issue 1019343002: remove unneeded SK_SUPPORT_LEGACY_MIPMAP_EFFECTIVE_SCALE guard (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 9 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 | 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 * 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 94
95 static bool valid_for_filtering(unsigned dimension) { 95 static bool valid_for_filtering(unsigned dimension) {
96 // for filtering, width and height must fit in 14bits, since we use steal 96 // for filtering, width and height must fit in 14bits, since we use steal
97 // 2 bits from each to store our 4bit subpixel data 97 // 2 bits from each to store our 4bit subpixel data
98 return (dimension & ~0x3FFF) == 0; 98 return (dimension & ~0x3FFF) == 0;
99 } 99 }
100 100
101 static SkScalar effective_matrix_scale(const SkMatrix& mat) { 101 static SkScalar effective_matrix_scale(const SkMatrix& mat) {
102 SkScalar dx = SkVector::Length(mat.getScaleX(), mat.getSkewY()); 102 SkScalar dx = SkVector::Length(mat.getScaleX(), mat.getSkewY());
103 SkScalar dy = SkVector::Length(mat.getSkewX(), mat.getScaleY()); 103 SkScalar dy = SkVector::Length(mat.getSkewX(), mat.getScaleY());
104 #ifdef SK_SUPPORT_LEGACY_MIPMAP_EFFECTIVE_SCALE
105 return SkMaxScalar(dx, dy);
106 #else
107 return SkScalarSqrt(dx * dy); 104 return SkScalarSqrt(dx * dy);
108 #endif
109 } 105 }
110 106
111 // Check to see that the size of the bitmap that would be produced by 107 // Check to see that the size of the bitmap that would be produced by
112 // scaling by the given inverted matrix is less than the maximum allowed. 108 // scaling by the given inverted matrix is less than the maximum allowed.
113 static inline bool cache_size_okay(const SkBitmap& bm, const SkMatrix& invMat) { 109 static inline bool cache_size_okay(const SkBitmap& bm, const SkMatrix& invMat) {
114 size_t maximumAllocation = SkResourceCache::GetEffectiveSingleAllocationByte Limit(); 110 size_t maximumAllocation = SkResourceCache::GetEffectiveSingleAllocationByte Limit();
115 if (0 == maximumAllocation) { 111 if (0 == maximumAllocation) {
116 return true; 112 return true;
117 } 113 }
118 // float matrixScaleFactor = 1.0 / (invMat.scaleX * invMat.scaleY); 114 // float matrixScaleFactor = 1.0 / (invMat.scaleX * invMat.scaleY);
(...skipping 899 matching lines...) Expand 10 before | Expand all | Expand 10 after
1018 fx += dx; 1014 fx += dx;
1019 } 1015 }
1020 } else { 1016 } else {
1021 for (int i = 0; i < count; ++i) { 1017 for (int i = 0; i < count; ++i) {
1022 dst[i] = src[SkClampMax(SkFractionalIntToInt(fx), maxX)]; 1018 dst[i] = src[SkClampMax(SkFractionalIntToInt(fx), maxX)];
1023 fx += dx; 1019 fx += dx;
1024 } 1020 }
1025 } 1021 }
1026 } 1022 }
1027 1023
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