OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |