| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 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 #ifndef GrClipStackClip_DEFINED | 7 #ifndef GrClipStackClip_DEFINED |
| 8 #define GrClipStackClip_DEFINED | 8 #define GrClipStackClip_DEFINED |
| 9 | 9 |
| 10 #include "GrClip.h" | 10 #include "GrClip.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 | 42 |
| 43 private: | 43 private: |
| 44 static bool PathNeedsSWRenderer(GrContext* context, | 44 static bool PathNeedsSWRenderer(GrContext* context, |
| 45 bool hasUserStencilSettings, | 45 bool hasUserStencilSettings, |
| 46 const GrDrawContext*, | 46 const GrDrawContext*, |
| 47 const SkMatrix& viewMatrix, | 47 const SkMatrix& viewMatrix, |
| 48 const SkClipStack::Element* element, | 48 const SkClipStack::Element* element, |
| 49 GrPathRenderer** prOut, | 49 GrPathRenderer** prOut, |
| 50 bool needsStencil); | 50 bool needsStencil); |
| 51 | 51 |
| 52 // Draws the clip into the stencil buffer | |
| 53 static bool CreateStencilClipMask(GrContext*, | |
| 54 GrDrawContext*, | |
| 55 const GrReducedClip&, | |
| 56 const SkIPoint& clipSpaceToStencilOffset); | |
| 57 | |
| 58 // Creates an alpha mask of the clip. The mask is a rasterization of element
s through the | 52 // Creates an alpha mask of the clip. The mask is a rasterization of element
s through the |
| 59 // rect specified by clipSpaceIBounds. | 53 // rect specified by clipSpaceIBounds. |
| 60 static sk_sp<GrTexture> CreateAlphaClipMask(GrContext*, | 54 static sk_sp<GrTexture> CreateAlphaClipMask(GrContext*, const GrReducedClip&
); |
| 61 const GrReducedClip&, | |
| 62 const SkVector& clipToMaskOffset
); | |
| 63 | 55 |
| 64 // Similar to createAlphaClipMask but it rasterizes in SW and uploads to the
result texture. | 56 // Similar to createAlphaClipMask but it rasterizes in SW and uploads to the
result texture. |
| 65 static sk_sp<GrTexture> CreateSoftwareClipMask(GrTextureProvider*, | 57 static sk_sp<GrTexture> CreateSoftwareClipMask(GrTextureProvider*, const GrR
educedClip&); |
| 66 const GrReducedClip&, | |
| 67 const SkVector& clipToMaskOff
set); | |
| 68 | 58 |
| 69 static bool UseSWOnlyPath(GrContext*, | 59 static bool UseSWOnlyPath(GrContext*, |
| 70 bool hasUserStencilSettings, | 60 bool hasUserStencilSettings, |
| 71 const GrDrawContext*, | 61 const GrDrawContext*, |
| 72 const SkVector& clipToMaskOffset, | 62 const GrReducedClip&); |
| 73 const GrReducedClip::ElementList& elements); | |
| 74 | 63 |
| 75 static GrTexture* CreateCachedMask(int width, int height, const GrUniqueKey&
key, | 64 static GrTexture* CreateCachedMask(int width, int height, const GrUniqueKey&
key, |
| 76 bool renderTarget); | 65 bool renderTarget); |
| 77 | 66 |
| 78 SkIPoint fOrigin; | 67 SkIPoint fOrigin; |
| 79 SkAutoTUnref<const SkClipStack> fStack; | 68 SkAutoTUnref<const SkClipStack> fStack; |
| 80 }; | 69 }; |
| 81 | 70 |
| 82 #endif // GrClipStackClip_DEFINED | 71 #endif // GrClipStackClip_DEFINED |
| OLD | NEW |