| 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 GrGLGpu_DEFINED | 8 #ifndef GrGLGpu_DEFINED |
| 9 #define GrGLGpu_DEFINED | 9 #define GrGLGpu_DEFINED |
| 10 | 10 |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 void finishDrawTarget() override; | 135 void finishDrawTarget() override; |
| 136 | 136 |
| 137 private: | 137 private: |
| 138 GrGLGpu(GrGLContext* ctx, GrContext* context); | 138 GrGLGpu(GrGLContext* ctx, GrContext* context); |
| 139 | 139 |
| 140 // GrGpu overrides | 140 // GrGpu overrides |
| 141 void onResetContext(uint32_t resetBits) override; | 141 void onResetContext(uint32_t resetBits) override; |
| 142 | 142 |
| 143 void xferBarrier(GrRenderTarget*, GrXferBarrierType) override; | 143 void xferBarrier(GrRenderTarget*, GrXferBarrierType) override; |
| 144 | 144 |
| 145 GrTexture* onCreateTexture(const GrSurfaceDesc& desc, GrGpuResource::LifeCyc
le lifeCycle, | 145 GrTexture* onCreateTexture(const GrSurfaceDesc& desc, SkBudgeted budgeted, |
| 146 const SkTArray<GrMipLevel>& texels) override; | 146 const SkTArray<GrMipLevel>& texels) override; |
| 147 GrTexture* onCreateCompressedTexture(const GrSurfaceDesc& desc, | 147 GrTexture* onCreateCompressedTexture(const GrSurfaceDesc& desc, |
| 148 GrGpuResource::LifeCycle lifeCycle, | 148 SkBudgeted budgeted, |
| 149 const SkTArray<GrMipLevel>& texels) ove
rride; | 149 const SkTArray<GrMipLevel>& texels) ove
rride; |
| 150 | 150 |
| 151 GrVertexBuffer* onCreateVertexBuffer(size_t size, bool dynamic) override; | 151 GrVertexBuffer* onCreateVertexBuffer(size_t size, bool dynamic) override; |
| 152 GrIndexBuffer* onCreateIndexBuffer(size_t size, bool dynamic) override; | 152 GrIndexBuffer* onCreateIndexBuffer(size_t size, bool dynamic) override; |
| 153 GrTransferBuffer* onCreateTransferBuffer(size_t size, TransferType type) ove
rride; | 153 GrTransferBuffer* onCreateTransferBuffer(size_t size, TransferType type) ove
rride; |
| 154 GrTexture* onWrapBackendTexture(const GrBackendTextureDesc&, GrWrapOwnership
) override; | 154 GrTexture* onWrapBackendTexture(const GrBackendTextureDesc&, GrWrapOwnership
) override; |
| 155 GrRenderTarget* onWrapBackendRenderTarget(const GrBackendRenderTargetDesc&, | 155 GrRenderTarget* onWrapBackendRenderTarget(const GrBackendRenderTargetDesc&, |
| 156 GrWrapOwnership) override; | 156 GrWrapOwnership) override; |
| 157 GrRenderTarget* onWrapBackendTextureAsRenderTarget(const GrBackendTextureDes
c&, | 157 GrRenderTarget* onWrapBackendTextureAsRenderTarget(const GrBackendTextureDes
c&, |
| 158 GrWrapOwnership) override
; | 158 GrWrapOwnership) override
; |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 // whenever a new texture needs to be created. Otherwise, we assume that | 359 // whenever a new texture needs to be created. Otherwise, we assume that |
| 360 // the texture is already in GPU memory and that it's going to be updated | 360 // the texture is already in GPU memory and that it's going to be updated |
| 361 // with new data. | 361 // with new data. |
| 362 bool uploadCompressedTexData(const GrSurfaceDesc& desc, | 362 bool uploadCompressedTexData(const GrSurfaceDesc& desc, |
| 363 GrGLenum target, | 363 GrGLenum target, |
| 364 const SkTArray<GrMipLevel>& texels, | 364 const SkTArray<GrMipLevel>& texels, |
| 365 UploadType uploadType = kNewTexture_UploadType, | 365 UploadType uploadType = kNewTexture_UploadType, |
| 366 int left = 0, int top = 0, | 366 int left = 0, int top = 0, |
| 367 int width = -1, int height = -1); | 367 int width = -1, int height = -1); |
| 368 | 368 |
| 369 bool createRenderTargetObjects(const GrSurfaceDesc&, GrGpuResource::LifeCycl
e lifeCycle, | 369 bool createRenderTargetObjects(const GrSurfaceDesc&, const GrGLTextureInfo&, |
| 370 const GrGLTextureInfo& texInfo, GrGLRenderTar
get::IDDesc*); | 370 GrBackendObjectLifeCycle texLifeCycle, |
| 371 GrGLRenderTarget::IDDesc*); |
| 371 | 372 |
| 372 enum TempFBOTarget { | 373 enum TempFBOTarget { |
| 373 kSrc_TempFBOTarget, | 374 kSrc_TempFBOTarget, |
| 374 kDst_TempFBOTarget | 375 kDst_TempFBOTarget |
| 375 }; | 376 }; |
| 376 | 377 |
| 377 // Binds a surface as a FBO for a copy operation. If the surface already own
s an FBO ID then | 378 // Binds a surface as a FBO for a copy operation. If the surface already own
s an FBO ID then |
| 378 // that ID is bound. If not the surface is temporarily bound to a FBO and th
at FBO is bound. | 379 // that ID is bound. If not the surface is temporarily bound to a FBO and th
at FBO is bound. |
| 379 // This must be paired with a call to unbindSurfaceFBOForCopy(). | 380 // This must be paired with a call to unbindSurfaceFBOForCopy(). |
| 380 void bindSurfaceFBOForCopy(GrSurface* surface, GrGLenum fboTarget, GrGLIRect
* viewport, | 381 void bindSurfaceFBOForCopy(GrSurface* surface, GrGLenum fboTarget, GrGLIRect
* viewport, |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 617 } fPLSSetupProgram; | 618 } fPLSSetupProgram; |
| 618 | 619 |
| 619 bool fHWPLSEnabled; | 620 bool fHWPLSEnabled; |
| 620 bool fPLSHasBeenUsed; | 621 bool fPLSHasBeenUsed; |
| 621 | 622 |
| 622 typedef GrGpu INHERITED; | 623 typedef GrGpu INHERITED; |
| 623 friend class GrGLPathRendering; // For accessing setTextureUnit. | 624 friend class GrGLPathRendering; // For accessing setTextureUnit. |
| 624 }; | 625 }; |
| 625 | 626 |
| 626 #endif | 627 #endif |
| OLD | NEW |