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

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

Issue 1759323002: Revert of 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
37 #if SK_SUPPORT_GPU 39 #if SK_SUPPORT_GPU
38 const GrFragmentProcessor* asFragmentProcessor(GrContext*, 40 const GrFragmentProcessor* asFragmentProcessor(GrContext*,
39 const SkMatrix& viewM, 41 const SkMatrix& viewM,
40 const SkMatrix* localMatrix, 42 const SkMatrix* localMatrix,
41 SkFilterQuality) const overr ide; 43 SkFilterQuality) const overr ide;
42 #endif 44 #endif
43 45
44 class ComposeShaderContext : public SkShader::Context { 46 class ComposeShaderContext : public SkShader::Context {
45 public: 47 public:
46 // When this object gets destroyed, it will call contextA and contextB's destructor 48 // When this object gets destroyed, it will call contextA and contextB's destructor
(...skipping 21 matching lines...) Expand all
68 #endif 70 #endif
69 71
70 bool asACompose(ComposeRec* rec) const override; 72 bool asACompose(ComposeRec* rec) const override;
71 73
72 SK_TO_STRING_OVERRIDE() 74 SK_TO_STRING_OVERRIDE()
73 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkComposeShader) 75 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkComposeShader)
74 76
75 protected: 77 protected:
76 SkComposeShader(SkReadBuffer& ); 78 SkComposeShader(SkReadBuffer& );
77 void flatten(SkWriteBuffer&) const override; 79 void flatten(SkWriteBuffer&) const override;
78 size_t onContextSize(const ContextRec&) const override;
79 Context* onCreateContext(const ContextRec&, void*) const override; 80 Context* onCreateContext(const ContextRec&, void*) const override;
80 81
81 private: 82 private:
82 SkShader* fShaderA; 83 SkShader* fShaderA;
83 SkShader* fShaderB; 84 SkShader* fShaderB;
84 SkXfermode* fMode; 85 SkXfermode* fMode;
85 86
86 typedef SkShader INHERITED; 87 typedef SkShader INHERITED;
87 }; 88 };
88 89
89 #endif 90 #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