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/SkGr.cpp

Issue 2075133002: Don't try to set gamma treatment if texture creation fails. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 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
« 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 2010 Google Inc. 2 * Copyright 2010 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 8
9 #include "SkGr.h" 9 #include "SkGr.h"
10 #include "SkGrPriv.h" 10 #include "SkGrPriv.h"
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 mipmaps->getLevel(i - 1, &generatedMipLevel); 387 mipmaps->getLevel(i - 1, &generatedMipLevel);
388 texels[i].fPixels = generatedMipLevel.fPixmap.addr(); 388 texels[i].fPixels = generatedMipLevel.fPixmap.addr();
389 texels[i].fRowBytes = generatedMipLevel.fPixmap.rowBytes(); 389 texels[i].fRowBytes = generatedMipLevel.fPixmap.rowBytes();
390 } 390 }
391 391
392 { 392 {
393 GrTexture* texture = ctx->textureProvider()->createMipMappedTexture(desc , 393 GrTexture* texture = ctx->textureProvider()->createMipMappedTexture(desc ,
394 SkBu dgeted::kYes, 394 SkBu dgeted::kYes,
395 texe ls.get(), 395 texe ls.get(),
396 mipL evelCount); 396 mipL evelCount);
397 texture->texturePriv().setGammaTreatment(gammaTreatment); 397 if (texture) {
398 texture->texturePriv().setGammaTreatment(gammaTreatment);
399 }
398 return texture; 400 return texture;
399 } 401 }
400 } 402 }
401 403
402 GrTexture* GrUploadMipMapToTexture(GrContext* ctx, const SkImageInfo& info, 404 GrTexture* GrUploadMipMapToTexture(GrContext* ctx, const SkImageInfo& info,
403 const GrMipLevel* texels, int mipLevelCount) { 405 const GrMipLevel* texels, int mipLevelCount) {
404 const GrCaps* caps = ctx->caps(); 406 const GrCaps* caps = ctx->caps();
405 return ctx->textureProvider()->createMipMappedTexture(GrImageInfoToSurfaceDe sc(info, *caps), 407 return ctx->textureProvider()->createMipMappedTexture(GrImageInfoToSurfaceDe sc(info, *caps),
406 SkBudgeted::kYes, texe ls, 408 SkBudgeted::kYes, texe ls,
407 mipLevelCount); 409 mipLevelCount);
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
771 SkErrorInternals::SetError( kInvalidPaint_SkError, 773 SkErrorInternals::SetError( kInvalidPaint_SkError,
772 "Sorry, I don't understand the filtering " 774 "Sorry, I don't understand the filtering "
773 "mode you asked for. Falling back to " 775 "mode you asked for. Falling back to "
774 "MIPMaps."); 776 "MIPMaps.");
775 textureFilterMode = GrTextureParams::kMipMap_FilterMode; 777 textureFilterMode = GrTextureParams::kMipMap_FilterMode;
776 break; 778 break;
777 779
778 } 780 }
779 return textureFilterMode; 781 return textureFilterMode;
780 } 782 }
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