| 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 #ifndef GrClipMaskManager_DEFINED | 7 #ifndef GrClipMaskManager_DEFINED |
| 8 #define GrClipMaskManager_DEFINED | 8 #define GrClipMaskManager_DEFINED |
| 9 | 9 |
| 10 #include "GrPipelineBuilder.h" | 10 #include "GrPipelineBuilder.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 // Draws the clip into the stencil buffer | 78 // Draws the clip into the stencil buffer |
| 79 bool createStencilClipMask(GrRenderTarget*, | 79 bool createStencilClipMask(GrRenderTarget*, |
| 80 int32_t elementsGenID, | 80 int32_t elementsGenID, |
| 81 GrReducedClip::InitialState initialState, | 81 GrReducedClip::InitialState initialState, |
| 82 const GrReducedClip::ElementList& elements, | 82 const GrReducedClip::ElementList& elements, |
| 83 const SkIRect& clipSpaceIBounds, | 83 const SkIRect& clipSpaceIBounds, |
| 84 const SkIPoint& clipSpaceToStencilOffset); | 84 const SkIPoint& clipSpaceToStencilOffset); |
| 85 | 85 |
| 86 // Creates an alpha mask of the clip. The mask is a rasterization of element
s through the | 86 // Creates an alpha mask of the clip. The mask is a rasterization of element
s through the |
| 87 // rect specified by clipSpaceIBounds. | 87 // rect specified by clipSpaceIBounds. |
| 88 static GrTexture* CreateAlphaClipMask(GrContext*, | 88 static sk_sp<GrTexture> CreateAlphaClipMask(GrContext*, |
| 89 int32_t elementsGenID, | 89 int32_t elementsGenID, |
| 90 GrReducedClip::InitialState initialSta
te, | 90 GrReducedClip::InitialState init
ialState, |
| 91 const GrReducedClip::ElementList& elem
ents, | 91 const GrReducedClip::ElementList
& elements, |
| 92 const SkVector& clipToMaskOffset, | 92 const SkVector& clipToMaskOffset
, |
| 93 const SkIRect& clipSpaceIBounds); | 93 const SkIRect& clipSpaceIBounds)
; |
| 94 | 94 |
| 95 // Similar to createAlphaClipMask but it rasterizes in SW and uploads to the
result texture. | 95 // Similar to createAlphaClipMask but it rasterizes in SW and uploads to the
result texture. |
| 96 static GrTexture* CreateSoftwareClipMask(GrContext*, | 96 static sk_sp<GrTexture> CreateSoftwareClipMask(GrContext*, |
| 97 int32_t elementsGenID, | 97 int32_t elementsGenID, |
| 98 GrReducedClip::InitialState initial
State, | 98 GrReducedClip::InitialState i
nitialState, |
| 99 const GrReducedClip::ElementList& e
lements, | 99 const GrReducedClip::ElementL
ist& elements, |
| 100 const SkVector& clipToMaskOffset, | 100 const SkVector& clipToMaskOff
set, |
| 101 const SkIRect& clipSpaceIBounds); | 101 const SkIRect& clipSpaceIBoun
ds); |
| 102 | 102 |
| 103 static bool UseSWOnlyPath(GrContext*, | 103 static bool UseSWOnlyPath(GrContext*, |
| 104 const GrPipelineBuilder&, | 104 const GrPipelineBuilder&, |
| 105 const GrRenderTarget* rt, | 105 const GrRenderTarget* rt, |
| 106 const SkVector& clipToMaskOffset, | 106 const SkVector& clipToMaskOffset, |
| 107 const GrReducedClip::ElementList& elements); | 107 const GrReducedClip::ElementList& elements); |
| 108 | 108 |
| 109 GrTexture* createCachedMask(int width, int height, const GrUniqueKey& key, b
ool renderTarget); | 109 GrTexture* createCachedMask(int width, int height, const GrUniqueKey& key, b
ool renderTarget); |
| 110 | 110 |
| 111 static const int kMaxAnalyticElements = 4; | 111 static const int kMaxAnalyticElements = 4; |
| 112 | 112 |
| 113 GrDrawTarget* fDrawTarget; // This is our owning draw target. | 113 GrDrawTarget* fDrawTarget; // This is our owning draw target. |
| 114 | 114 |
| 115 typedef SkNoncopyable INHERITED; | 115 typedef SkNoncopyable INHERITED; |
| 116 }; | 116 }; |
| 117 #endif // GrClipMaskManager_DEFINED | 117 #endif // GrClipMaskManager_DEFINED |
| OLD | NEW |