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 GrStencilSettings; |
| 14 |
13 /** Class that adds methods to GrRenderTarget that are only intended for use int
ernal to Skia. | 15 /** 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 | 16 This class is purely a privileged window into GrRenderTarget. It should neve
r have additional |
15 data members or virtual methods. */ | 17 data members or virtual methods. */ |
16 class GrRenderTargetPriv { | 18 class GrRenderTargetPriv { |
17 public: | 19 public: |
| 20 typedef GrRenderTarget::MultisampleSpecs MultisampleSpecs; |
| 21 |
18 /** | 22 /** |
19 * GrStencilAttachment is not part of the public API. | 23 * GrStencilAttachment is not part of the public API. |
20 */ | 24 */ |
21 GrStencilAttachment* getStencilAttachment() const { return fRenderTarget->fS
tencilAttachment; } | 25 GrStencilAttachment* getStencilAttachment() const { return fRenderTarget->fS
tencilAttachment; } |
22 | 26 |
23 /** | 27 /** |
24 * Attaches the GrStencilAttachment onto the render target. If stencil is a
nullptr then the | 28 * 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 | 29 * 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. | 30 * function returns false if there were any failure in attaching the GrStenc
ilAttachment. |
27 */ | 31 */ |
28 bool attachStencilAttachment(GrStencilAttachment* stencil); | 32 bool attachStencilAttachment(GrStencilAttachment* stencil); |
29 | 33 |
| 34 /** |
| 35 * Used by GrGpu to cache the render target's multisample info. |
| 36 */ |
| 37 SkAutoTDelete<MultisampleSpecs>* accessMultisampleSpecs() { |
| 38 return &fRenderTarget->fMultisampleSpecs; |
| 39 } |
| 40 |
| 41 const MultisampleSpecs& getMultisampleSpecs(const GrStencilSettings&); |
| 42 |
30 private: | 43 private: |
31 explicit GrRenderTargetPriv(GrRenderTarget* renderTarget) : fRenderTarget(re
nderTarget) {} | 44 explicit GrRenderTargetPriv(GrRenderTarget* renderTarget) : fRenderTarget(re
nderTarget) {} |
32 GrRenderTargetPriv(const GrRenderTargetPriv&) {} // unimpl | 45 GrRenderTargetPriv(const GrRenderTargetPriv&) {} // unimpl |
33 GrRenderTargetPriv& operator=(const GrRenderTargetPriv&); // unimpl | 46 GrRenderTargetPriv& operator=(const GrRenderTargetPriv&); // unimpl |
34 | 47 |
35 // No taking addresses of this type. | 48 // No taking addresses of this type. |
36 const GrRenderTargetPriv* operator&() const; | 49 const GrRenderTargetPriv* operator&() const; |
37 GrRenderTargetPriv* operator&(); | 50 GrRenderTargetPriv* operator&(); |
38 | 51 |
39 GrRenderTarget* fRenderTarget; | 52 GrRenderTarget* fRenderTarget; |
40 | 53 |
41 friend class GrRenderTarget; // to construct/copy this type. | 54 friend class GrRenderTarget; // to construct/copy this type. |
42 }; | 55 }; |
43 | 56 |
44 inline GrRenderTargetPriv GrRenderTarget::renderTargetPriv() { return GrRenderTa
rgetPriv(this); } | 57 inline GrRenderTargetPriv GrRenderTarget::renderTargetPriv() { return GrRenderTa
rgetPriv(this); } |
45 | 58 |
46 inline const GrRenderTargetPriv GrRenderTarget::renderTargetPriv () const { | 59 inline const GrRenderTargetPriv GrRenderTarget::renderTargetPriv () const { |
47 return GrRenderTargetPriv(const_cast<GrRenderTarget*>(this)); | 60 return GrRenderTargetPriv(const_cast<GrRenderTarget*>(this)); |
48 } | 61 } |
49 | 62 |
50 #endif | 63 #endif |
OLD | NEW |