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

Side by Side Diff: src/core/SkSpriteBlitter_RGB16.cpp

Issue 26709002: Revert "change SkColorTable to be immutable" (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « src/core/SkProcSpriteBlitter.cpp ('k') | src/gpu/SkGr.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 /* 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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 #define SkSPRITE_ARGS 138 #define SkSPRITE_ARGS
139 #define SkSPRITE_FIELDS 139 #define SkSPRITE_FIELDS
140 #define SkSPRITE_INIT 140 #define SkSPRITE_INIT
141 #define SkSPRITE_DST_TYPE uint16_t 141 #define SkSPRITE_DST_TYPE uint16_t
142 #define SkSPRITE_SRC_TYPE uint8_t 142 #define SkSPRITE_SRC_TYPE uint8_t
143 #define SkSPRITE_DST_GETADDR getAddr16 143 #define SkSPRITE_DST_GETADDR getAddr16
144 #define SkSPRITE_SRC_GETADDR getAddr8 144 #define SkSPRITE_SRC_GETADDR getAddr8
145 #define SkSPRITE_PREAMBLE(srcBM, x, y) const SkPMColor* ctable = srcBM.getC olorTable()->lockColors() 145 #define SkSPRITE_PREAMBLE(srcBM, x, y) const SkPMColor* ctable = srcBM.getC olorTable()->lockColors()
146 #define SkSPRITE_BLIT_PIXEL(dst, src) D16_S32A_Opaque_Pixel(dst, ctable[sr c]) 146 #define SkSPRITE_BLIT_PIXEL(dst, src) D16_S32A_Opaque_Pixel(dst, ctable[sr c])
147 #define SkSPRITE_NEXT_ROW 147 #define SkSPRITE_NEXT_ROW
148 #define SkSPRITE_POSTAMBLE(srcBM) srcBM.getColorTable()->unlockColors( ) 148 #define SkSPRITE_POSTAMBLE(srcBM) srcBM.getColorTable()->unlockColors( false)
149 #include "SkSpriteBlitterTemplate.h" 149 #include "SkSpriteBlitterTemplate.h"
150 150
151 #define SkSPRITE_CLASSNAME Sprite_D16_SIndex8A_Blend 151 #define SkSPRITE_CLASSNAME Sprite_D16_SIndex8A_Blend
152 #define SkSPRITE_ARGS , uint8_t alpha 152 #define SkSPRITE_ARGS , uint8_t alpha
153 #define SkSPRITE_FIELDS uint8_t fSrcAlpha; 153 #define SkSPRITE_FIELDS uint8_t fSrcAlpha;
154 #define SkSPRITE_INIT fSrcAlpha = alpha; 154 #define SkSPRITE_INIT fSrcAlpha = alpha;
155 #define SkSPRITE_DST_TYPE uint16_t 155 #define SkSPRITE_DST_TYPE uint16_t
156 #define SkSPRITE_SRC_TYPE uint8_t 156 #define SkSPRITE_SRC_TYPE uint8_t
157 #define SkSPRITE_DST_GETADDR getAddr16 157 #define SkSPRITE_DST_GETADDR getAddr16
158 #define SkSPRITE_SRC_GETADDR getAddr8 158 #define SkSPRITE_SRC_GETADDR getAddr8
159 #define SkSPRITE_PREAMBLE(srcBM, x, y) const SkPMColor* ctable = srcBM.getC olorTable()->lockColors(); unsigned src_scale = SkAlpha255To256(fSrcAlpha); 159 #define SkSPRITE_PREAMBLE(srcBM, x, y) const SkPMColor* ctable = srcBM.getC olorTable()->lockColors(); unsigned src_scale = SkAlpha255To256(fSrcAlpha);
160 #define SkSPRITE_BLIT_PIXEL(dst, src) D16_S32A_Blend_Pixel(dst, ctable[src ], src_scale) 160 #define SkSPRITE_BLIT_PIXEL(dst, src) D16_S32A_Blend_Pixel(dst, ctable[src ], src_scale)
161 #define SkSPRITE_NEXT_ROW 161 #define SkSPRITE_NEXT_ROW
162 #define SkSPRITE_POSTAMBLE(srcBM) srcBM.getColorTable()->unlockColors( ); 162 #define SkSPRITE_POSTAMBLE(srcBM) srcBM.getColorTable()->unlockColors( false);
163 #include "SkSpriteBlitterTemplate.h" 163 #include "SkSpriteBlitterTemplate.h"
164 164
165 /////////////////////////////////////////////////////////////////////////////// 165 ///////////////////////////////////////////////////////////////////////////////
166 166
167 static intptr_t asint(const void* ptr) { 167 static intptr_t asint(const void* ptr) {
168 return reinterpret_cast<const char*>(ptr) - (const char*)0; 168 return reinterpret_cast<const char*>(ptr) - (const char*)0;
169 } 169 }
170 170
171 static void blitrow_d16_si8(uint16_t* SK_RESTRICT dst, 171 static void blitrow_d16_si8(uint16_t* SK_RESTRICT dst,
172 const uint8_t* SK_RESTRICT src, int count, 172 const uint8_t* SK_RESTRICT src, int count,
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
OLDNEW
« no previous file with comments | « src/core/SkProcSpriteBlitter.cpp ('k') | src/gpu/SkGr.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698