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 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 const GrMipLevel* texels, int mipLevelCount)
{ | 414 const GrMipLevel* texels, int mipLevelCount)
{ |
415 const GrCaps* caps = ctx->caps(); | 415 const GrCaps* caps = ctx->caps(); |
416 return ctx->textureProvider()->createMipMappedTexture(GrImageInfoToSurfaceDe
sc(info, *caps), | 416 return ctx->textureProvider()->createMipMappedTexture(GrImageInfoToSurfaceDe
sc(info, *caps), |
417 SkBudgeted::kYes, texe
ls, | 417 SkBudgeted::kYes, texe
ls, |
418 mipLevelCount); | 418 mipLevelCount); |
419 } | 419 } |
420 | 420 |
421 GrTexture* GrRefCachedBitmapTexture(GrContext* ctx, const SkBitmap& bitmap, | 421 GrTexture* GrRefCachedBitmapTexture(GrContext* ctx, const SkBitmap& bitmap, |
422 const GrTextureParams& params, | 422 const GrTextureParams& params, |
423 SkSourceGammaTreatment gammaTreatment) { | 423 SkSourceGammaTreatment gammaTreatment) { |
424 if (bitmap.getTexture()) { | |
425 return GrBitmapTextureAdjuster(&bitmap).refTextureSafeForParams(params,
gammaTreatment, | |
426 nullptr)
; | |
427 } | |
428 return GrBitmapTextureMaker(ctx, bitmap).refTextureForParams(params, gammaTr
eatment); | 424 return GrBitmapTextureMaker(ctx, bitmap).refTextureForParams(params, gammaTr
eatment); |
429 } | 425 } |
430 | 426 |
431 /////////////////////////////////////////////////////////////////////////////// | 427 /////////////////////////////////////////////////////////////////////////////// |
432 | 428 |
433 // alphatype is ignore for now, but if GrPixelConfig is expanded to encompass | 429 // alphatype is ignore for now, but if GrPixelConfig is expanded to encompass |
434 // alpha info, that will be considered. | 430 // alpha info, that will be considered. |
435 GrPixelConfig SkImageInfo2GrPixelConfig(SkColorType ct, SkAlphaType, const SkCol
orSpace* cs, | 431 GrPixelConfig SkImageInfo2GrPixelConfig(SkColorType ct, SkAlphaType, const SkCol
orSpace* cs, |
436 const GrCaps& caps) { | 432 const GrCaps& caps) { |
437 // We intentionally ignore profile type for non-8888 formats. Anything we ca
n't support | 433 // We intentionally ignore profile type for non-8888 formats. Anything we ca
n't support |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
768 SkErrorInternals::SetError( kInvalidPaint_SkError, | 764 SkErrorInternals::SetError( kInvalidPaint_SkError, |
769 "Sorry, I don't understand the filtering
" | 765 "Sorry, I don't understand the filtering
" |
770 "mode you asked for. Falling back to " | 766 "mode you asked for. Falling back to " |
771 "MIPMaps."); | 767 "MIPMaps."); |
772 textureFilterMode = GrTextureParams::kMipMap_FilterMode; | 768 textureFilterMode = GrTextureParams::kMipMap_FilterMode; |
773 break; | 769 break; |
774 | 770 |
775 } | 771 } |
776 return textureFilterMode; | 772 return textureFilterMode; |
777 } | 773 } |
OLD | NEW |