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

Side by Side Diff: src/opts/SkBitmapProcState_opts_mips_dsp.cpp

Issue 1014533004: SkPaint::FilterLevel -> SkFilterQuality (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « src/opts/SkBitmapProcState_opts_arm.cpp ('k') | src/pipe/SkGPipeRead.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2014 The Android Open Source Project 2 * Copyright 2014 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 "SkBitmapProcState.h" 9 #include "SkBitmapProcState.h"
10 #include "SkBitmapScaler.h" 10 #include "SkBitmapScaler.h"
11 #include "SkColorPriv.h" 11 #include "SkColorPriv.h"
12 #include "SkPaint.h" 12 #include "SkPaint.h"
13 #include "SkUtils.h" 13 #include "SkUtils.h"
14 14
15 static void SI8_D16_nofilter_DX_mips_dsp(const SkBitmapProcState& s, 15 static void SI8_D16_nofilter_DX_mips_dsp(const SkBitmapProcState& s,
16 const uint32_t* SK_RESTRICT xy, 16 const uint32_t* SK_RESTRICT xy,
17 int count, uint16_t* SK_RESTRICT colors ) { 17 int count, uint16_t* SK_RESTRICT colors ) {
18 SkASSERT(count > 0 && colors != NULL); 18 SkASSERT(count > 0 && colors != NULL);
19 SkASSERT(s.fInvType <= (SkMatrix::kTranslate_Mask | SkMatrix::kScale_Mask)); 19 SkASSERT(s.fInvType <= (SkMatrix::kTranslate_Mask | SkMatrix::kScale_Mask));
20 SkASSERT(SkPaint::kNone_FilterLevel == s.fFilterLevel); 20 SkASSERT(kNone_SkFilterQuality == s.fFilterLevel);
21 const uint16_t* SK_RESTRICT table = s.fBitmap->getColorTable()->read16BitCac he(); 21 const uint16_t* SK_RESTRICT table = s.fBitmap->getColorTable()->read16BitCac he();
22 const uint8_t* SK_RESTRICT srcAddr = (const uint8_t*)s.fBitmap->getPixels(); 22 const uint8_t* SK_RESTRICT srcAddr = (const uint8_t*)s.fBitmap->getPixels();
23 SkASSERT((unsigned)xy[0] < (unsigned)s.fBitmap->height()); 23 SkASSERT((unsigned)xy[0] < (unsigned)s.fBitmap->height());
24 srcAddr = (const uint8_t*)((const char*)srcAddr + xy[0] * s.fBitmap->rowByte s()); 24 srcAddr = (const uint8_t*)((const char*)srcAddr + xy[0] * s.fBitmap->rowByte s());
25 uint8_t src; 25 uint8_t src;
26 26
27 if (1 == s.fBitmap->width()) { 27 if (1 == s.fBitmap->width()) {
28 src = srcAddr[0]; 28 src = srcAddr[0];
29 uint16_t dstValue = table[src]; 29 uint16_t dstValue = table[src];
30 sk_memset16(colors, dstValue, count); 30 sk_memset16(colors, dstValue, count);
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 src = srcAddr[*xx++]; *colors++ = table[src]; 142 src = srcAddr[*xx++]; *colors++ = table[src];
143 } 143 }
144 } 144 }
145 } 145 }
146 146
147 static void SI8_opaque_D32_nofilter_DX_mips_dsp(const SkBitmapProcState& s, 147 static void SI8_opaque_D32_nofilter_DX_mips_dsp(const SkBitmapProcState& s,
148 const uint32_t* SK_RESTRICT xy, 148 const uint32_t* SK_RESTRICT xy,
149 int count, SkPMColor* SK_RESTRIC T colors) { 149 int count, SkPMColor* SK_RESTRIC T colors) {
150 SkASSERT(count > 0 && colors != NULL); 150 SkASSERT(count > 0 && colors != NULL);
151 SkASSERT(s.fInvType <= (SkMatrix::kTranslate_Mask | SkMatrix::kScale_Mask)); 151 SkASSERT(s.fInvType <= (SkMatrix::kTranslate_Mask | SkMatrix::kScale_Mask));
152 SkASSERT(SkPaint::kNone_FilterLevel == s.fFilterLevel); 152 SkASSERT(kNone_SkFilterQuality == s.fFilterLevel);
153 const SkPMColor* SK_RESTRICT table = s.fBitmap->getColorTable()->readColors( ); 153 const SkPMColor* SK_RESTRICT table = s.fBitmap->getColorTable()->readColors( );
154 const uint8_t* SK_RESTRICT srcAddr = (const uint8_t*)s.fBitmap->getPixels(); 154 const uint8_t* SK_RESTRICT srcAddr = (const uint8_t*)s.fBitmap->getPixels();
155 srcAddr = (const uint8_t*)((const char*)srcAddr + xy[0] * s.fBitmap->rowByte s()); 155 srcAddr = (const uint8_t*)((const char*)srcAddr + xy[0] * s.fBitmap->rowByte s());
156 156
157 if (1 == s.fBitmap->width()) { 157 if (1 == s.fBitmap->width()) {
158 uint8_t src = srcAddr[0]; 158 uint8_t src = srcAddr[0];
159 SkPMColor dstValue = table[src]; 159 SkPMColor dstValue = table[src];
160 sk_memset32(colors, dstValue, count); 160 sk_memset32(colors, dstValue, count);
161 } else { 161 } else {
162 const uint16_t* xx = (const uint16_t*)(xy + 1); 162 const uint16_t* xx = (const uint16_t*)(xy + 1);
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 void SkBitmapProcState::platformProcs() { 371 void SkBitmapProcState::platformProcs() {
372 bool isOpaque = 256 == fAlphaScale; 372 bool isOpaque = 256 == fAlphaScale;
373 bool justDx = false; 373 bool justDx = false;
374 374
375 if (fInvType <= (SkMatrix::kTranslate_Mask | SkMatrix::kScale_Mask)) { 375 if (fInvType <= (SkMatrix::kTranslate_Mask | SkMatrix::kScale_Mask)) {
376 justDx = true; 376 justDx = true;
377 } 377 }
378 378
379 switch (fBitmap->colorType()) { 379 switch (fBitmap->colorType()) {
380 case kIndex_8_SkColorType: 380 case kIndex_8_SkColorType:
381 if (justDx && SkPaint::kNone_FilterLevel == fFilterLevel) { 381 if (justDx && kNone_SkFilterQuality == fFilterLevel) {
382 fSampleProc16 = SI8_D16_nofilter_DX_mips_dsp; 382 fSampleProc16 = SI8_D16_nofilter_DX_mips_dsp;
383 fShaderProc16 = NULL; 383 fShaderProc16 = NULL;
384 if (isOpaque) { 384 if (isOpaque) {
385 fSampleProc32 = SI8_opaque_D32_nofilter_DX_mips_dsp; 385 fSampleProc32 = SI8_opaque_D32_nofilter_DX_mips_dsp;
386 fShaderProc32 = NULL; 386 fShaderProc32 = NULL;
387 } 387 }
388 } 388 }
389 break; 389 break;
390 default: 390 default:
391 break; 391 break;
392 } 392 }
393 } 393 }
394 394
395 void SkBitmapScaler::PlatformConvolutionProcs(SkConvolutionProcs*) {} 395 void SkBitmapScaler::PlatformConvolutionProcs(SkConvolutionProcs*) {}
OLDNEW
« no previous file with comments | « src/opts/SkBitmapProcState_opts_arm.cpp ('k') | src/pipe/SkGPipeRead.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698