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

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

Issue 26340010: Revert "ARM Skia NEON patches - 28 - Xfermode: SIMD modeprocs" (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/SkXfermode.cpp ('k') | src/opts/SkXfermode_opts_arm.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #ifndef SkXfermode_proccoeff_DEFINED
2 #define SkXfermode_proccoeff_DEFINED
3
4 #include "SkXfermode.h"
5 #include "SkFlattenableBuffers.h"
6
7 struct ProcCoeff {
8 SkXfermodeProc fProc;
9 SkXfermode::Coeff fSC;
10 SkXfermode::Coeff fDC;
11 };
12
13 #define CANNOT_USE_COEFF SkXfermode::Coeff(-1)
14
15 extern const ProcCoeff gProcCoeffs[];
16
17 class SkProcCoeffXfermode : public SkProcXfermode {
18 public:
19 SkProcCoeffXfermode(const ProcCoeff& rec, Mode mode)
20 : INHERITED(rec.fProc) {
21 fMode = mode;
22 // these may be valid, or may be CANNOT_USE_COEFF
23 fSrcCoeff = rec.fSC;
24 fDstCoeff = rec.fDC;
25 }
26
27 virtual bool asMode(Mode* mode) const SK_OVERRIDE;
28
29 virtual bool asCoeff(Coeff* sc, Coeff* dc) const SK_OVERRIDE;
30
31 #if SK_SUPPORT_GPU
32 virtual bool asNewEffectOrCoeff(GrContext*,
33 GrEffectRef** effect,
34 Coeff* src,
35 Coeff* dst,
36 GrTexture* background) const SK_OVERRIDE;
37 #endif
38
39 SK_DEVELOPER_TO_STRING()
40 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkProcCoeffXfermode)
41
42 protected:
43 SkProcCoeffXfermode(SkFlattenableReadBuffer& buffer) : INHERITED(buffer) {
44 fMode = (SkXfermode::Mode)buffer.read32();
45
46 const ProcCoeff& rec = gProcCoeffs[fMode];
47 // these may be valid, or may be CANNOT_USE_COEFF
48 fSrcCoeff = rec.fSC;
49 fDstCoeff = rec.fDC;
50 // now update our function-ptr in the super class
51 this->INHERITED::setProc(rec.fProc);
52 }
53
54 virtual void flatten(SkFlattenableWriteBuffer& buffer) const SK_OVERRIDE;
55
56 private:
57 Mode fMode;
58 Coeff fSrcCoeff, fDstCoeff;
59
60 typedef SkProcXfermode INHERITED;
61 };
62
63 #endif // #ifndef SkXfermode_proccoeff_DEFINED
OLDNEW
« no previous file with comments | « src/core/SkXfermode.cpp ('k') | src/opts/SkXfermode_opts_arm.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698