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 13 matching lines...) Expand all Loading... | |
24 class GrPathRange; | 24 class GrPathRange; |
25 class GrPathRenderer; | 25 class GrPathRenderer; |
26 class GrPathRendererChain; | 26 class GrPathRendererChain; |
27 class GrPathRendering; | 27 class GrPathRendering; |
28 class GrPipeline; | 28 class GrPipeline; |
29 class GrPrimitiveProcessor; | 29 class GrPrimitiveProcessor; |
30 class GrRenderTarget; | 30 class GrRenderTarget; |
31 class GrStencilAttachment; | 31 class GrStencilAttachment; |
32 class GrSurface; | 32 class GrSurface; |
33 class GrTexture; | 33 class GrTexture; |
34 class GrTransferBuffer; | |
34 class GrVertexBuffer; | 35 class GrVertexBuffer; |
35 class GrVertices; | 36 class GrVertices; |
36 | 37 |
37 class GrGpu : public SkRefCnt { | 38 class GrGpu : public SkRefCnt { |
38 public: | 39 public: |
39 /** | 40 /** |
40 * Create an instance of GrGpu that matches the specified backend. If the re quested backend is | 41 * Create an instance of GrGpu that matches the specified backend. If the re quested backend is |
41 * not supported (at compile-time or run-time) this returns nullptr. The con text will not be | 42 * not supported (at compile-time or run-time) this returns nullptr. The con text will not be |
42 * fully constructed and should not be used by GrGpu until after this functi on returns. | 43 * fully constructed and should not be used by GrGpu until after this functi on returns. |
43 */ | 44 */ |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
122 * @param size size in bytes of the index buffer | 123 * @param size size in bytes of the index buffer |
123 * @param dynamic hints whether the data will be frequently changed | 124 * @param dynamic hints whether the data will be frequently changed |
124 * by either GrIndexBuffer::map() or | 125 * by either GrIndexBuffer::map() or |
125 * GrIndexBuffer::updateData(). | 126 * GrIndexBuffer::updateData(). |
126 * | 127 * |
127 * @return The index buffer if successful, otherwise nullptr. | 128 * @return The index buffer if successful, otherwise nullptr. |
128 */ | 129 */ |
129 GrIndexBuffer* createIndexBuffer(size_t size, bool dynamic); | 130 GrIndexBuffer* createIndexBuffer(size_t size, bool dynamic); |
130 | 131 |
131 /** | 132 /** |
133 * Creates a transfer buffer. | |
134 * | |
135 * @param size size in bytes of the index buffer | |
136 * @param toGpu true if used to transfer from the cpu to the gpu | |
bsalomon
2015/12/02 16:38:31
Maybe an enum instead of a bool for clarity at the
jvanverth1
2015/12/02 18:05:07
Done.
| |
137 * otherwise to be used to transfer from the gpu to the cpu | |
138 * | |
139 * @return The transfer buffer if successful, otherwise nullptr. | |
140 */ | |
141 GrTransferBuffer* createTransferBuffer(size_t size, bool toGpu); | |
142 | |
143 /** | |
132 * Resolves MSAA. | 144 * Resolves MSAA. |
133 */ | 145 */ |
134 void resolveRenderTarget(GrRenderTarget* target); | 146 void resolveRenderTarget(GrRenderTarget* target); |
135 | 147 |
136 /** Info struct returned by getReadPixelsInfo about performing intermediate draws before | 148 /** Info struct returned by getReadPixelsInfo about performing intermediate draws before |
137 reading pixels for performance or correctness. */ | 149 reading pixels for performance or correctness. */ |
138 struct ReadPixelTempDrawInfo { | 150 struct ReadPixelTempDrawInfo { |
139 /** If the GrGpu is requesting that the caller do a draw to an intermedi ate surface then | 151 /** If the GrGpu is requesting that the caller do a draw to an intermedi ate surface then |
140 this is descriptor for the temp surface. The draw should always be a rect with | 152 this is descriptor for the temp surface. The draw should always be a rect with |
141 dst 0,0,w,h. */ | 153 dst 0,0,w,h. */ |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
443 GrGpuResource::LifeCycle lifeCycle, | 455 GrGpuResource::LifeCycle lifeCycle, |
444 const void* srcData, size_t rowBytes) = 0 ; | 456 const void* srcData, size_t rowBytes) = 0 ; |
445 virtual GrTexture* onCreateCompressedTexture(const GrSurfaceDesc& desc, | 457 virtual GrTexture* onCreateCompressedTexture(const GrSurfaceDesc& desc, |
446 GrGpuResource::LifeCycle lifeCy cle, | 458 GrGpuResource::LifeCycle lifeCy cle, |
447 const void* srcData) = 0; | 459 const void* srcData) = 0; |
448 virtual GrTexture* onWrapBackendTexture(const GrBackendTextureDesc&, GrWrapO wnership) = 0; | 460 virtual GrTexture* onWrapBackendTexture(const GrBackendTextureDesc&, GrWrapO wnership) = 0; |
449 virtual GrRenderTarget* onWrapBackendRenderTarget(const GrBackendRenderTarge tDesc&, | 461 virtual GrRenderTarget* onWrapBackendRenderTarget(const GrBackendRenderTarge tDesc&, |
450 GrWrapOwnership) = 0; | 462 GrWrapOwnership) = 0; |
451 virtual GrVertexBuffer* onCreateVertexBuffer(size_t size, bool dynamic) = 0; | 463 virtual GrVertexBuffer* onCreateVertexBuffer(size_t size, bool dynamic) = 0; |
452 virtual GrIndexBuffer* onCreateIndexBuffer(size_t size, bool dynamic) = 0; | 464 virtual GrIndexBuffer* onCreateIndexBuffer(size_t size, bool dynamic) = 0; |
465 virtual GrTransferBuffer* onCreateTransferBuffer(size_t size, bool toGpu) = 0; | |
453 | 466 |
454 // overridden by backend-specific derived class to perform the clear. | 467 // overridden by backend-specific derived class to perform the clear. |
455 virtual void onClear(GrRenderTarget*, const SkIRect& rect, GrColor color) = 0; | 468 virtual void onClear(GrRenderTarget*, const SkIRect& rect, GrColor color) = 0; |
456 | 469 |
457 | 470 |
458 // Overridden by backend specific classes to perform a clear of the stencil clip bits. This is | 471 // Overridden by backend specific classes to perform a clear of the stencil clip bits. This is |
459 // ONLY used by the the clip target | 472 // ONLY used by the the clip target |
460 virtual void onClearStencilClip(GrRenderTarget*, const SkIRect& rect, bool i nsideClip) = 0; | 473 virtual void onClearStencilClip(GrRenderTarget*, const SkIRect& rect, bool i nsideClip) = 0; |
461 | 474 |
462 // overridden by backend-specific derived class to perform the draw call. | 475 // overridden by backend-specific derived class to perform the draw call. |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
501 ResetTimestamp fResetTi mestamp; | 514 ResetTimestamp fResetTi mestamp; |
502 uint32_t fResetBi ts; | 515 uint32_t fResetBi ts; |
503 // The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu. | 516 // The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu. |
504 GrContext* fContext ; | 517 GrContext* fContext ; |
505 | 518 |
506 friend class GrPathRendering; | 519 friend class GrPathRendering; |
507 typedef SkRefCnt INHERITED; | 520 typedef SkRefCnt INHERITED; |
508 }; | 521 }; |
509 | 522 |
510 #endif | 523 #endif |
OLD | NEW |