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

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

Issue 1835003002: Re-enable CPU mipmap generation for Ganesh. Aniso mips were landed a while ago. However, the CPU bu… (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Don't return uninitialized pointer. Created 4 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 | src/gpu/GrImageIDTextureAdjuster.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 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 "SkBitmapCache.h" 9 #include "SkBitmapCache.h"
10 #include "SkImage_Base.h" 10 #include "SkImage_Base.h"
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 SK_HISTOGRAM_ENUMERATION("LockTexturePath", kYUV_LockTexturePath, 296 SK_HISTOGRAM_ENUMERATION("LockTexturePath", kYUV_LockTexturePath,
297 kLockTexturePathCount); 297 kLockTexturePathCount);
298 return set_key_and_return(tex, key); 298 return set_key_and_return(tex, key);
299 } 299 }
300 } 300 }
301 301
302 // 5. Ask the generator to return RGB(A) data, which the GPU can convert 302 // 5. Ask the generator to return RGB(A) data, which the GPU can convert
303 SkBitmap bitmap; 303 SkBitmap bitmap;
304 if (this->tryLockAsBitmap(&bitmap, client, chint)) { 304 if (this->tryLockAsBitmap(&bitmap, client, chint)) {
305 GrTexture* tex = nullptr; 305 GrTexture* tex = nullptr;
306 // disable mipmapping until we generate anisotropic mipmap levels
307 willBeMipped = false;
308 if (willBeMipped) { 306 if (willBeMipped) {
309 tex = GrGenerateMipMapsAndUploadToTexture(ctx, bitmap); 307 tex = GrGenerateMipMapsAndUploadToTexture(ctx, bitmap);
310 } else { 308 }
309 if (!tex) {
311 tex = GrUploadBitmapToTexture(ctx, bitmap); 310 tex = GrUploadBitmapToTexture(ctx, bitmap);
312 } 311 }
313 if (tex) { 312 if (tex) {
314 SK_HISTOGRAM_ENUMERATION("LockTexturePath", kRGBA_LockTexturePath, 313 SK_HISTOGRAM_ENUMERATION("LockTexturePath", kRGBA_LockTexturePath,
315 kLockTexturePathCount); 314 kLockTexturePathCount);
316 return set_key_and_return(tex, key); 315 return set_key_and_return(tex, key);
317 } 316 }
318 } 317 }
319 SK_HISTOGRAM_ENUMERATION("LockTexturePath", kFailure_LockTexturePath, 318 SK_HISTOGRAM_ENUMERATION("LockTexturePath", kFailure_LockTexturePath,
320 kLockTexturePathCount); 319 kLockTexturePathCount);
(...skipping 12 matching lines...) Expand all
333 } 332 }
334 333
335 #else 334 #else
336 335
337 GrTexture* SkImageCacherator::lockAsTexture(GrContext* ctx, const GrTextureParam s&, 336 GrTexture* SkImageCacherator::lockAsTexture(GrContext* ctx, const GrTextureParam s&,
338 const SkImage* client, SkImage::Cach ingHint) { 337 const SkImage* client, SkImage::Cach ingHint) {
339 return nullptr; 338 return nullptr;
340 } 339 }
341 340
342 #endif 341 #endif
OLDNEW
« no previous file with comments | « no previous file | src/gpu/GrImageIDTextureAdjuster.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698