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

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

Issue 1695443002: Remove SK_SUPPORT_LEGACY_BITMAP_FILTER guard (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 4 years, 10 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 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 "SkBitmap.h" 8 #include "SkBitmap.h"
9 #include "SkBitmapController.h" 9 #include "SkBitmapController.h"
10 #include "SkBitmapProvider.h" 10 #include "SkBitmapProvider.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 invScaleX = scale.width(); 98 invScaleX = scale.width();
99 invScaleY = scale.height(); 99 invScaleY = scale.height();
100 } 100 }
101 invScaleX = SkScalarAbs(invScaleX); 101 invScaleX = SkScalarAbs(invScaleX);
102 invScaleY = SkScalarAbs(invScaleY); 102 invScaleY = SkScalarAbs(invScaleY);
103 103
104 if (SkScalarNearlyEqual(invScaleX, 1) && SkScalarNearlyEqual(invScaleY, 1)) { 104 if (SkScalarNearlyEqual(invScaleX, 1) && SkScalarNearlyEqual(invScaleY, 1)) {
105 return false; // no need for HQ 105 return false; // no need for HQ
106 } 106 }
107 107
108 #ifndef SK_SUPPORT_LEGACY_HQ_DOWNSAMPLING
109 if (invScaleX > 1 || invScaleY > 1) { 108 if (invScaleX > 1 || invScaleY > 1) {
110 return false; // only use HQ when upsampling 109 return false; // only use HQ when upsampling
111 } 110 }
112 #endif 111
113
114 const int dstW = SkScalarRoundToScalar(provider.width() / invScaleX); 112 const int dstW = SkScalarRoundToScalar(provider.width() / invScaleX);
115 const int dstH = SkScalarRoundToScalar(provider.height() / invScaleY); 113 const int dstH = SkScalarRoundToScalar(provider.height() / invScaleY);
116 const SkBitmapCacheDesc desc = provider.makeCacheDesc(dstW, dstH); 114 const SkBitmapCacheDesc desc = provider.makeCacheDesc(dstW, dstH);
117 115
118 if (!SkBitmapCache::FindWH(desc, &fResultBitmap)) { 116 if (!SkBitmapCache::FindWH(desc, &fResultBitmap)) {
119 SkBitmap orig; 117 SkBitmap orig;
120 if (!provider.asBitmap(&orig)) { 118 if (!provider.asBitmap(&orig)) {
121 return false; 119 return false;
122 } 120 }
123 SkAutoPixmapUnlock src; 121 SkAutoPixmapUnlock src;
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 fResultBitmap.getColorTable()); 219 fResultBitmap.getColorTable());
222 } 220 }
223 221
224 SkBitmapController::State* SkDefaultBitmapController::onRequestBitmap(const SkBi tmapProvider& bm, 222 SkBitmapController::State* SkDefaultBitmapController::onRequestBitmap(const SkBi tmapProvider& bm,
225 const SkMa trix& inverse, 223 const SkMa trix& inverse,
226 SkFilterQu ality quality, 224 SkFilterQu ality quality,
227 void* stor age, size_t size) { 225 void* stor age, size_t size) {
228 return SkInPlaceNewCheck<SkDefaultBitmapControllerState>(storage, size, bm, inverse, quality); 226 return SkInPlaceNewCheck<SkDefaultBitmapControllerState>(storage, size, bm, inverse, quality);
229 } 227 }
230 228
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