| 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 GrGLGpu(GrGLContext* ctx, GrContext* context); | 121 GrGLGpu(GrGLContext* ctx, GrContext* context); |
| 122 | 122 |
| 123 // GrGpu overrides | 123 // GrGpu overrides |
| 124 void onResetContext(uint32_t resetBits) override; | 124 void onResetContext(uint32_t resetBits) override; |
| 125 | 125 |
| 126 GrTexture* onCreateTexture(const GrSurfaceDesc& desc, GrGpuResource::LifeCyc
le lifeCycle, | 126 GrTexture* onCreateTexture(const GrSurfaceDesc& desc, GrGpuResource::LifeCyc
le lifeCycle, |
| 127 const void* srcData, size_t rowBytes) override; | 127 const void* srcData, size_t rowBytes) override; |
| 128 GrTexture* onCreateCompressedTexture(const GrSurfaceDesc& desc, | 128 GrTexture* onCreateCompressedTexture(const GrSurfaceDesc& desc, |
| 129 GrGpuResource::LifeCycle lifeCycle, | 129 GrGpuResource::LifeCycle lifeCycle, |
| 130 const void* srcData) override; | 130 const void* srcData) override; |
| 131 GrTexture* onCreateMipmappedTexture(const GrSurfaceDesc& desc, |
| 132 GrGpuResource::LifeCycle lifeCycle, |
| 133 const SkMipMap& srcData) override; |
| 134 GrTexture* onCreateCompressedMipmappedTexture(const GrSurfaceDesc& desc, |
| 135 GrGpuResource::LifeCycle lifeC
ycle, |
| 136 const SkMipMap& srcData) overr
ide; |
| 137 |
| 131 GrVertexBuffer* onCreateVertexBuffer(size_t size, bool dynamic) override; | 138 GrVertexBuffer* onCreateVertexBuffer(size_t size, bool dynamic) override; |
| 132 GrIndexBuffer* onCreateIndexBuffer(size_t size, bool dynamic) override; | 139 GrIndexBuffer* onCreateIndexBuffer(size_t size, bool dynamic) override; |
| 133 GrTexture* onWrapBackendTexture(const GrBackendTextureDesc&, GrWrapOwnership
) override; | 140 GrTexture* onWrapBackendTexture(const GrBackendTextureDesc&, GrWrapOwnership
) override; |
| 134 GrRenderTarget* onWrapBackendRenderTarget(const GrBackendRenderTargetDesc&, | 141 GrRenderTarget* onWrapBackendRenderTarget(const GrBackendRenderTargetDesc&, |
| 135 GrWrapOwnership) override; | 142 GrWrapOwnership) override; |
| 136 bool createStencilAttachmentForRenderTarget(GrRenderTarget* rt, int width, i
nt height) override; | 143 bool createStencilAttachmentForRenderTarget(GrRenderTarget* rt, int width, i
nt height) override; |
| 137 bool attachStencilAttachmentToRenderTarget(GrStencilAttachment* sb, | 144 bool attachStencilAttachmentToRenderTarget(GrStencilAttachment* sb, |
| 138 GrRenderTarget* rt) override; | 145 GrRenderTarget* rt) override; |
| 139 | 146 |
| 140 void onClear(GrRenderTarget*, const SkIRect* rect, GrColor color, | 147 void onClear(GrRenderTarget*, const SkIRect* rect, GrColor color, |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 // for the size of the data. The isNewTexture flag should be set to true | 291 // for the size of the data. The isNewTexture flag should be set to true |
| 285 // whenever a new texture needs to be created. Otherwise, we assume that | 292 // whenever a new texture needs to be created. Otherwise, we assume that |
| 286 // the texture is already in GPU memory and that it's going to be updated | 293 // the texture is already in GPU memory and that it's going to be updated |
| 287 // with new data. | 294 // with new data. |
| 288 bool uploadCompressedTexData(const GrSurfaceDesc& desc, | 295 bool uploadCompressedTexData(const GrSurfaceDesc& desc, |
| 289 const void* data, | 296 const void* data, |
| 290 bool isNewTexture = true, | 297 bool isNewTexture = true, |
| 291 int left = 0, int top = 0, | 298 int left = 0, int top = 0, |
| 292 int width = -1, int height = -1); | 299 int width = -1, int height = -1); |
| 293 | 300 |
| 301 // helper for onCreateMipmappedTexture |
| 302 bool uploadMipmappedTexData(const GrSurfaceDesc& desc, |
| 303 const SkMipMap& data); |
| 304 |
| 305 // helper for onCreateCompressedMipmappedTexture |
| 306 bool uploadCompressedMipmappedTexData(const GrSurfaceDesc& desc, |
| 307 const SkMipMap& data); |
| 308 |
| 294 bool createRenderTargetObjects(const GrSurfaceDesc&, GrGpuResource::LifeCycl
e lifeCycle, | 309 bool createRenderTargetObjects(const GrSurfaceDesc&, GrGpuResource::LifeCycl
e lifeCycle, |
| 295 GrGLuint texID, GrGLRenderTarget::IDDesc*); | 310 GrGLuint texID, GrGLRenderTarget::IDDesc*); |
| 296 | 311 |
| 297 enum TempFBOTarget { | 312 enum TempFBOTarget { |
| 298 kSrc_TempFBOTarget, | 313 kSrc_TempFBOTarget, |
| 299 kDst_TempFBOTarget | 314 kDst_TempFBOTarget |
| 300 }; | 315 }; |
| 301 | 316 |
| 302 GrGLuint bindSurfaceAsFBO(GrSurface* surface, GrGLenum fboTarget, GrGLIRect*
viewport, | 317 GrGLuint bindSurfaceAsFBO(GrSurface* surface, GrGLenum fboTarget, GrGLIRect*
viewport, |
| 303 TempFBOTarget tempFBOTarget); | 318 TempFBOTarget tempFBOTarget); |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 500 | 515 |
| 501 // we record what stencil format worked last time to hopefully exit early | 516 // we record what stencil format worked last time to hopefully exit early |
| 502 // from our loop that tries stencil formats and calls check fb status. | 517 // from our loop that tries stencil formats and calls check fb status. |
| 503 int fLastSuccessfulStencilFmtIdx; | 518 int fLastSuccessfulStencilFmtIdx; |
| 504 | 519 |
| 505 typedef GrGpu INHERITED; | 520 typedef GrGpu INHERITED; |
| 506 friend class GrGLPathRendering; // For accessing setTextureUnit. | 521 friend class GrGLPathRendering; // For accessing setTextureUnit. |
| 507 }; | 522 }; |
| 508 | 523 |
| 509 #endif | 524 #endif |
| OLD | NEW |