| 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 SkASSERT(level0Data); | 117 SkASSERT(level0Data); |
| 118 GrMipLevel level = { level0Data, rowBytes }; | 118 GrMipLevel level = { level0Data, rowBytes }; |
| 119 SkSTArray<1, GrMipLevel> array; | 119 SkSTArray<1, GrMipLevel> array; |
| 120 array.push_back() = level; | 120 array.push_back() = level; |
| 121 return this->createTexture(desc, budgeted, array); | 121 return this->createTexture(desc, budgeted, array); |
| 122 } | 122 } |
| 123 | 123 |
| 124 /** | 124 /** |
| 125 * Implements GrTextureProvider::wrapBackendTexture | 125 * Implements GrTextureProvider::wrapBackendTexture |
| 126 */ | 126 */ |
| 127 GrTexture* wrapBackendTexture(const GrBackendTextureDesc&, GrWrapOwnership); | 127 sk_sp<GrTexture> wrapBackendTexture(const GrBackendTextureDesc&, GrWrapOwner
ship); |
| 128 | 128 |
| 129 /** | 129 /** |
| 130 * Implements GrTextureProvider::wrapBackendRenderTarget | 130 * Implements GrTextureProvider::wrapBackendRenderTarget |
| 131 */ | 131 */ |
| 132 GrRenderTarget* wrapBackendRenderTarget(const GrBackendRenderTargetDesc&, Gr
WrapOwnership); | 132 sk_sp<GrRenderTarget> wrapBackendRenderTarget(const GrBackendRenderTargetDes
c&,GrWrapOwnership); |
| 133 | 133 |
| 134 /** | 134 /** |
| 135 * Implements GrTextureProvider::wrapBackendTextureAsRenderTarget | 135 * Implements GrTextureProvider::wrapBackendTextureAsRenderTarget |
| 136 */ | 136 */ |
| 137 GrRenderTarget* wrapBackendTextureAsRenderTarget(const GrBackendTextureDesc&
); | 137 sk_sp<GrRenderTarget> wrapBackendTextureAsRenderTarget(const GrBackendTextur
eDesc&); |
| 138 | 138 |
| 139 /** | 139 /** |
| 140 * Creates a buffer in GPU memory. For a client-side buffer use GrBuffer::Cr
eateCPUBacked. | 140 * Creates a buffer in GPU memory. For a client-side buffer use GrBuffer::Cr
eateCPUBacked. |
| 141 * | 141 * |
| 142 * @param size size of buffer to create. | 142 * @param size size of buffer to create. |
| 143 * @param intendedType hint to the graphics subsystem about what the buff
er will be used for. | 143 * @param intendedType hint to the graphics subsystem about what the buff
er will be used for. |
| 144 * @param accessPattern hint to the graphics subsystem about how the data
will be accessed. | 144 * @param accessPattern hint to the graphics subsystem about how the data
will be accessed. |
| 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. |
| (...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 525 // overridden by backend-specific derived class to create objects. | 525 // overridden by backend-specific derived class to create objects. |
| 526 // Texture size and sample size will have already been validated in base cla
ss before | 526 // Texture size and sample size will have already been validated in base cla
ss before |
| 527 // onCreateTexture/CompressedTexture are called. | 527 // onCreateTexture/CompressedTexture are called. |
| 528 virtual GrTexture* onCreateTexture(const GrSurfaceDesc& desc, | 528 virtual GrTexture* onCreateTexture(const GrSurfaceDesc& desc, |
| 529 SkBudgeted budgeted, | 529 SkBudgeted budgeted, |
| 530 const SkTArray<GrMipLevel>& texels) = 0; | 530 const SkTArray<GrMipLevel>& texels) = 0; |
| 531 virtual GrTexture* onCreateCompressedTexture(const GrSurfaceDesc& desc, | 531 virtual GrTexture* onCreateCompressedTexture(const GrSurfaceDesc& desc, |
| 532 SkBudgeted budgeted, | 532 SkBudgeted budgeted, |
| 533 const SkTArray<GrMipLevel>& tex
els) = 0; | 533 const SkTArray<GrMipLevel>& tex
els) = 0; |
| 534 | 534 |
| 535 virtual GrTexture* onWrapBackendTexture(const GrBackendTextureDesc&, GrWrapO
wnership) = 0; | 535 virtual sk_sp<GrTexture> onWrapBackendTexture(const GrBackendTextureDesc&, G
rWrapOwnership) = 0; |
| 536 virtual GrRenderTarget* onWrapBackendRenderTarget(const GrBackendRenderTarge
tDesc&, | 536 virtual sk_sp<GrRenderTarget> onWrapBackendRenderTarget(const GrBackendRende
rTargetDesc&, |
| 537 GrWrapOwnership) = 0; | 537 GrWrapOwnership) = 0
; |
| 538 virtual GrRenderTarget* onWrapBackendTextureAsRenderTarget(const GrBackendTe
xtureDesc&) = 0; | 538 virtual sk_sp<GrRenderTarget> onWrapBackendTextureAsRenderTarget(const GrBac
kendTextureDesc&)=0; |
| 539 virtual GrBuffer* onCreateBuffer(size_t size, GrBufferType intendedType, GrA
ccessPattern, | 539 virtual GrBuffer* onCreateBuffer(size_t size, GrBufferType intendedType, GrA
ccessPattern, |
| 540 const void* data) = 0; | 540 const void* data) = 0; |
| 541 | 541 |
| 542 virtual gr_instanced::InstancedRendering* onCreateInstancedRendering() = 0; | 542 virtual gr_instanced::InstancedRendering* onCreateInstancedRendering() = 0; |
| 543 | 543 |
| 544 virtual bool onMakeCopyForTextureParams(GrTexture* texture, const GrTextureP
arams&, | 544 virtual bool onMakeCopyForTextureParams(GrTexture* texture, const GrTextureP
arams&, |
| 545 GrTextureProducer::CopyParams*) cons
t { return false; } | 545 GrTextureProducer::CopyParams*) cons
t { return false; } |
| 546 | 546 |
| 547 virtual bool onGetReadPixelsInfo(GrSurface* srcSurface, int readWidth, int r
eadHeight, | 547 virtual bool onGetReadPixelsInfo(GrSurface* srcSurface, int readWidth, int r
eadHeight, |
| 548 size_t rowBytes, GrPixelConfig readConfig,
DrawPreference*, | 548 size_t rowBytes, GrPixelConfig readConfig,
DrawPreference*, |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 602 SkSTArray<1, MultisampleSpecs, true> fMultisampleSpecs; | 602 SkSTArray<1, MultisampleSpecs, true> fMultisampleSpecs; |
| 603 // The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu. | 603 // The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu. |
| 604 GrContext* fContext; | 604 GrContext* fContext; |
| 605 | 605 |
| 606 friend class GrPathRendering; | 606 friend class GrPathRendering; |
| 607 friend class gr_instanced::InstancedRendering; | 607 friend class gr_instanced::InstancedRendering; |
| 608 typedef SkRefCnt INHERITED; | 608 typedef SkRefCnt INHERITED; |
| 609 }; | 609 }; |
| 610 | 610 |
| 611 #endif | 611 #endif |
| OLD | NEW |