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 "GrClipMaskManager.h" | 8 #include "GrClipMaskManager.h" |
9 #include "GrCaps.h" | 9 #include "GrCaps.h" |
10 #include "GrDrawingManager.h" | 10 #include "GrDrawingManager.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 SkMatrix mat; | 37 SkMatrix mat; |
38 // We use device coords to compute the texture coordinates. We set our matri
x to be a | 38 // We use device coords to compute the texture coordinates. We set our matri
x to be a |
39 // translation to the devBound, and then a scaling matrix to normalized coor
ds. | 39 // translation to the devBound, and then a scaling matrix to normalized coor
ds. |
40 mat.setIDiv(result->width(), result->height()); | 40 mat.setIDiv(result->width(), result->height()); |
41 mat.preTranslate(SkIntToScalar(-devBound.fLeft), | 41 mat.preTranslate(SkIntToScalar(-devBound.fLeft), |
42 SkIntToScalar(-devBound.fTop)); | 42 SkIntToScalar(-devBound.fTop)); |
43 | 43 |
44 SkIRect domainTexels = SkIRect::MakeWH(devBound.width(), devBound.height()); | 44 SkIRect domainTexels = SkIRect::MakeWH(devBound.width(), devBound.height()); |
45 return sk_sp<GrFragmentProcessor>(GrTextureDomainEffect::Make( | 45 return sk_sp<GrFragmentProcessor>(GrTextureDomainEffect::Make( |
46 result, | 46 result, |
| 47 nullptr, |
47 mat, | 48 mat, |
48 GrTextureDomain::MakeTexelDomain(result
, domainTexels), | 49 GrTextureDomain::MakeTexelDomain(result
, domainTexels), |
49 GrTextureDomain::kDecal_Mode, | 50 GrTextureDomain::kDecal_Mode, |
50 GrTextureParams::kNone_FilterMode, | 51 GrTextureParams::kNone_FilterMode, |
51 kDevice_GrCoordSet)); | 52 kDevice_GrCoordSet)); |
52 } | 53 } |
53 | 54 |
54 // Does the path in 'element' require SW rendering? If so, return true (and, | 55 // Does the path in 'element' require SW rendering? If so, return true (and, |
55 // optionally, set 'prOut' to NULL. If not, return false (and, optionally, set | 56 // optionally, set 'prOut' to NULL. If not, return false (and, optionally, set |
56 // 'prOut' to the non-SW path renderer that will do the job). | 57 // 'prOut' to the non-SW path renderer that will do the job). |
(...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
809 sk_sp<GrTexture> result(texProvider->createApproxTexture(desc)); | 810 sk_sp<GrTexture> result(texProvider->createApproxTexture(desc)); |
810 if (!result) { | 811 if (!result) { |
811 return nullptr; | 812 return nullptr; |
812 } | 813 } |
813 result->resourcePriv().setUniqueKey(key); | 814 result->resourcePriv().setUniqueKey(key); |
814 | 815 |
815 helper.toTexture(result.get()); | 816 helper.toTexture(result.get()); |
816 | 817 |
817 return result; | 818 return result; |
818 } | 819 } |
OLD | NEW |