| 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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 GrRenderTarget* wrapBackendRenderTarget(const GrBackendRenderTargetDesc&, Gr
WrapOwnership); | 128 GrRenderTarget* wrapBackendRenderTarget(const GrBackendRenderTargetDesc&, Gr
WrapOwnership); |
| 129 | 129 |
| 130 /** | 130 /** |
| 131 * Implements GrTextureProvider::wrapBackendTextureAsRenderTarget | 131 * Implements GrTextureProvider::wrapBackendTextureAsRenderTarget |
| 132 */ | 132 */ |
| 133 GrRenderTarget* wrapBackendTextureAsRenderTarget(const GrBackendTextureDesc&
); | 133 GrRenderTarget* wrapBackendTextureAsRenderTarget(const GrBackendTextureDesc&
); |
| 134 | 134 |
| 135 /** | 135 /** |
| 136 * Creates a buffer. | 136 * Creates a buffer. |
| 137 * | 137 * |
| 138 * @param size size of buffer to create. |
| 139 * @param intendedType hint to the graphics subsystem about what the buff
er will be used for. |
| 140 * @param accessPattern hint to the graphics subsystem about how the data
will be accessed. |
| 141 * |
| 138 * @return the buffer if successful, otherwise nullptr. | 142 * @return the buffer if successful, otherwise nullptr. |
| 139 */ | 143 */ |
| 140 GrBuffer* createBuffer(GrBufferType, size_t size, GrAccessPattern); | 144 GrBuffer* createBuffer(size_t size, GrBufferType intendedType, GrAccessPatte
rn accessPattern); |
| 141 | 145 |
| 142 /** | 146 /** |
| 143 * Resolves MSAA. | 147 * Resolves MSAA. |
| 144 */ | 148 */ |
| 145 void resolveRenderTarget(GrRenderTarget* target); | 149 void resolveRenderTarget(GrRenderTarget* target); |
| 146 | 150 |
| 147 /** Info struct returned by getReadPixelsInfo about performing intermediate
draws before | 151 /** Info struct returned by getReadPixelsInfo about performing intermediate
draws before |
| 148 reading pixels for performance or correctness. */ | 152 reading pixels for performance or correctness. */ |
| 149 struct ReadPixelTempDrawInfo { | 153 struct ReadPixelTempDrawInfo { |
| 150 /** If the GrGpu is requesting that the caller do a draw to an intermedi
ate surface then | 154 /** If the GrGpu is requesting that the caller do a draw to an intermedi
ate surface then |
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 526 GrGpuResource::LifeCycle lifeCycle, | 530 GrGpuResource::LifeCycle lifeCycle, |
| 527 const SkTArray<GrMipLevel>& texels) = 0; | 531 const SkTArray<GrMipLevel>& texels) = 0; |
| 528 virtual GrTexture* onCreateCompressedTexture(const GrSurfaceDesc& desc, | 532 virtual GrTexture* onCreateCompressedTexture(const GrSurfaceDesc& desc, |
| 529 GrGpuResource::LifeCycle lifeCy
cle, | 533 GrGpuResource::LifeCycle lifeCy
cle, |
| 530 const SkTArray<GrMipLevel>& tex
els) = 0; | 534 const SkTArray<GrMipLevel>& tex
els) = 0; |
| 531 | 535 |
| 532 virtual GrTexture* onWrapBackendTexture(const GrBackendTextureDesc&, GrWrapO
wnership) = 0; | 536 virtual GrTexture* onWrapBackendTexture(const GrBackendTextureDesc&, GrWrapO
wnership) = 0; |
| 533 virtual GrRenderTarget* onWrapBackendRenderTarget(const GrBackendRenderTarge
tDesc&, | 537 virtual GrRenderTarget* onWrapBackendRenderTarget(const GrBackendRenderTarge
tDesc&, |
| 534 GrWrapOwnership) = 0; | 538 GrWrapOwnership) = 0; |
| 535 virtual GrRenderTarget* onWrapBackendTextureAsRenderTarget(const GrBackendTe
xtureDesc&) = 0; | 539 virtual GrRenderTarget* onWrapBackendTextureAsRenderTarget(const GrBackendTe
xtureDesc&) = 0; |
| 536 virtual GrBuffer* onCreateBuffer(GrBufferType, size_t size, GrAccessPattern)
= 0; | 540 virtual GrBuffer* onCreateBuffer(size_t size, GrBufferType intendedType, GrA
ccessPattern) = 0; |
| 537 | 541 |
| 538 // overridden by backend-specific derived class to perform the clear. | 542 // overridden by backend-specific derived class to perform the clear. |
| 539 virtual void onClear(GrRenderTarget*, const SkIRect& rect, GrColor color) =
0; | 543 virtual void onClear(GrRenderTarget*, const SkIRect& rect, GrColor color) =
0; |
| 540 | 544 |
| 541 // Overridden by backend specific classes to perform a clear of the stencil
clip bits. This is | 545 // Overridden by backend specific classes to perform a clear of the stencil
clip bits. This is |
| 542 // ONLY used by the the clip target | 546 // ONLY used by the the clip target |
| 543 virtual void onClearStencilClip(GrRenderTarget*, const SkIRect& rect, bool i
nsideClip) = 0; | 547 virtual void onClearStencilClip(GrRenderTarget*, const SkIRect& rect, bool i
nsideClip) = 0; |
| 544 | 548 |
| 545 // overridden by backend-specific derived class to perform the draw call. | 549 // overridden by backend-specific derived class to perform the draw call. |
| 546 virtual void onDraw(const GrPipeline&, | 550 virtual void onDraw(const GrPipeline&, |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 604 SkTArray<const MultisampleSpecs*, true> fMultisa
mpleSpecsMap; | 608 SkTArray<const MultisampleSpecs*, true> fMultisa
mpleSpecsMap; |
| 605 GrTAllocator<MultisampleSpecs> fMultisa
mpleSpecsAllocator; | 609 GrTAllocator<MultisampleSpecs> fMultisa
mpleSpecsAllocator; |
| 606 // The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu. | 610 // The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu. |
| 607 GrContext* fContext
; | 611 GrContext* fContext
; |
| 608 | 612 |
| 609 friend class GrPathRendering; | 613 friend class GrPathRendering; |
| 610 typedef SkRefCnt INHERITED; | 614 typedef SkRefCnt INHERITED; |
| 611 }; | 615 }; |
| 612 | 616 |
| 613 #endif | 617 #endif |
| OLD | NEW |