| 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 virtual bool validContext(const SkBitmap&, const SkPaint&, | 37 virtual bool validContext(const ContextRec&, SkMatrix* totalInverse = NULL)
const SK_OVERRIDE; |
| 38 const SkMatrix&, SkMatrix* totalInverse = NULL) co
nst SK_OVERRIDE; | 38 virtual SkShader::Context* createContext(const ContextRec&, void*) const SK_
OVERRIDE; |
| 39 virtual SkShader::Context* createContext(const SkBitmap&, const SkPaint&, | |
| 40 const SkMatrix&, void*) const SK_OV
ERRIDE; | |
| 41 virtual size_t contextSize() const SK_OVERRIDE; | 39 virtual size_t contextSize() const SK_OVERRIDE; |
| 42 | 40 |
| 43 class ComposeShaderContext : public SkShader::Context { | 41 class ComposeShaderContext : public SkShader::Context { |
| 44 public: | 42 public: |
| 45 // When this object gets destroyed, it will call contextA and contextB's
destructor | 43 // When this object gets destroyed, it will call contextA and contextB's
destructor |
| 46 // but it will NOT free the memory. | 44 // but it will NOT free the memory. |
| 47 ComposeShaderContext(const SkComposeShader&, const SkBitmap&, | 45 ComposeShaderContext(const SkComposeShader&, const ContextRec&, |
| 48 const SkPaint&, const SkMatrix&, | |
| 49 SkShader::Context* contextA, SkShader::Context* con
textB); | 46 SkShader::Context* contextA, SkShader::Context* con
textB); |
| 50 | 47 |
| 51 SkShader::Context* getShaderContextA() const { return fShaderContextA; } | 48 SkShader::Context* getShaderContextA() const { return fShaderContextA; } |
| 52 SkShader::Context* getShaderContextB() const { return fShaderContextB; } | 49 SkShader::Context* getShaderContextB() const { return fShaderContextB; } |
| 53 | 50 |
| 54 virtual ~ComposeShaderContext(); | 51 virtual ~ComposeShaderContext(); |
| 55 | 52 |
| 56 virtual void shadeSpan(int x, int y, SkPMColor[], int count) SK_OVERRIDE
; | 53 virtual void shadeSpan(int x, int y, SkPMColor[], int count) SK_OVERRIDE
; |
| 57 | 54 |
| 58 private: | 55 private: |
| (...skipping 17 matching lines...) Expand all Loading... |
| 76 | 73 |
| 77 private: | 74 private: |
| 78 SkShader* fShaderA; | 75 SkShader* fShaderA; |
| 79 SkShader* fShaderB; | 76 SkShader* fShaderB; |
| 80 SkXfermode* fMode; | 77 SkXfermode* fMode; |
| 81 | 78 |
| 82 typedef SkShader INHERITED; | 79 typedef SkShader INHERITED; |
| 83 }; | 80 }; |
| 84 | 81 |
| 85 #endif | 82 #endif |
| OLD | NEW |