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

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

Issue 1753903002: fission bitmapprocstate (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: use real types instead of uint8_t, fix formatting Created 4 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_SSSE3.cpp ('k') | no next file » | 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_opaque_D32_nofilter_DX_mips_dsp(const SkBitmapProcState& s, 15 static void SI8_opaque_D32_nofilter_DX_mips_dsp(const SkBitmapProcState& s,
16 const uint32_t* SK_RESTRICT xy, 16 const uint32_t* SK_RESTRICT xy,
17 int count, SkPMColor* SK_RESTRIC T colors) { 17 int count, SkPMColor* SK_RESTRIC T colors) {
18 SkASSERT(count > 0 && colors != nullptr); 18 SkASSERT(count > 0 && colors != nullptr);
19 SkASSERT(s.fInvType <= (SkMatrix::kTranslate_Mask | SkMatrix::kScale_Mask)); 19 SkASSERT(s.fInvType <= (SkMatrix::kTranslate_Mask | SkMatrix::kScale_Mask));
20 SkASSERT(kNone_SkFilterQuality == s.fFilterLevel); 20 SkASSERT(kNone_SkFilterQuality == s.fFilterQuality);
21 const SkPMColor* SK_RESTRICT table = s.fPixmap.ctable()->readColors(); 21 const SkPMColor* SK_RESTRICT table = s.fPixmap.ctable()->readColors();
22 const uint8_t* SK_RESTRICT srcAddr = (const uint8_t*)s.fPixmap.addr(); 22 const uint8_t* SK_RESTRICT srcAddr = (const uint8_t*)s.fPixmap.addr();
23 srcAddr = (const uint8_t*)((const char*)srcAddr + xy[0] * s.fPixmap.rowBytes ()); 23 srcAddr = (const uint8_t*)((const char*)srcAddr + xy[0] * s.fPixmap.rowBytes ());
24 24
25 if (1 == s.fPixmap.width()) { 25 if (1 == s.fPixmap.width()) {
26 uint8_t src = srcAddr[0]; 26 uint8_t src = srcAddr[0];
27 SkPMColor dstValue = table[src]; 27 SkPMColor dstValue = table[src];
28 sk_memset32(colors, dstValue, count); 28 sk_memset32(colors, dstValue, count);
29 } else { 29 } else {
30 const uint16_t* xx = (const uint16_t*)(xy + 1); 30 const uint16_t* xx = (const uint16_t*)(xy + 1);
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 void SkBitmapProcState::platformProcs() { 239 void SkBitmapProcState::platformProcs() {
240 bool isOpaque = 256 == fAlphaScale; 240 bool isOpaque = 256 == fAlphaScale;
241 bool justDx = false; 241 bool justDx = false;
242 242
243 if (fInvType <= (SkMatrix::kTranslate_Mask | SkMatrix::kScale_Mask)) { 243 if (fInvType <= (SkMatrix::kTranslate_Mask | SkMatrix::kScale_Mask)) {
244 justDx = true; 244 justDx = true;
245 } 245 }
246 246
247 switch (fPixmap.colorType()) { 247 switch (fPixmap.colorType()) {
248 case kIndex_8_SkColorType: 248 case kIndex_8_SkColorType:
249 if (justDx && kNone_SkFilterQuality == fFilterLevel) { 249 if (justDx && kNone_SkFilterQuality == fFilterQuality) {
250 if (isOpaque) { 250 if (isOpaque) {
251 fSampleProc32 = SI8_opaque_D32_nofilter_DX_mips_dsp; 251 fSampleProc32 = SI8_opaque_D32_nofilter_DX_mips_dsp;
252 fShaderProc32 = nullptr; 252 fShaderProc32 = nullptr;
253 } 253 }
254 } 254 }
255 break; 255 break;
256 default: 256 default:
257 break; 257 break;
258 } 258 }
259 } 259 }
260 260
261 void SkBitmapScaler::PlatformConvolutionProcs(SkConvolutionProcs*) {} 261 void SkBitmapScaler::PlatformConvolutionProcs(SkConvolutionProcs*) {}
OLDNEW
« no previous file with comments | « src/opts/SkBitmapProcState_opts_SSSE3.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698