| 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 |
| 347 SkASSERT(sizeof(int) <= sizeof(uint32_t)); | 353 SkASSERT(sizeof(int) <= sizeof(uint32_t)); |
| 348 if (bitmap.width() < 0 || bitmap.height() < 0) { | 354 if (bitmap.width() < 0 || bitmap.height() < 0) { |
| 349 return nullptr; | 355 return nullptr; |
| 350 } | 356 } |
| 351 | 357 |
| 352 SkAutoPixmapUnlock srcUnlocker; | 358 SkAutoPixmapUnlock srcUnlocker; |
| 353 if (!bitmap.requestLock(&srcUnlocker)) { | 359 if (!bitmap.requestLock(&srcUnlocker)) { |
| 354 return nullptr; | 360 return nullptr; |
| 355 } | 361 } |
| 356 const SkPixmap& pixmap = srcUnlocker.pixmap(); | 362 const SkPixmap& pixmap = srcUnlocker.pixmap(); |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 743 SkErrorInternals::SetError( kInvalidPaint_SkError, | 749 SkErrorInternals::SetError( kInvalidPaint_SkError, |
| 744 "Sorry, I don't understand the filtering
" | 750 "Sorry, I don't understand the filtering
" |
| 745 "mode you asked for. Falling back to " | 751 "mode you asked for. Falling back to " |
| 746 "MIPMaps."); | 752 "MIPMaps."); |
| 747 textureFilterMode = GrTextureParams::kMipMap_FilterMode; | 753 textureFilterMode = GrTextureParams::kMipMap_FilterMode; |
| 748 break; | 754 break; |
| 749 | 755 |
| 750 } | 756 } |
| 751 return textureFilterMode; | 757 return textureFilterMode; |
| 752 } | 758 } |
| OLD | NEW |