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 | 7 |
8 #ifndef GrDrawContextPriv_DEFINED | 8 #ifndef GrDrawContextPriv_DEFINED |
9 #define GrDrawContextPriv_DEFINED | 9 #define GrDrawContextPriv_DEFINED |
10 | 10 |
11 #include "GrDrawContext.h" | 11 #include "GrDrawContext.h" |
12 | 12 |
13 struct GrUserStencilSettings; | 13 struct GrUserStencilSettings; |
14 | 14 |
15 /** Class that adds methods to GrDrawContext that are only intended for use inte
rnal to Skia. | 15 /** Class that adds methods to GrDrawContext that are only intended for use inte
rnal to Skia. |
16 This class is purely a privileged window into GrDrawContext. It should never
have additional | 16 This class is purely a privileged window into GrDrawContext. It should never
have additional |
17 data members or virtual methods. */ | 17 data members or virtual methods. */ |
18 class GrDrawContextPriv { | 18 class GrDrawContextPriv { |
19 public: | 19 public: |
20 bool drawAndStencilRect(const SkIRect* scissorRect, | 20 bool drawAndStencilRect(const GrClip&, |
21 const GrUserStencilSettings*, | 21 const GrUserStencilSettings*, |
22 SkRegion::Op op, | 22 SkRegion::Op op, |
23 bool invert, | 23 bool invert, |
24 bool doAA, | 24 bool doAA, |
25 const SkMatrix& viewMatrix, | 25 const SkMatrix& viewMatrix, |
26 const SkRect&); | 26 const SkRect&); |
27 | 27 |
28 bool drawAndStencilPath(const SkIRect* scissorRect, | 28 bool drawAndStencilPath(const GrClip&, |
29 const GrUserStencilSettings*, | 29 const GrUserStencilSettings*, |
30 SkRegion::Op op, | 30 SkRegion::Op op, |
31 bool invert, | 31 bool invert, |
32 bool doAA, | 32 bool doAA, |
33 const SkMatrix& viewMatrix, | 33 const SkMatrix& viewMatrix, |
34 const SkPath&); | 34 const SkPath&); |
35 | 35 |
36 void testingOnly_drawBatch(const GrPipelineBuilder& pipelineBuilder, | 36 void testingOnly_drawBatch(const GrPipelineBuilder& pipelineBuilder, |
37 GrDrawBatch* batch); | 37 GrDrawBatch* batch, |
| 38 const GrClip* = nullptr); |
38 | 39 |
39 private: | 40 private: |
40 explicit GrDrawContextPriv(GrDrawContext* drawContext) : fDrawContext(drawCo
ntext) {} | 41 explicit GrDrawContextPriv(GrDrawContext* drawContext) : fDrawContext(drawCo
ntext) {} |
41 GrDrawContextPriv(const GrRenderTargetPriv&) {} // unimpl | 42 GrDrawContextPriv(const GrRenderTargetPriv&) {} // unimpl |
42 GrDrawContextPriv& operator=(const GrRenderTargetPriv&); // unimpl | 43 GrDrawContextPriv& operator=(const GrRenderTargetPriv&); // unimpl |
43 | 44 |
44 // No taking addresses of this type. | 45 // No taking addresses of this type. |
45 const GrDrawContextPriv* operator&() const; | 46 const GrDrawContextPriv* operator&() const; |
46 GrDrawContextPriv* operator&(); | 47 GrDrawContextPriv* operator&(); |
47 | 48 |
48 GrDrawContext* fDrawContext; | 49 GrDrawContext* fDrawContext; |
49 | 50 |
50 friend class GrDrawContext; // to construct/copy this type. | 51 friend class GrDrawContext; // to construct/copy this type. |
51 }; | 52 }; |
52 | 53 |
53 inline GrDrawContextPriv GrDrawContext::drawContextPriv() { return GrDrawContext
Priv(this); } | 54 inline GrDrawContextPriv GrDrawContext::drawContextPriv() { return GrDrawContext
Priv(this); } |
54 | 55 |
55 inline const GrDrawContextPriv GrDrawContext::drawContextPriv () const { | 56 inline const GrDrawContextPriv GrDrawContext::drawContextPriv () const { |
56 return GrDrawContextPriv(const_cast<GrDrawContext*>(this)); | 57 return GrDrawContextPriv(const_cast<GrDrawContext*>(this)); |
57 } | 58 } |
58 | 59 |
59 #endif | 60 #endif |
OLD | NEW |