| OLD | NEW | 
|---|
| 1 /* | 1 /* | 
| 2  * Copyright 2012 Google Inc. | 2  * Copyright 2012 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 "Sk4fLinearGradient.h" | 8 #include "Sk4fLinearGradient.h" | 
| 9 #include "SkLinearGradient.h" | 9 #include "SkLinearGradient.h" | 
| 10 | 10 | 
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 44     matrix.setSinCos(-vec.fY, vec.fX, pts[0].fX, pts[0].fY); | 44     matrix.setSinCos(-vec.fY, vec.fX, pts[0].fX, pts[0].fY); | 
| 45     matrix.postTranslate(-pts[0].fX, -pts[0].fY); | 45     matrix.postTranslate(-pts[0].fX, -pts[0].fY); | 
| 46     matrix.postScale(inv, inv); | 46     matrix.postScale(inv, inv); | 
| 47     return matrix; | 47     return matrix; | 
| 48 } | 48 } | 
| 49 | 49 | 
| 50 static bool use_4f_context(const SkShader::ContextRec& rec, uint32_t flags) { | 50 static bool use_4f_context(const SkShader::ContextRec& rec, uint32_t flags) { | 
| 51 #ifdef FORCE_4F_CONTEXT | 51 #ifdef FORCE_4F_CONTEXT | 
| 52     return true; | 52     return true; | 
| 53 #else | 53 #else | 
| 54     // Perspective not supported in 4f yet. |  | 
| 55     if (rec.fMatrix->hasPerspective() |  | 
| 56         || (rec.fLocalMatrix && rec.fLocalMatrix->hasPerspective())) { |  | 
| 57         return false; |  | 
| 58     } |  | 
| 59 |  | 
| 60     return rec.fPreferredDstType == SkShader::ContextRec::kPM4f_DstType | 54     return rec.fPreferredDstType == SkShader::ContextRec::kPM4f_DstType | 
| 61         || SkToBool(flags & SkLinearGradient::kForce4fContext_PrivateFlag); | 55         || SkToBool(flags & SkLinearGradient::kForce4fContext_PrivateFlag); | 
| 62 #endif | 56 #endif | 
| 63 } | 57 } | 
| 64 | 58 | 
| 65 /////////////////////////////////////////////////////////////////////////////// | 59 /////////////////////////////////////////////////////////////////////////////// | 
| 66 | 60 | 
| 67 SkLinearGradient::SkLinearGradient(const SkPoint pts[2], const Descriptor& desc) | 61 SkLinearGradient::SkLinearGradient(const SkPoint pts[2], const Descriptor& desc) | 
| 68     : SkGradientShaderBase(desc, pts_to_unit_matrix(pts)) | 62     : SkGradientShaderBase(desc, pts_to_unit_matrix(pts)) | 
| 69     , fStart(pts[0]) | 63     , fStart(pts[0]) | 
| (...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 760             this->shade4_dx_clamp<false, true>(dstC, count, fx, dx, invDx, dithe
     r); | 754             this->shade4_dx_clamp<false, true>(dstC, count, fx, dx, invDx, dithe
     r); | 
| 761         } | 755         } | 
| 762     } else { | 756     } else { | 
| 763         if (fApplyAlphaAfterInterp) { | 757         if (fApplyAlphaAfterInterp) { | 
| 764             this->shade4_dx_clamp<true, false>(dstC, count, fx, dx, invDx, dithe
     r); | 758             this->shade4_dx_clamp<true, false>(dstC, count, fx, dx, invDx, dithe
     r); | 
| 765         } else { | 759         } else { | 
| 766             this->shade4_dx_clamp<false, false>(dstC, count, fx, dx, invDx, dith
     er); | 760             this->shade4_dx_clamp<false, false>(dstC, count, fx, dx, invDx, dith
     er); | 
| 767         } | 761         } | 
| 768     } | 762     } | 
| 769 } | 763 } | 
| OLD | NEW | 
|---|