| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
| 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 "SkSpriteBlitter.h" | 9 #include "SkSpriteBlitter.h" |
| 10 #include "SkBlitRow.h" | 10 #include "SkBlitRow.h" |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 /////////////////////////////////////////////////////////////////////////////// | 300 /////////////////////////////////////////////////////////////////////////////// |
| 301 | 301 |
| 302 SkSpriteBlitter* SkSpriteBlitter::ChooseD16(const SkPixmap& source, const SkPain
t& paint, | 302 SkSpriteBlitter* SkSpriteBlitter::ChooseD16(const SkPixmap& source, const SkPain
t& paint, |
| 303 SkTBlitterAllocator* allocator) { | 303 SkTBlitterAllocator* allocator) { |
| 304 | 304 |
| 305 SkASSERT(allocator != nullptr); | 305 SkASSERT(allocator != nullptr); |
| 306 | 306 |
| 307 if (paint.getMaskFilter() != nullptr) { // may add cases for this | 307 if (paint.getMaskFilter() != nullptr) { // may add cases for this |
| 308 return nullptr; | 308 return nullptr; |
| 309 } | 309 } |
| 310 if (paint.getXfermode() != nullptr) { // may add cases for this | 310 if (!paint.isSrcOver()) { // may add cases for this |
| 311 return nullptr; | 311 return nullptr; |
| 312 } | 312 } |
| 313 if (paint.getColorFilter() != nullptr) { // may add cases for this | 313 if (paint.getColorFilter() != nullptr) { // may add cases for this |
| 314 return nullptr; | 314 return nullptr; |
| 315 } | 315 } |
| 316 | 316 |
| 317 const SkAlphaType at = source.alphaType(); | 317 const SkAlphaType at = source.alphaType(); |
| 318 | 318 |
| 319 SkSpriteBlitter* blitter = nullptr; | 319 SkSpriteBlitter* blitter = nullptr; |
| 320 unsigned alpha = paint.getAlpha(); | 320 unsigned alpha = paint.getAlpha(); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 } else { | 364 } else { |
| 365 blitter = allocator->createT<Sprite_D16_SIndex8A_Blend>(sour
ce, alpha); | 365 blitter = allocator->createT<Sprite_D16_SIndex8A_Blend>(sour
ce, alpha); |
| 366 } | 366 } |
| 367 } | 367 } |
| 368 break; | 368 break; |
| 369 default: | 369 default: |
| 370 break; | 370 break; |
| 371 } | 371 } |
| 372 return blitter; | 372 return blitter; |
| 373 } | 373 } |
| OLD | NEW |