| 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 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 if (texture) { | 337 if (texture) { |
| 338 return texture; | 338 return texture; |
| 339 } | 339 } |
| 340 } | 340 } |
| 341 | 341 |
| 342 GrTexture* texture = create_texture_from_yuv(ctx, bitmap, desc); | 342 GrTexture* texture = create_texture_from_yuv(ctx, bitmap, desc); |
| 343 if (texture) { | 343 if (texture) { |
| 344 return texture; | 344 return texture; |
| 345 } | 345 } |
| 346 | 346 |
| 347 // SkMipMap::Build doesn't handle sRGB data correctly (yet). | |
| 348 // Failover to the GL code-path for now. | |
| 349 if (kLinear_SkColorProfileType != bitmap.profileType()) { | |
| 350 return nullptr; | |
| 351 } | |
| 352 | |
| 353 SkASSERT(sizeof(int) <= sizeof(uint32_t)); | 347 SkASSERT(sizeof(int) <= sizeof(uint32_t)); |
| 354 if (bitmap.width() < 0 || bitmap.height() < 0) { | 348 if (bitmap.width() < 0 || bitmap.height() < 0) { |
| 355 return nullptr; | 349 return nullptr; |
| 356 } | 350 } |
| 357 | 351 |
| 358 SkAutoPixmapUnlock srcUnlocker; | 352 SkAutoPixmapUnlock srcUnlocker; |
| 359 if (!bitmap.requestLock(&srcUnlocker)) { | 353 if (!bitmap.requestLock(&srcUnlocker)) { |
| 360 return nullptr; | 354 return nullptr; |
| 361 } | 355 } |
| 362 const SkPixmap& pixmap = srcUnlocker.pixmap(); | 356 const SkPixmap& pixmap = srcUnlocker.pixmap(); |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 749 SkErrorInternals::SetError( kInvalidPaint_SkError, | 743 SkErrorInternals::SetError( kInvalidPaint_SkError, |
| 750 "Sorry, I don't understand the filtering
" | 744 "Sorry, I don't understand the filtering
" |
| 751 "mode you asked for. Falling back to " | 745 "mode you asked for. Falling back to " |
| 752 "MIPMaps."); | 746 "MIPMaps."); |
| 753 textureFilterMode = GrTextureParams::kMipMap_FilterMode; | 747 textureFilterMode = GrTextureParams::kMipMap_FilterMode; |
| 754 break; | 748 break; |
| 755 | 749 |
| 756 } | 750 } |
| 757 return textureFilterMode; | 751 return textureFilterMode; |
| 758 } | 752 } |
| OLD | NEW |