OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 GrGpu_DEFINED | 8 #ifndef GrGpu_DEFINED |
9 #define GrGpu_DEFINED | 9 #define GrGpu_DEFINED |
10 | 10 |
(...skipping 20 matching lines...) Expand all Loading... |
31 class GrPathRendererChain; | 31 class GrPathRendererChain; |
32 class GrPathRendering; | 32 class GrPathRendering; |
33 class GrPipeline; | 33 class GrPipeline; |
34 class GrPrimitiveProcessor; | 34 class GrPrimitiveProcessor; |
35 class GrRenderTarget; | 35 class GrRenderTarget; |
36 class GrStencilAttachment; | 36 class GrStencilAttachment; |
37 class GrStencilSettings; | 37 class GrStencilSettings; |
38 class GrSurface; | 38 class GrSurface; |
39 class GrTexture; | 39 class GrTexture; |
40 | 40 |
| 41 namespace gr_instanced { class InstancedRendering; } |
| 42 |
41 class GrGpu : public SkRefCnt { | 43 class GrGpu : public SkRefCnt { |
42 public: | 44 public: |
43 /** | 45 /** |
44 * Create an instance of GrGpu that matches the specified backend. If the re
quested backend is | 46 * Create an instance of GrGpu that matches the specified backend. If the re
quested backend is |
45 * not supported (at compile-time or run-time) this returns nullptr. The con
text will not be | 47 * not supported (at compile-time or run-time) this returns nullptr. The con
text will not be |
46 * fully constructed and should not be used by GrGpu until after this functi
on returns. | 48 * fully constructed and should not be used by GrGpu until after this functi
on returns. |
47 */ | 49 */ |
48 static GrGpu* Create(GrBackend, GrBackendContext, const GrContextOptions&, G
rContext* context); | 50 static GrGpu* Create(GrBackend, GrBackendContext, const GrContextOptions&, G
rContext* context); |
49 | 51 |
50 //////////////////////////////////////////////////////////////////////////// | 52 //////////////////////////////////////////////////////////////////////////// |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 * @param intendedType hint to the graphics subsystem about what the buff
er will be used for. | 142 * @param intendedType hint to the graphics subsystem about what the buff
er will be used for. |
141 * @param accessPattern hint to the graphics subsystem about how the data
will be accessed. | 143 * @param accessPattern hint to the graphics subsystem about how the data
will be accessed. |
142 * @param data optional data with which to initialize the buffer. | 144 * @param data optional data with which to initialize the buffer. |
143 * | 145 * |
144 * @return the buffer if successful, otherwise nullptr. | 146 * @return the buffer if successful, otherwise nullptr. |
145 */ | 147 */ |
146 GrBuffer* createBuffer(size_t size, GrBufferType intendedType, GrAccessPatte
rn accessPattern, | 148 GrBuffer* createBuffer(size_t size, GrBufferType intendedType, GrAccessPatte
rn accessPattern, |
147 const void* data = nullptr); | 149 const void* data = nullptr); |
148 | 150 |
149 /** | 151 /** |
| 152 * Creates an instanced rendering object if it is supported on this platform
. |
| 153 */ |
| 154 virtual gr_instanced::InstancedRendering* createInstancedRenderingIfSupporte
d() { |
| 155 return nullptr; |
| 156 } |
| 157 |
| 158 /** |
150 * Resolves MSAA. | 159 * Resolves MSAA. |
151 */ | 160 */ |
152 void resolveRenderTarget(GrRenderTarget* target); | 161 void resolveRenderTarget(GrRenderTarget* target); |
153 | 162 |
154 /** Info struct returned by getReadPixelsInfo about performing intermediate
draws before | 163 /** Info struct returned by getReadPixelsInfo about performing intermediate
draws before |
155 reading pixels for performance or correctness. */ | 164 reading pixels for performance or correctness. */ |
156 struct ReadPixelTempDrawInfo { | 165 struct ReadPixelTempDrawInfo { |
157 /** If the GrGpu is requesting that the caller do a draw to an intermedi
ate surface then | 166 /** If the GrGpu is requesting that the caller do a draw to an intermedi
ate surface then |
158 this is descriptor for the temp surface. The draw should always be a
rect with | 167 this is descriptor for the temp surface. The draw should always be a
rect with |
159 dst 0,0,w,h. */ | 168 dst 0,0,w,h. */ |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
572 } | 581 } |
573 | 582 |
574 ResetTimestamp fResetTi
mestamp; | 583 ResetTimestamp fResetTi
mestamp; |
575 uint32_t fResetBi
ts; | 584 uint32_t fResetBi
ts; |
576 SkTArray<const MultisampleSpecs*, true> fMultisa
mpleSpecsMap; | 585 SkTArray<const MultisampleSpecs*, true> fMultisa
mpleSpecsMap; |
577 GrTAllocator<MultisampleSpecs> fMultisa
mpleSpecsAllocator; | 586 GrTAllocator<MultisampleSpecs> fMultisa
mpleSpecsAllocator; |
578 // The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu. | 587 // The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu. |
579 GrContext* fContext
; | 588 GrContext* fContext
; |
580 | 589 |
581 friend class GrPathRendering; | 590 friend class GrPathRendering; |
| 591 friend class gr_instanced::InstancedRendering; |
582 typedef SkRefCnt INHERITED; | 592 typedef SkRefCnt INHERITED; |
583 }; | 593 }; |
584 | 594 |
585 #endif | 595 #endif |
OLD | NEW |