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

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

Issue 1759653004: enforce 16byte alignment in shader contexts (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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/core/SkColorShader.h ('k') | src/core/SkComposeShader.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 #ifndef SkComposeShader_DEFINED 10 #ifndef SkComposeShader_DEFINED
(...skipping 16 matching lines...) Expand all
27 "dst", and the result from shader B as its "src". 27 "dst", and the result from shader B as its "src".
28 mode->xfer32(sA_result, sB_result, ...) 28 mode->xfer32(sA_result, sB_result, ...)
29 @param shaderA The colors from this shader are seen as the "dst" by the xfermode 29 @param shaderA The colors from this shader are seen as the "dst" by the xfermode
30 @param shaderB The colors from this shader are seen as the "src" by the xfermode 30 @param shaderB The colors from this shader are seen as the "src" by the xfermode
31 @param mode The xfermode that combines the colors from the two shade rs. If mode 31 @param mode The xfermode that combines the colors from the two shade rs. If mode
32 is null, then SRC_OVER is assumed. 32 is null, then SRC_OVER is assumed.
33 */ 33 */
34 SkComposeShader(SkShader* sA, SkShader* sB, SkXfermode* mode = NULL); 34 SkComposeShader(SkShader* sA, SkShader* sB, SkXfermode* mode = NULL);
35 virtual ~SkComposeShader(); 35 virtual ~SkComposeShader();
36 36
37 size_t contextSize(const ContextRec&) const override;
38
39 #if SK_SUPPORT_GPU 37 #if SK_SUPPORT_GPU
40 const GrFragmentProcessor* asFragmentProcessor(GrContext*, 38 const GrFragmentProcessor* asFragmentProcessor(GrContext*,
41 const SkMatrix& viewM, 39 const SkMatrix& viewM,
42 const SkMatrix* localMatrix, 40 const SkMatrix* localMatrix,
43 SkFilterQuality) const overr ide; 41 SkFilterQuality) const overr ide;
44 #endif 42 #endif
45 43
46 class ComposeShaderContext : public SkShader::Context { 44 class ComposeShaderContext : public SkShader::Context {
47 public: 45 public:
48 // When this object gets destroyed, it will call contextA and contextB's destructor 46 // When this object gets destroyed, it will call contextA and contextB's destructor
(...skipping 21 matching lines...) Expand all
70 #endif 68 #endif
71 69
72 bool asACompose(ComposeRec* rec) const override; 70 bool asACompose(ComposeRec* rec) const override;
73 71
74 SK_TO_STRING_OVERRIDE() 72 SK_TO_STRING_OVERRIDE()
75 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkComposeShader) 73 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkComposeShader)
76 74
77 protected: 75 protected:
78 SkComposeShader(SkReadBuffer& ); 76 SkComposeShader(SkReadBuffer& );
79 void flatten(SkWriteBuffer&) const override; 77 void flatten(SkWriteBuffer&) const override;
78 size_t onContextSize(const ContextRec&) const override;
80 Context* onCreateContext(const ContextRec&, void*) const override; 79 Context* onCreateContext(const ContextRec&, void*) const override;
81 80
82 private: 81 private:
83 SkShader* fShaderA; 82 SkShader* fShaderA;
84 SkShader* fShaderB; 83 SkShader* fShaderB;
85 SkXfermode* fMode; 84 SkXfermode* fMode;
86 85
87 typedef SkShader INHERITED; 86 typedef SkShader INHERITED;
88 }; 87 };
89 88
90 #endif 89 #endif
OLDNEW
« no previous file with comments | « src/core/SkColorShader.h ('k') | src/core/SkComposeShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698