OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |