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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 GrVertexBuffer* onCreateVertexBuffer(size_t size, bool dynamic) override; | 150 GrVertexBuffer* onCreateVertexBuffer(size_t size, bool dynamic) override; |
151 GrIndexBuffer* onCreateIndexBuffer(size_t size, bool dynamic) override; | 151 GrIndexBuffer* onCreateIndexBuffer(size_t size, bool dynamic) override; |
152 GrTransferBuffer* onCreateTransferBuffer(size_t size, TransferType type) ove
rride; | 152 GrTransferBuffer* onCreateTransferBuffer(size_t size, TransferType type) ove
rride; |
153 GrTexture* onWrapBackendTexture(const GrBackendTextureDesc&, GrWrapOwnership
) override; | 153 GrTexture* onWrapBackendTexture(const GrBackendTextureDesc&, GrWrapOwnership
) override; |
154 GrRenderTarget* onWrapBackendRenderTarget(const GrBackendRenderTargetDesc&, | 154 GrRenderTarget* onWrapBackendRenderTarget(const GrBackendRenderTargetDesc&, |
155 GrWrapOwnership) override; | 155 GrWrapOwnership) override; |
156 // Given a GrPixelConfig return the index into the stencil format array on G
rGLCaps to a | 156 // Given a GrPixelConfig return the index into the stencil format array on G
rGLCaps to a |
157 // compatible stencil format, or negative if there is no compatible stencil
format. | 157 // compatible stencil format, or negative if there is no compatible stencil
format. |
158 int getCompatibleStencilIndex(GrPixelConfig config); | 158 int getCompatibleStencilIndex(GrPixelConfig config); |
159 | 159 |
| 160 // If |desc.fTextureStorageAllocator| exists, use that to create the |
| 161 // texture. Otherwise, create the texture directly. |
| 162 // Returns whether the texture is successfully created. On success, the |
| 163 // result is stored in |info|. |
| 164 // The texture is populated with |srcData|, if it exists. |
| 165 // The texture parameters are cached in |initialTexParams|. |
| 166 bool createTextureImpl(const GrSurfaceDesc& desc, GrGLTextureInfo* info, |
| 167 bool renderTarget, const void* srcData, |
| 168 GrGLTexture::TexParams* initialTexParams, size_t rowB
ytes); |
| 169 |
160 void onClear(GrRenderTarget*, const SkIRect& rect, GrColor color) override; | 170 void onClear(GrRenderTarget*, const SkIRect& rect, GrColor color) override; |
161 | 171 |
162 void onClearStencilClip(GrRenderTarget*, const SkIRect& rect, bool insideCli
p) override; | 172 void onClearStencilClip(GrRenderTarget*, const SkIRect& rect, bool insideCli
p) override; |
163 | 173 |
164 bool onMakeCopyForTextureParams(GrTexture*, const GrTextureParams&, | 174 bool onMakeCopyForTextureParams(GrTexture*, const GrTextureParams&, |
165 GrTextureProducer::CopyParams*) const overri
de; | 175 GrTextureProducer::CopyParams*) const overri
de; |
166 | 176 |
167 // Checks whether glReadPixels can be called to get pixel values in readConf
ig from the | 177 // Checks whether glReadPixels can be called to get pixel values in readConf
ig from the |
168 // render target. | 178 // render target. |
169 bool readPixelsSupported(GrRenderTarget* target, GrPixelConfig readConfig); | 179 bool readPixelsSupported(GrRenderTarget* target, GrPixelConfig readConfig); |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 void flushStencil(const GrStencilSettings&); | 315 void flushStencil(const GrStencilSettings&); |
306 void flushHWAAState(GrRenderTarget* rt, bool useHWAA); | 316 void flushHWAAState(GrRenderTarget* rt, bool useHWAA); |
307 | 317 |
308 // helper for onCreateTexture and writeTexturePixels | 318 // helper for onCreateTexture and writeTexturePixels |
309 enum UploadType { | 319 enum UploadType { |
310 kNewTexture_UploadType, // we are creating a new texture | 320 kNewTexture_UploadType, // we are creating a new texture |
311 kWrite_UploadType, // we are using TexSubImage2D to copy data to
an existing texture | 321 kWrite_UploadType, // we are using TexSubImage2D to copy data to
an existing texture |
312 kTransfer_UploadType, // we are using a transfer buffer to copy dat
a | 322 kTransfer_UploadType, // we are using a transfer buffer to copy dat
a |
313 }; | 323 }; |
314 bool uploadTexData(const GrSurfaceDesc& desc, | 324 bool uploadTexData(const GrSurfaceDesc& desc, |
315 GrGLenum target, | 325 GrGLTextureInfo* info, |
316 UploadType uploadType, | 326 UploadType uploadType, |
317 int left, int top, int width, int height, | 327 int left, int top, int width, int height, |
318 GrPixelConfig dataConfig, | 328 GrPixelConfig dataConfig, |
319 const void* data, | 329 const void* data, |
320 size_t rowBytes); | 330 size_t rowBytes); |
321 | 331 |
322 // helper for onCreateCompressedTexture. If width and height are | 332 // helper for onCreateCompressedTexture. If width and height are |
323 // set to -1, then this function will use desc.fWidth and desc.fHeight | 333 // set to -1, then this function will use desc.fWidth and desc.fHeight |
324 // for the size of the data. The isNewTexture flag should be set to true | 334 // for the size of the data. The isNewTexture flag should be set to true |
325 // whenever a new texture needs to be created. Otherwise, we assume that | 335 // whenever a new texture needs to be created. Otherwise, we assume that |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 SkFAIL("Unexpected texture target type."); | 573 SkFAIL("Unexpected texture target type."); |
564 return 0; | 574 return 0; |
565 } | 575 } |
566 } | 576 } |
567 | 577 |
568 typedef GrGpu INHERITED; | 578 typedef GrGpu INHERITED; |
569 friend class GrGLPathRendering; // For accessing setTextureUnit. | 579 friend class GrGLPathRendering; // For accessing setTextureUnit. |
570 }; | 580 }; |
571 | 581 |
572 #endif | 582 #endif |
OLD | NEW |