| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
| 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 #include "SkSweepGradient.h" | 9 #include "SkSweepGradient.h" |
| 10 | 10 |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 toggle = next_dither_toggle16(toggle); | 160 toggle = next_dither_toggle16(toggle); |
| 161 } | 161 } |
| 162 } | 162 } |
| 163 } | 163 } |
| 164 | 164 |
| 165 ///////////////////////////////////////////////////////////////////// | 165 ///////////////////////////////////////////////////////////////////// |
| 166 | 166 |
| 167 #if SK_SUPPORT_GPU | 167 #if SK_SUPPORT_GPU |
| 168 | 168 |
| 169 #include "SkGr.h" | 169 #include "SkGr.h" |
| 170 #include "effects/GrExtractAlphaFragmentProcessor.h" | |
| 171 #include "gl/builders/GrGLProgramBuilder.h" | 170 #include "gl/builders/GrGLProgramBuilder.h" |
| 172 | 171 |
| 173 class GrGLSweepGradient : public GrGLGradientEffect { | 172 class GrGLSweepGradient : public GrGLGradientEffect { |
| 174 public: | 173 public: |
| 175 | 174 |
| 176 GrGLSweepGradient(const GrProcessor&) {} | 175 GrGLSweepGradient(const GrProcessor&) {} |
| 177 virtual ~GrGLSweepGradient() { } | 176 virtual ~GrGLSweepGradient() { } |
| 178 | 177 |
| 179 virtual void emitCode(EmitArgs&) override; | 178 virtual void emitCode(EmitArgs&) override; |
| 180 | 179 |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 SkMatrix inv; | 284 SkMatrix inv; |
| 286 if (!localMatrix->invert(&inv)) { | 285 if (!localMatrix->invert(&inv)) { |
| 287 return nullptr; | 286 return nullptr; |
| 288 } | 287 } |
| 289 matrix.postConcat(inv); | 288 matrix.postConcat(inv); |
| 290 } | 289 } |
| 291 matrix.postConcat(fPtsToUnit); | 290 matrix.postConcat(fPtsToUnit); |
| 292 | 291 |
| 293 SkAutoTUnref<const GrFragmentProcessor> inner( | 292 SkAutoTUnref<const GrFragmentProcessor> inner( |
| 294 GrSweepGradient::Create(context, procDataManager, *this, matrix)); | 293 GrSweepGradient::Create(context, procDataManager, *this, matrix)); |
| 295 return GrExtractAlphaFragmentProcessor::Create(inner); | 294 return GrFragmentProcessor::MulOuputByInputAlpha(inner); |
| 296 } | 295 } |
| 297 | 296 |
| 298 #endif | 297 #endif |
| 299 | 298 |
| 300 #ifndef SK_IGNORE_TO_STRING | 299 #ifndef SK_IGNORE_TO_STRING |
| 301 void SkSweepGradient::toString(SkString* str) const { | 300 void SkSweepGradient::toString(SkString* str) const { |
| 302 str->append("SkSweepGradient: ("); | 301 str->append("SkSweepGradient: ("); |
| 303 | 302 |
| 304 str->append("center: ("); | 303 str->append("center: ("); |
| 305 str->appendScalar(fCenter.fX); | 304 str->appendScalar(fCenter.fX); |
| 306 str->append(", "); | 305 str->append(", "); |
| 307 str->appendScalar(fCenter.fY); | 306 str->appendScalar(fCenter.fY); |
| 308 str->append(") "); | 307 str->append(") "); |
| 309 | 308 |
| 310 this->INHERITED::toString(str); | 309 this->INHERITED::toString(str); |
| 311 | 310 |
| 312 str->append(")"); | 311 str->append(")"); |
| 313 } | 312 } |
| 314 #endif | 313 #endif |
| OLD | NEW |