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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 * @param rowBytes the number of bytes between consecutive rows. Zero | 90 * @param rowBytes the number of bytes between consecutive rows. Zero |
91 * means rows are tightly packed. This field is ignored | 91 * means rows are tightly packed. This field is ignored |
92 * for compressed formats. | 92 * for compressed formats. |
93 * | 93 * |
94 * @return The texture object if successful, otherwise nullptr. | 94 * @return The texture object if successful, otherwise nullptr. |
95 */ | 95 */ |
96 GrTexture* createTexture(const GrSurfaceDesc& desc, bool budgeted, | 96 GrTexture* createTexture(const GrSurfaceDesc& desc, bool budgeted, |
97 const void* srcData, size_t rowBytes); | 97 const void* srcData, size_t rowBytes); |
98 | 98 |
99 /** | 99 /** |
100 * Implements GrContext::wrapBackendTexture | 100 * Implements GrTextureProvider::wrapBackendTexture |
101 */ | 101 */ |
102 GrTexture* wrapBackendTexture(const GrBackendTextureDesc&, GrWrapOwnership); | 102 GrTexture* wrapBackendTexture(const GrBackendTextureDesc&, GrWrapOwnership); |
103 | 103 |
104 /** | 104 /** |
105 * Implements GrContext::wrapBackendTexture | 105 * Implements GrTextureProvider::wrapBackendTexture |
106 */ | 106 */ |
107 GrRenderTarget* wrapBackendRenderTarget(const GrBackendRenderTargetDesc&, Gr
WrapOwnership); | 107 GrRenderTarget* wrapBackendRenderTarget(const GrBackendRenderTargetDesc&, Gr
WrapOwnership); |
108 | 108 |
109 /** | 109 /** |
| 110 * Implements GrTextureProvider::wrapBackendTextureAsRenderTarget |
| 111 */ |
| 112 GrRenderTarget* wrapBackendTextureAsRenderTarget(const GrBackendTextureDesc&
, GrWrapOwnership); |
| 113 |
| 114 /** |
110 * Creates a vertex buffer. | 115 * Creates a vertex buffer. |
111 * | 116 * |
112 * @param size size in bytes of the vertex buffer | 117 * @param size size in bytes of the vertex buffer |
113 * @param dynamic hints whether the data will be frequently changed | 118 * @param dynamic hints whether the data will be frequently changed |
114 * by either GrVertexBuffer::map() or | 119 * by either GrVertexBuffer::map() or |
115 * GrVertexBuffer::updateData(). | 120 * GrVertexBuffer::updateData(). |
116 * | 121 * |
117 * @return The vertex buffer if successful, otherwise nullptr. | 122 * @return The vertex buffer if successful, otherwise nullptr. |
118 */ | 123 */ |
119 GrVertexBuffer* createVertexBuffer(size_t size, bool dynamic); | 124 GrVertexBuffer* createVertexBuffer(size_t size, bool dynamic); |
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 // onCreateTexture/CompressedTexture are called. | 510 // onCreateTexture/CompressedTexture are called. |
506 virtual GrTexture* onCreateTexture(const GrSurfaceDesc& desc, | 511 virtual GrTexture* onCreateTexture(const GrSurfaceDesc& desc, |
507 GrGpuResource::LifeCycle lifeCycle, | 512 GrGpuResource::LifeCycle lifeCycle, |
508 const void* srcData, size_t rowBytes) = 0
; | 513 const void* srcData, size_t rowBytes) = 0
; |
509 virtual GrTexture* onCreateCompressedTexture(const GrSurfaceDesc& desc, | 514 virtual GrTexture* onCreateCompressedTexture(const GrSurfaceDesc& desc, |
510 GrGpuResource::LifeCycle lifeCy
cle, | 515 GrGpuResource::LifeCycle lifeCy
cle, |
511 const void* srcData) = 0; | 516 const void* srcData) = 0; |
512 virtual GrTexture* onWrapBackendTexture(const GrBackendTextureDesc&, GrWrapO
wnership) = 0; | 517 virtual GrTexture* onWrapBackendTexture(const GrBackendTextureDesc&, GrWrapO
wnership) = 0; |
513 virtual GrRenderTarget* onWrapBackendRenderTarget(const GrBackendRenderTarge
tDesc&, | 518 virtual GrRenderTarget* onWrapBackendRenderTarget(const GrBackendRenderTarge
tDesc&, |
514 GrWrapOwnership) = 0; | 519 GrWrapOwnership) = 0; |
| 520 virtual GrRenderTarget* onWrapBackendTextureAsRenderTarget(const GrBackendTe
xtureDesc&, |
| 521 GrWrapOwnership)
= 0; |
515 virtual GrVertexBuffer* onCreateVertexBuffer(size_t size, bool dynamic) = 0; | 522 virtual GrVertexBuffer* onCreateVertexBuffer(size_t size, bool dynamic) = 0; |
516 virtual GrIndexBuffer* onCreateIndexBuffer(size_t size, bool dynamic) = 0; | 523 virtual GrIndexBuffer* onCreateIndexBuffer(size_t size, bool dynamic) = 0; |
517 virtual GrTransferBuffer* onCreateTransferBuffer(size_t size, TransferType t
ype) = 0; | 524 virtual GrTransferBuffer* onCreateTransferBuffer(size_t size, TransferType t
ype) = 0; |
518 | 525 |
519 // overridden by backend-specific derived class to perform the clear. | 526 // overridden by backend-specific derived class to perform the clear. |
520 virtual void onClear(GrRenderTarget*, const SkIRect& rect, GrColor color) =
0; | 527 virtual void onClear(GrRenderTarget*, const SkIRect& rect, GrColor color) =
0; |
521 | 528 |
522 | 529 |
523 // Overridden by backend specific classes to perform a clear of the stencil
clip bits. This is | 530 // Overridden by backend specific classes to perform a clear of the stencil
clip bits. This is |
524 // ONLY used by the the clip target | 531 // ONLY used by the the clip target |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
575 ResetTimestamp fResetTi
mestamp; | 582 ResetTimestamp fResetTi
mestamp; |
576 uint32_t fResetBi
ts; | 583 uint32_t fResetBi
ts; |
577 // The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu. | 584 // The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu. |
578 GrContext* fContext
; | 585 GrContext* fContext
; |
579 | 586 |
580 friend class GrPathRendering; | 587 friend class GrPathRendering; |
581 typedef SkRefCnt INHERITED; | 588 typedef SkRefCnt INHERITED; |
582 }; | 589 }; |
583 | 590 |
584 #endif | 591 #endif |
OLD | NEW |