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 * for compressed formats. | 90 * for compressed formats. |
91 * | 91 * |
92 * @return The texture object if successful, otherwise NULL. | 92 * @return The texture object if successful, otherwise NULL. |
93 */ | 93 */ |
94 GrTexture* createTexture(const GrSurfaceDesc& desc, bool budgeted, | 94 GrTexture* createTexture(const GrSurfaceDesc& desc, bool budgeted, |
95 const void* srcData, size_t rowBytes); | 95 const void* srcData, size_t rowBytes); |
96 | 96 |
97 /** | 97 /** |
98 * Implements GrContext::wrapBackendTexture | 98 * Implements GrContext::wrapBackendTexture |
99 */ | 99 */ |
100 GrTexture* wrapBackendTexture(const GrBackendTextureDesc&); | 100 GrTexture* wrapBackendTexture(const GrBackendTextureDesc&, GrWrapOwnership); |
101 | 101 |
102 /** | 102 /** |
103 * Implements GrContext::wrapBackendTexture | 103 * Implements GrContext::wrapBackendTexture |
104 */ | 104 */ |
105 GrRenderTarget* wrapBackendRenderTarget(const GrBackendRenderTargetDesc&); | 105 GrRenderTarget* wrapBackendRenderTarget(const GrBackendRenderTargetDesc&, Gr
WrapOwnership); |
106 | 106 |
107 /** | 107 /** |
108 * Creates a vertex buffer. | 108 * Creates a vertex buffer. |
109 * | 109 * |
110 * @param size size in bytes of the vertex buffer | 110 * @param size size in bytes of the vertex buffer |
111 * @param dynamic hints whether the data will be frequently changed | 111 * @param dynamic hints whether the data will be frequently changed |
112 * by either GrVertexBuffer::map() or | 112 * by either GrVertexBuffer::map() or |
113 * GrVertexBuffer::updateData(). | 113 * GrVertexBuffer::updateData(). |
114 * | 114 * |
115 * @return The vertex buffer if successful, otherwise NULL. | 115 * @return The vertex buffer if successful, otherwise NULL. |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 | 394 |
395 // overridden by backend-specific derived class to create objects. | 395 // overridden by backend-specific derived class to create objects. |
396 // Texture size and sample size will have already been validated in base cla
ss before | 396 // Texture size and sample size will have already been validated in base cla
ss before |
397 // onCreateTexture/CompressedTexture are called. | 397 // onCreateTexture/CompressedTexture are called. |
398 virtual GrTexture* onCreateTexture(const GrSurfaceDesc& desc, | 398 virtual GrTexture* onCreateTexture(const GrSurfaceDesc& desc, |
399 GrGpuResource::LifeCycle lifeCycle, | 399 GrGpuResource::LifeCycle lifeCycle, |
400 const void* srcData, size_t rowBytes) = 0
; | 400 const void* srcData, size_t rowBytes) = 0
; |
401 virtual GrTexture* onCreateCompressedTexture(const GrSurfaceDesc& desc, | 401 virtual GrTexture* onCreateCompressedTexture(const GrSurfaceDesc& desc, |
402 GrGpuResource::LifeCycle lifeCy
cle, | 402 GrGpuResource::LifeCycle lifeCy
cle, |
403 const void* srcData) = 0; | 403 const void* srcData) = 0; |
404 virtual GrTexture* onWrapBackendTexture(const GrBackendTextureDesc&) = 0; | 404 virtual GrTexture* onWrapBackendTexture(const GrBackendTextureDesc&, GrWrapO
wnership) = 0; |
405 virtual GrRenderTarget* onWrapBackendRenderTarget(const GrBackendRenderTarge
tDesc&) = 0; | 405 virtual GrRenderTarget* onWrapBackendRenderTarget(const GrBackendRenderTarge
tDesc&, |
| 406 GrWrapOwnership) = 0; |
406 virtual GrVertexBuffer* onCreateVertexBuffer(size_t size, bool dynamic) = 0; | 407 virtual GrVertexBuffer* onCreateVertexBuffer(size_t size, bool dynamic) = 0; |
407 virtual GrIndexBuffer* onCreateIndexBuffer(size_t size, bool dynamic) = 0; | 408 virtual GrIndexBuffer* onCreateIndexBuffer(size_t size, bool dynamic) = 0; |
408 | 409 |
409 // overridden by backend-specific derived class to perform the clear. | 410 // overridden by backend-specific derived class to perform the clear. |
410 virtual void onClear(GrRenderTarget*, const SkIRect* rect, GrColor color, | 411 virtual void onClear(GrRenderTarget*, const SkIRect* rect, GrColor color, |
411 bool canIgnoreRect) = 0; | 412 bool canIgnoreRect) = 0; |
412 | 413 |
413 | 414 |
414 // Overridden by backend specific classes to perform a clear of the stencil
clip bits. This is | 415 // Overridden by backend specific classes to perform a clear of the stencil
clip bits. This is |
415 // ONLY used by the the clip target | 416 // ONLY used by the the clip target |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 GrTraceMarkerSet fActiveT
raceMarkers; | 467 GrTraceMarkerSet fActiveT
raceMarkers; |
467 GrTraceMarkerSet fStoredT
raceMarkers; | 468 GrTraceMarkerSet fStoredT
raceMarkers; |
468 // The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu. | 469 // The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu. |
469 GrContext* fContext
; | 470 GrContext* fContext
; |
470 | 471 |
471 friend class GrPathRendering; | 472 friend class GrPathRendering; |
472 typedef SkRefCnt INHERITED; | 473 typedef SkRefCnt INHERITED; |
473 }; | 474 }; |
474 | 475 |
475 #endif | 476 #endif |
OLD | NEW |