OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #include "SkSpriteBlitter.h" | 10 #include "SkSpriteBlitter.h" |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 SkBlitRow::Proc16 fProc; | 292 SkBlitRow::Proc16 fProc; |
293 | 293 |
294 typedef SkSpriteBlitter INHERITED; | 294 typedef SkSpriteBlitter INHERITED; |
295 }; | 295 }; |
296 | 296 |
297 /////////////////////////////////////////////////////////////////////////////// | 297 /////////////////////////////////////////////////////////////////////////////// |
298 | 298 |
299 SkSpriteBlitter* SkSpriteBlitter::ChooseD16(const SkPixmap& source, const SkPain
t& paint, | 299 SkSpriteBlitter* SkSpriteBlitter::ChooseD16(const SkPixmap& source, const SkPain
t& paint, |
300 SkTBlitterAllocator* allocator) { | 300 SkTBlitterAllocator* allocator) { |
301 | 301 |
302 SkASSERT(allocator != NULL); | 302 SkASSERT(allocator != nullptr); |
303 | 303 |
304 if (paint.getMaskFilter() != NULL) { // may add cases for this | 304 if (paint.getMaskFilter() != nullptr) { // may add cases for this |
305 return NULL; | 305 return nullptr; |
306 } | 306 } |
307 if (paint.getXfermode() != NULL) { // may add cases for this | 307 if (paint.getXfermode() != nullptr) { // may add cases for this |
308 return NULL; | 308 return nullptr; |
309 } | 309 } |
310 if (paint.getColorFilter() != NULL) { // may add cases for this | 310 if (paint.getColorFilter() != nullptr) { // may add cases for this |
311 return NULL; | 311 return nullptr; |
312 } | 312 } |
313 | 313 |
314 const SkAlphaType at = source.alphaType(); | 314 const SkAlphaType at = source.alphaType(); |
315 | 315 |
316 SkSpriteBlitter* blitter = NULL; | 316 SkSpriteBlitter* blitter = nullptr; |
317 unsigned alpha = paint.getAlpha(); | 317 unsigned alpha = paint.getAlpha(); |
318 | 318 |
319 switch (source.colorType()) { | 319 switch (source.colorType()) { |
320 case kN32_SkColorType: { | 320 case kN32_SkColorType: { |
321 if (kPremul_SkAlphaType != at && kOpaque_SkAlphaType != at) { | 321 if (kPremul_SkAlphaType != at && kOpaque_SkAlphaType != at) { |
322 break; | 322 break; |
323 } | 323 } |
324 blitter = allocator->createT<Sprite_D16_S32_BlitRowProc>(source); | 324 blitter = allocator->createT<Sprite_D16_S32_BlitRowProc>(source); |
325 break; | 325 break; |
326 } | 326 } |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 } else { | 361 } else { |
362 blitter = allocator->createT<Sprite_D16_SIndex8A_Blend>(sour
ce, alpha); | 362 blitter = allocator->createT<Sprite_D16_SIndex8A_Blend>(sour
ce, alpha); |
363 } | 363 } |
364 } | 364 } |
365 break; | 365 break; |
366 default: | 366 default: |
367 break; | 367 break; |
368 } | 368 } |
369 return blitter; | 369 return blitter; |
370 } | 370 } |
OLD | NEW |