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

Side by Side Diff: src/gpu/GrTexture.cpp

Issue 318873002: Remove GrIsPow2 in favor of SkIsPow2. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 6 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
« include/gpu/GrTypes.h ('K') | « src/gpu/GrGpu.cpp ('k') | 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 /* 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 8
9 9
10 #include "GrTexture.h" 10 #include "GrTexture.h"
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 kBilerp_TextureFlag = 0x2, 165 kBilerp_TextureFlag = 0x2,
166 }; 166 };
167 167
168 namespace { 168 namespace {
169 GrResourceKey::ResourceFlags get_texture_flags(const GrGpu* gpu, 169 GrResourceKey::ResourceFlags get_texture_flags(const GrGpu* gpu,
170 const GrTextureParams* params, 170 const GrTextureParams* params,
171 const GrTextureDesc& desc) { 171 const GrTextureDesc& desc) {
172 GrResourceKey::ResourceFlags flags = 0; 172 GrResourceKey::ResourceFlags flags = 0;
173 bool tiled = NULL != params && params->isTiled(); 173 bool tiled = NULL != params && params->isTiled();
174 if (tiled && !gpu->caps()->npotTextureTileSupport()) { 174 if (tiled && !gpu->caps()->npotTextureTileSupport()) {
175 if (!GrIsPow2(desc.fWidth) || !GrIsPow2(desc.fHeight)) { 175 if (!SkIsPow2(desc.fWidth) || !SkIsPow2(desc.fHeight)) {
176 flags |= kStretchToPOT_TextureFlag; 176 flags |= kStretchToPOT_TextureFlag;
177 switch(params->filterMode()) { 177 switch(params->filterMode()) {
178 case GrTextureParams::kNone_FilterMode: 178 case GrTextureParams::kNone_FilterMode:
179 break; 179 break;
180 case GrTextureParams::kBilerp_FilterMode: 180 case GrTextureParams::kBilerp_FilterMode:
181 case GrTextureParams::kMipMap_FilterMode: 181 case GrTextureParams::kMipMap_FilterMode:
182 flags |= kBilerp_TextureFlag; 182 flags |= kBilerp_TextureFlag;
183 break; 183 break;
184 } 184 }
185 } 185 }
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 return GrResourceKey(cacheID, texture_resource_type(), 0); 235 return GrResourceKey(cacheID, texture_resource_type(), 0);
236 } 236 }
237 237
238 bool GrTextureImpl::NeedsResizing(const GrResourceKey& key) { 238 bool GrTextureImpl::NeedsResizing(const GrResourceKey& key) {
239 return SkToBool(key.getResourceFlags() & kStretchToPOT_TextureFlag); 239 return SkToBool(key.getResourceFlags() & kStretchToPOT_TextureFlag);
240 } 240 }
241 241
242 bool GrTextureImpl::NeedsBilerp(const GrResourceKey& key) { 242 bool GrTextureImpl::NeedsBilerp(const GrResourceKey& key) {
243 return SkToBool(key.getResourceFlags() & kBilerp_TextureFlag); 243 return SkToBool(key.getResourceFlags() & kBilerp_TextureFlag);
244 } 244 }
OLDNEW
« include/gpu/GrTypes.h ('K') | « src/gpu/GrGpu.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698