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 759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
770 } | 770 } |
771 } | 771 } |
772 } | 772 } |
773 | 773 |
774 ////////////////////////////////////////////////////////////////////////////// | 774 ////////////////////////////////////////////////////////////////////////////// |
775 | 775 |
776 #if SK_SUPPORT_GPU | 776 #if SK_SUPPORT_GPU |
777 | 777 |
778 #include "GrFragmentProcessor.h" | 778 #include "GrFragmentProcessor.h" |
779 #include "GrCoordTransform.h" | 779 #include "GrCoordTransform.h" |
| 780 #include "GrInvariantOutput.h" |
780 #include "GrProcessorUnitTest.h" | 781 #include "GrProcessorUnitTest.h" |
781 #include "GrTBackendProcessorFactory.h" | 782 #include "GrTBackendProcessorFactory.h" |
782 #include "gl/GrGLProcessor.h" | 783 #include "gl/GrGLProcessor.h" |
783 #include "gl/builders/GrGLProgramBuilder.h" | 784 #include "gl/builders/GrGLProgramBuilder.h" |
784 | 785 |
785 /** | 786 /** |
786 * GrProcessor that implements the all the separable xfer modes that cannot be e
xpressed as Coeffs. | 787 * GrProcessor that implements the all the separable xfer modes that cannot be e
xpressed as Coeffs. |
787 */ | 788 */ |
788 class XferEffect : public GrFragmentProcessor { | 789 class XferEffect : public GrFragmentProcessor { |
789 public: | 790 public: |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1204 this->addTextureAccess(&fBackgroundAccess); | 1205 this->addTextureAccess(&fBackgroundAccess); |
1205 } else { | 1206 } else { |
1206 this->setWillReadDstColor(); | 1207 this->setWillReadDstColor(); |
1207 } | 1208 } |
1208 } | 1209 } |
1209 virtual bool onIsEqual(const GrFragmentProcessor& other) const SK_OVERRIDE { | 1210 virtual bool onIsEqual(const GrFragmentProcessor& other) const SK_OVERRIDE { |
1210 const XferEffect& s = other.cast<XferEffect>(); | 1211 const XferEffect& s = other.cast<XferEffect>(); |
1211 return fMode == s.fMode; | 1212 return fMode == s.fMode; |
1212 } | 1213 } |
1213 | 1214 |
1214 virtual void onComputeInvariantOutput(InvariantOutput* inout) const SK_OVERR
IDE { | 1215 virtual void onComputeInvariantOutput(GrInvariantOutput* inout) const SK_OVE
RRIDE { |
1215 inout->setToUnknown(InvariantOutput::kWill_ReadInput); | 1216 inout->setToUnknown(GrInvariantOutput::kWill_ReadInput); |
1216 } | 1217 } |
1217 | 1218 |
1218 SkXfermode::Mode fMode; | 1219 SkXfermode::Mode fMode; |
1219 GrCoordTransform fBackgroundTransform; | 1220 GrCoordTransform fBackgroundTransform; |
1220 GrTextureAccess fBackgroundAccess; | 1221 GrTextureAccess fBackgroundAccess; |
1221 | 1222 |
1222 typedef GrFragmentProcessor INHERITED; | 1223 typedef GrFragmentProcessor INHERITED; |
1223 }; | 1224 }; |
1224 | 1225 |
1225 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(XferEffect); | 1226 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(XferEffect); |
(...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1953 } else { | 1954 } else { |
1954 proc16 = rec.fProc16_General; | 1955 proc16 = rec.fProc16_General; |
1955 } | 1956 } |
1956 } | 1957 } |
1957 return proc16; | 1958 return proc16; |
1958 } | 1959 } |
1959 | 1960 |
1960 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkXfermode) | 1961 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkXfermode) |
1961 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkProcCoeffXfermode) | 1962 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkProcCoeffXfermode) |
1962 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END | 1963 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END |
OLD | NEW |