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