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 | 12 |
13 /** Class that adds methods to GrRenderTarget that are only intended for use int
ernal to Skia. | 13 /** 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 | 14 This class is purely a privileged window into GrRenderTarget. It should neve
r have additional |
15 data members or virtual methods. */ | 15 data members or virtual methods. */ |
16 class GrRenderTargetPriv { | 16 class GrRenderTargetPriv { |
17 public: | 17 public: |
18 /** | 18 /** |
19 * GrStencilBuffer is not part of the public API. | 19 * GrStencilAttachment is not part of the public API. |
20 */ | 20 */ |
21 GrStencilBuffer* getStencilBuffer() const { return fRenderTarget->fStencilBu
ffer; } | 21 GrStencilAttachment* getStencilAttachment() const { return fRenderTarget->fS
tencilAttachment; } |
22 | 22 |
23 /** | 23 /** |
24 * If this render target already has a stencil buffer, return it. Otherwise
attempt to attach | 24 * If this render target already has a stencil buffer, return it. Otherwise
attempt to attach |
25 * one. | 25 * one. |
26 */ | 26 */ |
27 GrStencilBuffer* attachStencilBuffer() const; | 27 GrStencilAttachment* attachStencilAttachment() const; |
28 | 28 |
29 void didAttachStencilBuffer(GrStencilBuffer*); | 29 void didAttachStencilAttachment(GrStencilAttachment*); |
30 | 30 |
31 private: | 31 private: |
32 explicit GrRenderTargetPriv(GrRenderTarget* renderTarget) : fRenderTarget(re
nderTarget) {} | 32 explicit GrRenderTargetPriv(GrRenderTarget* renderTarget) : fRenderTarget(re
nderTarget) {} |
33 GrRenderTargetPriv(const GrRenderTargetPriv&) {} // unimpl | 33 GrRenderTargetPriv(const GrRenderTargetPriv&) {} // unimpl |
34 GrRenderTargetPriv& operator=(const GrRenderTargetPriv&); // unimpl | 34 GrRenderTargetPriv& operator=(const GrRenderTargetPriv&); // unimpl |
35 | 35 |
36 // No taking addresses of this type. | 36 // No taking addresses of this type. |
37 const GrRenderTargetPriv* operator&() const; | 37 const GrRenderTargetPriv* operator&() const; |
38 GrRenderTargetPriv* operator&(); | 38 GrRenderTargetPriv* operator&(); |
39 | 39 |
40 GrRenderTarget* fRenderTarget; | 40 GrRenderTarget* fRenderTarget; |
41 | 41 |
42 friend class GrRenderTarget; // to construct/copy this type. | 42 friend class GrRenderTarget; // to construct/copy this type. |
43 }; | 43 }; |
44 | 44 |
45 inline GrRenderTargetPriv GrRenderTarget::renderTargetPriv() { return GrRenderTa
rgetPriv(this); } | 45 inline GrRenderTargetPriv GrRenderTarget::renderTargetPriv() { return GrRenderTa
rgetPriv(this); } |
46 | 46 |
47 inline const GrRenderTargetPriv GrRenderTarget::renderTargetPriv () const { | 47 inline const GrRenderTargetPriv GrRenderTarget::renderTargetPriv () const { |
48 return GrRenderTargetPriv(const_cast<GrRenderTarget*>(this)); | 48 return GrRenderTargetPriv(const_cast<GrRenderTarget*>(this)); |
49 } | 49 } |
50 | 50 |
51 #endif | 51 #endif |
OLD | NEW |