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 #include "SkXfermode.h" | 10 #include "SkXfermode.h" |
(...skipping 1086 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1097 if (bgTex) { | 1097 if (bgTex) { |
1098 bgKey = GrGLEffectMatrix::GenKey(GrEffect::MakeDivByTextureWHMat
rix(bgTex), | 1098 bgKey = GrGLEffectMatrix::GenKey(GrEffect::MakeDivByTextureWHMat
rix(bgTex), |
1099 drawEffect, | 1099 drawEffect, |
1100 GLEffect::kCoordsType, | 1100 GLEffect::kCoordsType, |
1101 bgTex); | 1101 bgTex); |
1102 } | 1102 } |
1103 EffectKey modeKey = xfer.mode() << GrGLEffectMatrix::kKeyBits; | 1103 EffectKey modeKey = xfer.mode() << GrGLEffectMatrix::kKeyBits; |
1104 return modeKey | bgKey; | 1104 return modeKey | bgKey; |
1105 } | 1105 } |
1106 | 1106 |
1107 virtual void setData(const GrGLUniformManager& uman, const GrDrawEffect&
drawEffect) SK_OVERRIDE { | 1107 virtual void setData(const GrGLContext& context, const GrDrawEffect& dra
wEffect) SK_OVERRIDE { |
1108 const XferEffect& xfer = drawEffect.castEffect<XferEffect>(); | 1108 const XferEffect& xfer = drawEffect.castEffect<XferEffect>(); |
1109 GrTexture* bgTex = xfer.backgroundAccess().getTexture(); | 1109 GrTexture* bgTex = xfer.backgroundAccess().getTexture(); |
1110 if (bgTex) { | 1110 if (bgTex) { |
1111 fBackgroundEffectMatrix.setData(uman, | 1111 fBackgroundEffectMatrix.setData(context, |
1112 GrEffect::MakeDivByTextureWHMatr
ix(bgTex), | 1112 GrEffect::MakeDivByTextureWHMatr
ix(bgTex), |
1113 drawEffect, | 1113 drawEffect, |
1114 bgTex); | 1114 bgTex); |
1115 } | 1115 } |
1116 } | 1116 } |
1117 | 1117 |
1118 private: | 1118 private: |
1119 static void HardLight(GrGLShaderBuilder* builder, | 1119 static void HardLight(GrGLShaderBuilder* builder, |
1120 const char* final, | 1120 const char* final, |
1121 const char* src, | 1121 const char* src, |
(...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1971 return proc16; | 1971 return proc16; |
1972 } | 1972 } |
1973 | 1973 |
1974 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkXfermode) | 1974 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkXfermode) |
1975 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkProcCoeffXfermode) | 1975 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkProcCoeffXfermode) |
1976 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkClearXfermode) | 1976 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkClearXfermode) |
1977 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSrcXfermode) | 1977 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSrcXfermode) |
1978 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDstInXfermode) | 1978 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDstInXfermode) |
1979 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDstOutXfermode) | 1979 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDstOutXfermode) |
1980 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END | 1980 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END |
OLD | NEW |