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

Side by Side Diff: src/core/SkBitmapProcState.h

Issue 23591030: start to remove lockPixels from bitmapshader (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 3 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/SkBitmapProcShader.cpp ('k') | src/core/SkBitmapProcState.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 2007 The Android Open Source Project 3 * Copyright 2007 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 #ifndef SkBitmapProcState_DEFINED 10 #ifndef SkBitmapProcState_DEFINED
11 #define SkBitmapProcState_DEFINED 11 #define SkBitmapProcState_DEFINED
12 12
13 #include "SkBitmap.h" 13 #include "SkBitmap.h"
14 #include "SkBitmapFilter.h" 14 #include "SkBitmapFilter.h"
15 #include "SkMatrix.h" 15 #include "SkMatrix.h"
16 #include "SkPaint.h"
16 #include "SkScaledImageCache.h" 17 #include "SkScaledImageCache.h"
17 18
18 #define FractionalInt_IS_64BIT 19 #define FractionalInt_IS_64BIT
19 20
20 #ifdef FractionalInt_IS_64BIT 21 #ifdef FractionalInt_IS_64BIT
21 typedef SkFixed48 SkFractionalInt; 22 typedef SkFixed48 SkFractionalInt;
22 #define SkScalarToFractionalInt(x) SkScalarToFixed48(x) 23 #define SkScalarToFractionalInt(x) SkScalarToFixed48(x)
23 #define SkFractionalIntToFixed(x) SkFixed48ToFixed(x) 24 #define SkFractionalIntToFixed(x) SkFixed48ToFixed(x)
24 #define SkFixedToFractionalInt(x) SkFixedToFixed48(x) 25 #define SkFixedToFractionalInt(x) SkFixedToFixed48(x)
25 #define SkFractionalIntToInt(x) SkFixed48ToInt(x) 26 #define SkFractionalIntToInt(x) SkFixed48ToInt(x)
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 154
154 SkBitmap fOrigBitmap; // CONSTRUCTOR 155 SkBitmap fOrigBitmap; // CONSTRUCTOR
155 SkBitmap fScaledBitmap; // chooseProcs 156 SkBitmap fScaledBitmap; // chooseProcs
156 157
157 SkScaledImageCache::ID* fScaledCacheID; 158 SkScaledImageCache::ID* fScaledCacheID;
158 159
159 MatrixProc chooseMatrixProc(bool trivial_matrix); 160 MatrixProc chooseMatrixProc(bool trivial_matrix);
160 bool chooseProcs(const SkMatrix& inv, const SkPaint&); 161 bool chooseProcs(const SkMatrix& inv, const SkPaint&);
161 ShaderProc32 chooseShaderProc32(); 162 ShaderProc32 chooseShaderProc32();
162 163
163 void possiblyScaleImage(); 164 // returns false if we did not try to scale the image. In that case, we
165 // will need to "lock" its pixels some other way.
166 bool possiblyScaleImage();
167
168 // returns false if we failed to "lock" the pixels at all. Typically this
169 // means we have to abort the shader.
170 bool lockBaseBitmap();
164 171
165 SkBitmapFilter* fBitmapFilter; 172 SkBitmapFilter* fBitmapFilter;
166 173
167 // If supported, sets fShaderProc32 and fShaderProc16 and returns true, 174 // If supported, sets fShaderProc32 and fShaderProc16 and returns true,
168 // otherwise returns false. 175 // otherwise returns false.
169 bool setBitmapFilterProcs(); 176 bool setBitmapFilterProcs();
170 177
171 // Return false if we failed to setup for fast translate (e.g. overflow) 178 // Return false if we failed to setup for fast translate (e.g. overflow)
172 bool setupForTranslate(); 179 bool setupForTranslate();
173 180
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 void S32_D16_filter_DX(const SkBitmapProcState& s, 229 void S32_D16_filter_DX(const SkBitmapProcState& s,
223 const uint32_t* xy, int count, uint16_t* colors); 230 const uint32_t* xy, int count, uint16_t* colors);
224 231
225 void highQualityFilter32(const SkBitmapProcState &s, int x, int y, 232 void highQualityFilter32(const SkBitmapProcState &s, int x, int y,
226 SkPMColor *SK_RESTRICT colors, int count); 233 SkPMColor *SK_RESTRICT colors, int count);
227 void highQualityFilter16(const SkBitmapProcState &s, int x, int y, 234 void highQualityFilter16(const SkBitmapProcState &s, int x, int y,
228 uint16_t *SK_RESTRICT colors, int count); 235 uint16_t *SK_RESTRICT colors, int count);
229 236
230 237
231 #endif 238 #endif
OLDNEW
« no previous file with comments | « src/core/SkBitmapProcShader.cpp ('k') | src/core/SkBitmapProcState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698