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 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 if (paint.getXfermode() != NULL) { // may add cases for this | 317 if (paint.getXfermode() != NULL) { // may add cases for this |
318 return NULL; | 318 return NULL; |
319 } | 319 } |
320 if (paint.getColorFilter() != NULL) { // may add cases for this | 320 if (paint.getColorFilter() != NULL) { // may add cases for this |
321 return NULL; | 321 return NULL; |
322 } | 322 } |
323 | 323 |
324 SkSpriteBlitter* blitter = NULL; | 324 SkSpriteBlitter* blitter = NULL; |
325 unsigned alpha = paint.getAlpha(); | 325 unsigned alpha = paint.getAlpha(); |
326 | 326 |
327 switch (source.config()) { | 327 switch (source.colorType()) { |
328 case SkBitmap::kARGB_8888_Config: | 328 case kPMColor_SkColorType: |
329 SK_PLACEMENT_NEW_ARGS(blitter, Sprite_D16_S32_BlitRowProc, | 329 SK_PLACEMENT_NEW_ARGS(blitter, Sprite_D16_S32_BlitRowProc, |
330 storage, storageSize, (source)); | 330 storage, storageSize, (source)); |
331 break; | 331 break; |
332 case SkBitmap::kARGB_4444_Config: | 332 case kARGB_4444_SkColorType: |
333 if (255 == alpha) { | 333 if (255 == alpha) { |
334 SK_PLACEMENT_NEW_ARGS(blitter, Sprite_D16_S4444_Opaque, | 334 SK_PLACEMENT_NEW_ARGS(blitter, Sprite_D16_S4444_Opaque, |
335 storage, storageSize, (source)); | 335 storage, storageSize, (source)); |
336 } else { | 336 } else { |
337 SK_PLACEMENT_NEW_ARGS(blitter, Sprite_D16_S4444_Blend, | 337 SK_PLACEMENT_NEW_ARGS(blitter, Sprite_D16_S4444_Blend, |
338 storage, storageSize, (source, alpha >> 4)); | 338 storage, storageSize, (source, alpha >> 4)); |
339 } | 339 } |
340 break; | 340 break; |
341 case SkBitmap::kRGB_565_Config: | 341 case kRGB_565_SkColorType: |
342 if (255 == alpha) { | 342 if (255 == alpha) { |
343 SK_PLACEMENT_NEW_ARGS(blitter, Sprite_D16_S16_Opaque, | 343 SK_PLACEMENT_NEW_ARGS(blitter, Sprite_D16_S16_Opaque, |
344 storage, storageSize, (source)); | 344 storage, storageSize, (source)); |
345 } else { | 345 } else { |
346 SK_PLACEMENT_NEW_ARGS(blitter, Sprite_D16_S16_Blend, | 346 SK_PLACEMENT_NEW_ARGS(blitter, Sprite_D16_S16_Blend, |
347 storage, storageSize, (source, alpha)); | 347 storage, storageSize, (source, alpha)); |
348 } | 348 } |
349 break; | 349 break; |
350 case SkBitmap::kIndex8_Config: | 350 case kIndex_8_SkColorType: |
351 if (paint.isDither()) { | 351 if (paint.isDither()) { |
352 // we don't support dither yet in these special cases | 352 // we don't support dither yet in these special cases |
353 break; | 353 break; |
354 } | 354 } |
355 if (source.isOpaque()) { | 355 if (source.isOpaque()) { |
356 if (255 == alpha) { | 356 if (255 == alpha) { |
357 SK_PLACEMENT_NEW_ARGS(blitter, Sprite_D16_SIndex8_Opaque, | 357 SK_PLACEMENT_NEW_ARGS(blitter, Sprite_D16_SIndex8_Opaque, |
358 storage, storageSize, (source)); | 358 storage, storageSize, (source)); |
359 } else { | 359 } else { |
360 SK_PLACEMENT_NEW_ARGS(blitter, Sprite_D16_SIndex8_Blend, | 360 SK_PLACEMENT_NEW_ARGS(blitter, Sprite_D16_SIndex8_Blend, |
361 storage, storageSize, (source, alpha)); | 361 storage, storageSize, (source, alpha)); |
362 } | 362 } |
363 } else { | 363 } else { |
364 if (255 == alpha) { | 364 if (255 == alpha) { |
365 SK_PLACEMENT_NEW_ARGS(blitter, Sprite_D16_SIndex8A_Opaque, | 365 SK_PLACEMENT_NEW_ARGS(blitter, Sprite_D16_SIndex8A_Opaque, |
366 storage, storageSize, (source)); | 366 storage, storageSize, (source)); |
367 } else { | 367 } else { |
368 SK_PLACEMENT_NEW_ARGS(blitter, Sprite_D16_SIndex8A_Blend, | 368 SK_PLACEMENT_NEW_ARGS(blitter, Sprite_D16_SIndex8A_Blend, |
369 storage, storageSize, (source, alpha)); | 369 storage, storageSize, (source, alpha)); |
370 } | 370 } |
371 } | 371 } |
372 break; | 372 break; |
373 default: | 373 default: |
374 break; | 374 break; |
375 } | 375 } |
376 return blitter; | 376 return blitter; |
377 } | 377 } |
OLD | NEW |