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