Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(256)

Side by Side Diff: src/images/SkScaledBitmapSampler.cpp

Issue 338493005: stop using SkBitmap::Config (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2007 The Android Open Source Project 2 * Copyright 2007 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 "SkScaledBitmapSampler.h" 9 #include "SkScaledBitmapSampler.h"
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after
689 index += 3; 689 index += 3;
690 break; 690 break;
691 case SkScaledBitmapSampler::kRGB_565: 691 case SkScaledBitmapSampler::kRGB_565:
692 fSrcPixelSize = 2; 692 fSrcPixelSize = 2;
693 index += 4; 693 index += 4;
694 break; 694 break;
695 default: 695 default:
696 return false; 696 return false;
697 } 697 }
698 698
699 switch (dst->config()) { 699 switch (dst->colorType()) {
700 case SkBitmap::kARGB_8888_Config: 700 case kN32_SkColorType:
701 index += 0 * gProcDstConfigSpan; 701 index += 0 * gProcDstConfigSpan;
702 break; 702 break;
703 case SkBitmap::kRGB_565_Config: 703 case kRGB_565_SkColorType:
704 index += 1 * gProcDstConfigSpan; 704 index += 1 * gProcDstConfigSpan;
705 break; 705 break;
706 case SkBitmap::kARGB_4444_Config: 706 case kARGB_4444_SkColorType:
707 index += 2 * gProcDstConfigSpan; 707 index += 2 * gProcDstConfigSpan;
708 break; 708 break;
709 case SkBitmap::kIndex8_Config: 709 case kIndex_8_SkColorType:
710 index += 3 * gProcDstConfigSpan; 710 index += 3 * gProcDstConfigSpan;
711 break; 711 break;
712 case SkBitmap::kA8_Config: 712 case kAlpha_8_SkColorType:
713 index += 4 * gProcDstConfigSpan; 713 index += 4 * gProcDstConfigSpan;
714 break; 714 break;
715 default: 715 default:
716 return false; 716 return false;
717 } 717 }
718 718
719 RowProcChooser chooser = gProcChoosers[index]; 719 RowProcChooser chooser = gProcChoosers[index];
720 if (NULL == chooser) { 720 if (NULL == chooser) {
721 fRowProc = NULL; 721 fRowProc = NULL;
722 } else { 722 } else {
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
867 SkScaledBitmapSampler::RowProc actual = RowProcTester::getRo wProc(sampler); 867 SkScaledBitmapSampler::RowProc actual = RowProcTester::getRo wProc(sampler);
868 SkASSERT(expected == actual); 868 SkASSERT(expected == actual);
869 procCounter++; 869 procCounter++;
870 } 870 }
871 } 871 }
872 } 872 }
873 } 873 }
874 SkASSERT(SK_ARRAY_COUNT(gTestProcs) == procCounter); 874 SkASSERT(SK_ARRAY_COUNT(gTestProcs) == procCounter);
875 } 875 }
876 #endif // SK_DEBUG 876 #endif // SK_DEBUG
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698