OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 GrRenderTargetPriv_DEFINED | 8 #ifndef GrRenderTargetPriv_DEFINED |
9 #define GrRenderTargetPriv_DEFINED | 9 #define GrRenderTargetPriv_DEFINED |
10 | 10 |
11 #include "GrRenderTarget.h" | 11 #include "GrRenderTarget.h" |
| 12 #include "GrGpu.h" |
| 13 |
| 14 class GrStencilSettings; |
12 | 15 |
13 /** Class that adds methods to GrRenderTarget that are only intended for use int
ernal to Skia. | 16 /** Class that adds methods to GrRenderTarget that are only intended for use int
ernal to Skia. |
14 This class is purely a privileged window into GrRenderTarget. It should neve
r have additional | 17 This class is purely a privileged window into GrRenderTarget. It should neve
r have additional |
15 data members or virtual methods. */ | 18 data members or virtual methods. */ |
16 class GrRenderTargetPriv { | 19 class GrRenderTargetPriv { |
17 public: | 20 public: |
18 /** | 21 /** |
19 * GrStencilAttachment is not part of the public API. | 22 * GrStencilAttachment is not part of the public API. |
20 */ | 23 */ |
21 GrStencilAttachment* getStencilAttachment() const { return fRenderTarget->fS
tencilAttachment; } | 24 GrStencilAttachment* getStencilAttachment() const { return fRenderTarget->fS
tencilAttachment; } |
22 | 25 |
23 /** | 26 /** |
24 * Attaches the GrStencilAttachment onto the render target. If stencil is a
nullptr then the | 27 * Attaches the GrStencilAttachment onto the render target. If stencil is a
nullptr then the |
25 * currently attached GrStencilAttachment will be removed if one was previou
sly attached. This | 28 * currently attached GrStencilAttachment will be removed if one was previou
sly attached. This |
26 * function returns false if there were any failure in attaching the GrStenc
ilAttachment. | 29 * function returns false if there were any failure in attaching the GrStenc
ilAttachment. |
27 */ | 30 */ |
28 bool attachStencilAttachment(GrStencilAttachment* stencil); | 31 bool attachStencilAttachment(GrStencilAttachment* stencil); |
29 | 32 |
| 33 const GrGpu::MultisampleSpecs& getMultisampleSpecs(const GrStencilSettings&
stencil) const; |
| 34 |
30 private: | 35 private: |
31 explicit GrRenderTargetPriv(GrRenderTarget* renderTarget) : fRenderTarget(re
nderTarget) {} | 36 explicit GrRenderTargetPriv(GrRenderTarget* renderTarget) : fRenderTarget(re
nderTarget) {} |
32 GrRenderTargetPriv(const GrRenderTargetPriv&) {} // unimpl | 37 GrRenderTargetPriv(const GrRenderTargetPriv&) {} // unimpl |
33 GrRenderTargetPriv& operator=(const GrRenderTargetPriv&); // unimpl | 38 GrRenderTargetPriv& operator=(const GrRenderTargetPriv&); // unimpl |
34 | 39 |
35 // No taking addresses of this type. | 40 // No taking addresses of this type. |
36 const GrRenderTargetPriv* operator&() const; | 41 const GrRenderTargetPriv* operator&() const; |
37 GrRenderTargetPriv* operator&(); | 42 GrRenderTargetPriv* operator&(); |
38 | 43 |
39 GrRenderTarget* fRenderTarget; | 44 GrRenderTarget* fRenderTarget; |
40 | 45 |
41 friend class GrRenderTarget; // to construct/copy this type. | 46 friend class GrRenderTarget; // to construct/copy this type. |
42 }; | 47 }; |
43 | 48 |
44 inline GrRenderTargetPriv GrRenderTarget::renderTargetPriv() { return GrRenderTa
rgetPriv(this); } | 49 inline GrRenderTargetPriv GrRenderTarget::renderTargetPriv() { return GrRenderTa
rgetPriv(this); } |
45 | 50 |
46 inline const GrRenderTargetPriv GrRenderTarget::renderTargetPriv () const { | 51 inline const GrRenderTargetPriv GrRenderTarget::renderTargetPriv () const { |
47 return GrRenderTargetPriv(const_cast<GrRenderTarget*>(this)); | 52 return GrRenderTargetPriv(const_cast<GrRenderTarget*>(this)); |
48 } | 53 } |
49 | 54 |
50 #endif | 55 #endif |
OLD | NEW |