| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
| 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 "effects/GrXfermodeFragmentProcessor.h" | 8 #include "effects/GrXfermodeFragmentProcessor.h" |
| 9 | 9 |
| 10 #include "GrFragmentProcessor.h" | 10 #include "GrFragmentProcessor.h" |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 ComposeOneFragmentProcessor(const GrFragmentProcessor* dst, SkXfermode::Mode
mode, Child child) | 147 ComposeOneFragmentProcessor(const GrFragmentProcessor* dst, SkXfermode::Mode
mode, Child child) |
| 148 : fMode(mode) | 148 : fMode(mode) |
| 149 , fChild(child) { | 149 , fChild(child) { |
| 150 this->initClassID<ComposeOneFragmentProcessor>(); | 150 this->initClassID<ComposeOneFragmentProcessor>(); |
| 151 SkDEBUGCODE(int dstIndex = )this->registerChildProcessor(dst); | 151 SkDEBUGCODE(int dstIndex = )this->registerChildProcessor(dst); |
| 152 SkASSERT(0 == dstIndex); | 152 SkASSERT(0 == dstIndex); |
| 153 } | 153 } |
| 154 | 154 |
| 155 const char* name() const override { return "ComposeOne"; } | 155 const char* name() const override { return "ComposeOne"; } |
| 156 | 156 |
| 157 SkString dumpInfo() const override { |
| 158 SkString str; |
| 159 |
| 160 for (int i = 0; i < this->numChildProcessors(); ++i) { |
| 161 str.append(this->childProcessor(i).dumpInfo()); |
| 162 } |
| 163 return str; |
| 164 } |
| 165 |
| 157 void onGetGLSLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b)
const override { | 166 void onGetGLSLProcessorKey(const GrGLSLCaps& caps, GrProcessorKeyBuilder* b)
const override { |
| 158 GR_STATIC_ASSERT((SkXfermode::kLastMode & SK_MaxU16) == SkXfermode::kLas
tMode); | 167 GR_STATIC_ASSERT((SkXfermode::kLastMode & SK_MaxU16) == SkXfermode::kLas
tMode); |
| 159 b->add32(fMode | (fChild << 16)); | 168 b->add32(fMode | (fChild << 16)); |
| 160 } | 169 } |
| 161 | 170 |
| 162 SkXfermode::Mode mode() const { return fMode; } | 171 SkXfermode::Mode mode() const { return fMode; } |
| 163 | 172 |
| 164 Child child() const { return fChild; } | 173 Child child() const { return fChild; } |
| 165 | 174 |
| 166 protected: | 175 protected: |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 case SkXfermode::kClear_Mode: | 303 case SkXfermode::kClear_Mode: |
| 295 return GrConstColorProcessor::Create(GrColor_TRANSPARENT_BLACK, | 304 return GrConstColorProcessor::Create(GrColor_TRANSPARENT_BLACK, |
| 296 GrConstColorProcessor::kIgnore_
InputMode); | 305 GrConstColorProcessor::kIgnore_
InputMode); |
| 297 case SkXfermode::kDst_Mode: | 306 case SkXfermode::kDst_Mode: |
| 298 return nullptr; | 307 return nullptr; |
| 299 default: | 308 default: |
| 300 return new ComposeOneFragmentProcessor(src, mode, | 309 return new ComposeOneFragmentProcessor(src, mode, |
| 301 ComposeOneFragmentProcessor::
kSrc_Child); | 310 ComposeOneFragmentProcessor::
kSrc_Child); |
| 302 } | 311 } |
| 303 } | 312 } |
| OLD | NEW |