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

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

Issue 1697863002: blitters for sRGB and float16 (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 10 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/core/SkBlitter_PM4f.cpp ('k') | src/core/SkShader.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 2006 The Android Open Source Project 2 * Copyright 2006 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 #ifndef SkCoreBlitters_DEFINED 8 #ifndef SkCoreBlitters_DEFINED
9 #define SkCoreBlitters_DEFINED 9 #define SkCoreBlitters_DEFINED
10 10
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 * because the shader itself is unchanged). 42 * because the shader itself is unchanged).
43 */ 43 */
44 bool resetShaderContext(const SkShader::ContextRec&) override; 44 bool resetShaderContext(const SkShader::ContextRec&) override;
45 45
46 SkShader::Context* getShaderContext() const override { return fShaderContext ; } 46 SkShader::Context* getShaderContext() const override { return fShaderContext ; }
47 47
48 protected: 48 protected:
49 uint32_t fShaderFlags; 49 uint32_t fShaderFlags;
50 const SkShader* fShader; 50 const SkShader* fShader;
51 SkShader::Context* fShaderContext; 51 SkShader::Context* fShaderContext;
52 bool fConstInY;
52 53
53 private: 54 private:
54 // illegal 55 // illegal
55 SkShaderBlitter& operator=(const SkShaderBlitter&); 56 SkShaderBlitter& operator=(const SkShaderBlitter&);
56 57
57 typedef SkRasterBlitter INHERITED; 58 typedef SkRasterBlitter INHERITED;
58 }; 59 };
59 60
60 /////////////////////////////////////////////////////////////////////////////// 61 ///////////////////////////////////////////////////////////////////////////////
61 62
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 void blitRect(int x, int y, int width, int height) override; 171 void blitRect(int x, int y, int width, int height) override;
171 void blitAntiH(int x, int y, const SkAlpha[], const int16_t[]) override; 172 void blitAntiH(int x, int y, const SkAlpha[], const int16_t[]) override;
172 void blitMask(const SkMask&, const SkIRect&) override; 173 void blitMask(const SkMask&, const SkIRect&) override;
173 174
174 private: 175 private:
175 SkXfermode* fXfermode; 176 SkXfermode* fXfermode;
176 SkPMColor* fBuffer; 177 SkPMColor* fBuffer;
177 SkBlitRow::Proc32 fProc32; 178 SkBlitRow::Proc32 fProc32;
178 SkBlitRow::Proc32 fProc32Blend; 179 SkBlitRow::Proc32 fProc32Blend;
179 bool fShadeDirectlyIntoDevice; 180 bool fShadeDirectlyIntoDevice;
180 bool fConstInY;
181 181
182 // illegal 182 // illegal
183 SkARGB32_Shader_Blitter& operator=(const SkARGB32_Shader_Blitter&); 183 SkARGB32_Shader_Blitter& operator=(const SkARGB32_Shader_Blitter&);
184 184
185 typedef SkShaderBlitter INHERITED; 185 typedef SkShaderBlitter INHERITED;
186 }; 186 };
187 187
188 class SkARGB32_Shader4f_Blitter : public SkARGB32_Shader_Blitter { 188 SkBlitter* SkBlitter_ARGB32_Create(const SkPixmap& device, const SkPaint& paint,
189 public: 189 SkShader::Context* shaderContext,
190 SkARGB32_Shader4f_Blitter(const SkPixmap& device, const SkPaint& paint, 190 SkTBlitterAllocator* allocator);
191 SkShader::Context* shaderContext); 191
192 virtual ~SkARGB32_Shader4f_Blitter(); 192 SkBlitter* SkBlitter_ARGB64_Create(const SkPixmap& device, const SkPaint& paint,
193 void blitH(int x, int y, int width) override; 193 SkShader::Context* shaderContext,
194 void blitV(int x, int y, int height, SkAlpha alpha) override; 194 SkTBlitterAllocator* allocator);
195 void blitRect(int x, int y, int width, int height) override;
196 void blitAntiH(int x, int y, const SkAlpha[], const int16_t[]) override;
197 void blitMask(const SkMask&, const SkIRect&) override;
198
199 private:
200 SkXfermode::PM4fState fState;
201 SkXfermode::PM4fProc1 fProc1;
202 SkXfermode::PM4fProcN fProcN;
203 SkPM4f* fBuffer;
204 bool fConstInY;
205
206 // illegal
207 SkARGB32_Shader4f_Blitter& operator=(const SkARGB32_Shader4f_Blitter&);
208
209 typedef SkARGB32_Shader_Blitter INHERITED;
210 };
211 195
212 /////////////////////////////////////////////////////////////////////////////// 196 ///////////////////////////////////////////////////////////////////////////////
213 197
214 /* These return the correct subclass of blitter for their device config. 198 /* These return the correct subclass of blitter for their device config.
215 199
216 Currently, they make the following assumptions about the state of the 200 Currently, they make the following assumptions about the state of the
217 paint: 201 paint:
218 202
219 1. If there is an xfermode, there will also be a shader 203 1. If there is an xfermode, there will also be a shader
220 2. If there is a colorfilter, there will be a shader that itself handles 204 2. If there is a colorfilter, there will be a shader that itself handles
221 calling the filter, so the blitter can always ignore the colorfilter obj 205 calling the filter, so the blitter can always ignore the colorfilter obj
222 206
223 These pre-conditions must be handled by the caller, in our case 207 These pre-conditions must be handled by the caller, in our case
224 SkBlitter::Choose(...) 208 SkBlitter::Choose(...)
225 */ 209 */
226 210
227 SkBlitter* SkBlitter_ChooseD565(const SkPixmap& device, const SkPaint& paint, 211 SkBlitter* SkBlitter_ChooseD565(const SkPixmap& device, const SkPaint& paint,
228 SkShader::Context* shaderContext, 212 SkShader::Context* shaderContext,
229 SkTBlitterAllocator* allocator); 213 SkTBlitterAllocator* allocator);
230 214
231 #endif 215 #endif
OLDNEW
« no previous file with comments | « src/core/SkBlitter_PM4f.cpp ('k') | src/core/SkShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698