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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 * @param data optional data with which to initialize the buffer. | 145 * @param data optional data with which to initialize the buffer. |
146 * | 146 * |
147 * @return the buffer if successful, otherwise nullptr. | 147 * @return the buffer if successful, otherwise nullptr. |
148 */ | 148 */ |
149 GrBuffer* createBuffer(size_t size, GrBufferType intendedType, GrAccessPatte
rn accessPattern, | 149 GrBuffer* createBuffer(size_t size, GrBufferType intendedType, GrAccessPatte
rn accessPattern, |
150 const void* data = nullptr); | 150 const void* data = nullptr); |
151 | 151 |
152 /** | 152 /** |
153 * Creates an instanced rendering object if it is supported on this platform
. | 153 * Creates an instanced rendering object if it is supported on this platform
. |
154 */ | 154 */ |
155 virtual gr_instanced::InstancedRendering* createInstancedRenderingIfSupporte
d() { | 155 gr_instanced::InstancedRendering* createInstancedRendering(); |
156 return nullptr; | |
157 } | |
158 | 156 |
159 /** | 157 /** |
160 * Resolves MSAA. | 158 * Resolves MSAA. |
161 */ | 159 */ |
162 void resolveRenderTarget(GrRenderTarget* target); | 160 void resolveRenderTarget(GrRenderTarget* target); |
163 | 161 |
164 /** Info struct returned by getReadPixelsInfo about performing intermediate
draws before | 162 /** Info struct returned by getReadPixelsInfo about performing intermediate
draws before |
165 reading pixels for performance or correctness. */ | 163 reading pixels for performance or correctness. */ |
166 struct ReadPixelTempDrawInfo { | 164 struct ReadPixelTempDrawInfo { |
167 /** If the GrGpu is requesting that the caller do a draw to an intermedi
ate surface then | 165 /** If the GrGpu is requesting that the caller do a draw to an intermedi
ate surface then |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
530 SkBudgeted budgeted, | 528 SkBudgeted budgeted, |
531 const SkTArray<GrMipLevel>& tex
els) = 0; | 529 const SkTArray<GrMipLevel>& tex
els) = 0; |
532 | 530 |
533 virtual GrTexture* onWrapBackendTexture(const GrBackendTextureDesc&, GrWrapO
wnership) = 0; | 531 virtual GrTexture* onWrapBackendTexture(const GrBackendTextureDesc&, GrWrapO
wnership) = 0; |
534 virtual GrRenderTarget* onWrapBackendRenderTarget(const GrBackendRenderTarge
tDesc&, | 532 virtual GrRenderTarget* onWrapBackendRenderTarget(const GrBackendRenderTarge
tDesc&, |
535 GrWrapOwnership) = 0; | 533 GrWrapOwnership) = 0; |
536 virtual GrRenderTarget* onWrapBackendTextureAsRenderTarget(const GrBackendTe
xtureDesc&) = 0; | 534 virtual GrRenderTarget* onWrapBackendTextureAsRenderTarget(const GrBackendTe
xtureDesc&) = 0; |
537 virtual GrBuffer* onCreateBuffer(size_t size, GrBufferType intendedType, GrA
ccessPattern, | 535 virtual GrBuffer* onCreateBuffer(size_t size, GrBufferType intendedType, GrA
ccessPattern, |
538 const void* data) = 0; | 536 const void* data) = 0; |
539 | 537 |
| 538 virtual gr_instanced::InstancedRendering* onCreateInstancedRendering() = 0; |
| 539 |
540 virtual bool onMakeCopyForTextureParams(GrTexture* texture, const GrTextureP
arams&, | 540 virtual bool onMakeCopyForTextureParams(GrTexture* texture, const GrTextureP
arams&, |
541 GrTextureProducer::CopyParams*) cons
t { return false; } | 541 GrTextureProducer::CopyParams*) cons
t { return false; } |
542 | 542 |
543 virtual bool onGetReadPixelsInfo(GrSurface* srcSurface, int readWidth, int r
eadHeight, | 543 virtual bool onGetReadPixelsInfo(GrSurface* srcSurface, int readWidth, int r
eadHeight, |
544 size_t rowBytes, GrPixelConfig readConfig,
DrawPreference*, | 544 size_t rowBytes, GrPixelConfig readConfig,
DrawPreference*, |
545 ReadPixelTempDrawInfo*) = 0; | 545 ReadPixelTempDrawInfo*) = 0; |
546 virtual bool onGetWritePixelsInfo(GrSurface* dstSurface, int width, int heig
ht, | 546 virtual bool onGetWritePixelsInfo(GrSurface* dstSurface, int width, int heig
ht, |
547 GrPixelConfig srcConfig, DrawPreference*, | 547 GrPixelConfig srcConfig, DrawPreference*, |
548 WritePixelTempDrawInfo*) = 0; | 548 WritePixelTempDrawInfo*) = 0; |
549 | 549 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
598 SkSTArray<1, MultisampleSpecs, true> fMultisampleSpecs; | 598 SkSTArray<1, MultisampleSpecs, true> fMultisampleSpecs; |
599 // The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu. | 599 // The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu. |
600 GrContext* fContext; | 600 GrContext* fContext; |
601 | 601 |
602 friend class GrPathRendering; | 602 friend class GrPathRendering; |
603 friend class gr_instanced::InstancedRendering; | 603 friend class gr_instanced::InstancedRendering; |
604 typedef SkRefCnt INHERITED; | 604 typedef SkRefCnt INHERITED; |
605 }; | 605 }; |
606 | 606 |
607 #endif | 607 #endif |
OLD | NEW |