OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SkAvoidXfermode.h" | 8 #include "SkAvoidXfermode.h" |
9 #include "SkColorPriv.h" | 9 #include "SkColorPriv.h" |
10 #include "SkReadBuffer.h" | 10 #include "SkReadBuffer.h" |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 return fOpColor == fp.fOpColor && | 216 return fOpColor == fp.fOpColor && |
217 fTolerance == fp.fTolerance && | 217 fTolerance == fp.fTolerance && |
218 fMode == fp.fMode; | 218 fMode == fp.fMode; |
219 } | 219 } |
220 | 220 |
221 void onComputeInvariantOutput(GrInvariantOutput* inout) const override { | 221 void onComputeInvariantOutput(GrInvariantOutput* inout) const override { |
222 inout->setToUnknown(GrInvariantOutput::kWill_ReadInput); | 222 inout->setToUnknown(GrInvariantOutput::kWill_ReadInput); |
223 } | 223 } |
224 | 224 |
225 AvoidFP(SkColor opColor, uint8_t tolerance, | 225 AvoidFP(SkColor opColor, uint8_t tolerance, |
226 SkAvoidXfermode::Mode mode, const GrFragmentProcessor* dst) | 226 SkAvoidXfermode::Mode mode, const GrFragmentProcessor* dst) |
227 : fOpColor(opColor), fTolerance(tolerance), fMode(mode) { | 227 : fOpColor(opColor), fTolerance(tolerance), fMode(mode) { |
228 this->initClassID<AvoidFP>(); | 228 this->initClassID<AvoidFP>(); |
229 | 229 |
230 SkASSERT(dst); | 230 SkASSERT(dst); |
231 SkDEBUGCODE(int dstIndex = )this->registerChildProcessor(dst); | 231 SkDEBUGCODE(int dstIndex = )this->registerChildProcessor(dst); |
232 SkASSERT(0 == dstIndex); | 232 SkASSERT(0 == dstIndex); |
233 } | 233 } |
234 | 234 |
235 SkColor fOpColor; | 235 SkColor fOpColor; |
236 uint8_t fTolerance; | 236 uint8_t fTolerance; |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 private: | 370 private: |
371 GrXferProcessor::OptFlags onGetOptimizations(const GrPipelineOptimizations&
optimizations, | 371 GrXferProcessor::OptFlags onGetOptimizations(const GrPipelineOptimizations&
optimizations, |
372 bool doesStencilWrite, | 372 bool doesStencilWrite, |
373 GrColor* overrideColor, | 373 GrColor* overrideColor, |
374 const GrCaps& caps) const overr
ide { | 374 const GrCaps& caps) const overr
ide { |
375 return GrXferProcessor::kNone_OptFlags; | 375 return GrXferProcessor::kNone_OptFlags; |
376 } | 376 } |
377 | 377 |
378 void onGetGLSLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b)
const override; | 378 void onGetGLSLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b)
const override; |
379 | 379 |
380 bool onIsEqual(const GrXferProcessor& xpBase) const override { | 380 bool onIsEqual(const GrXferProcessor& xpBase) const override { |
381 const AvoidXP& xp = xpBase.cast<AvoidXP>(); | 381 const AvoidXP& xp = xpBase.cast<AvoidXP>(); |
382 | 382 |
383 return fOpColor == xp.fOpColor && | 383 return fOpColor == xp.fOpColor && |
384 fTolerance == xp.fTolerance && | 384 fTolerance == xp.fTolerance && |
385 fMode == xp.fMode; | 385 fMode == xp.fMode; |
386 } | 386 } |
387 | 387 |
388 SkColor fOpColor; | 388 SkColor fOpColor; |
389 uint8_t fTolerance; | 389 uint8_t fTolerance; |
390 SkAvoidXfermode::Mode fMode; | 390 SkAvoidXfermode::Mode fMode; |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
535 void SkAvoidXfermode::toString(SkString* str) const { | 535 void SkAvoidXfermode::toString(SkString* str) const { |
536 str->append("AvoidXfermode: opColor: "); | 536 str->append("AvoidXfermode: opColor: "); |
537 str->appendHex(fOpColor); | 537 str->appendHex(fOpColor); |
538 str->appendf("tolerance: %d ", fTolerance); | 538 str->appendf("tolerance: %d ", fTolerance); |
539 | 539 |
540 static const char* gModeStrings[] = { "Avoid", "Target" }; | 540 static const char* gModeStrings[] = { "Avoid", "Target" }; |
541 | 541 |
542 str->appendf("mode: %s", gModeStrings[fMode]); | 542 str->appendf("mode: %s", gModeStrings[fMode]); |
543 } | 543 } |
544 #endif | 544 #endif |
OLD | NEW |